v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
d8.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_D8_H_
29 #define V8_D8_H_
30 
31 #ifndef V8_SHARED
32 #include "allocation.h"
33 #include "hashmap.h"
34 #include "smart-pointers.h"
35 #include "v8.h"
36 #else
37 #include "../include/v8.h"
38 #endif // V8_SHARED
39 
40 namespace v8 {
41 
42 
43 #ifndef V8_SHARED
44 // A single counter in a counter collection.
45 class Counter {
46  public:
47  static const int kMaxNameSize = 64;
48  int32_t* Bind(const char* name, bool histogram);
49  int32_t* ptr() { return &count_; }
50  int32_t count() { return count_; }
51  int32_t sample_total() { return sample_total_; }
52  bool is_histogram() { return is_histogram_; }
53  void AddSample(int32_t sample);
54  private:
55  int32_t count_;
56  int32_t sample_total_;
57  bool is_histogram_;
58  uint8_t name_[kMaxNameSize];
59 };
60 
61 
62 // A set of counters and associated information. An instance of this
63 // class is stored directly in the memory-mapped counters file if
64 // the --map-counters options is used
66  public:
69  private:
70  static const unsigned kMaxCounters = 512;
71  uint32_t magic_number_;
72  uint32_t max_counters_;
73  uint32_t max_name_size_;
74  uint32_t counters_in_use_;
75  Counter counters_[kMaxCounters];
76 };
77 
78 
79 class CounterMap {
80  public:
81  CounterMap(): hash_map_(Match) { }
82  Counter* Lookup(const char* name) {
83  i::HashMap::Entry* answer = hash_map_.Lookup(
84  const_cast<char*>(name),
85  Hash(name),
86  false);
87  if (!answer) return NULL;
88  return reinterpret_cast<Counter*>(answer->value);
89  }
90  void Set(const char* name, Counter* value) {
91  i::HashMap::Entry* answer = hash_map_.Lookup(
92  const_cast<char*>(name),
93  Hash(name),
94  true);
95  ASSERT(answer != NULL);
96  answer->value = value;
97  }
98  class Iterator {
99  public:
101  : map_(&map->hash_map_), entry_(map_->Start()) { }
102  void Next() { entry_ = map_->Next(entry_); }
103  bool More() { return entry_ != NULL; }
104  const char* CurrentKey() { return static_cast<const char*>(entry_->key); }
105  Counter* CurrentValue() { return static_cast<Counter*>(entry_->value); }
106  private:
107  i::HashMap* map_;
108  i::HashMap::Entry* entry_;
109  };
110 
111  private:
112  static int Hash(const char* name);
113  static bool Match(void* key1, void* key2);
114  i::HashMap hash_map_;
115 };
116 #endif // V8_SHARED
117 
118 
119 class LineEditor {
120  public:
121  enum Type { DUMB = 0, READLINE = 1 };
122  LineEditor(Type type, const char* name);
123  virtual ~LineEditor() { }
124 
125  virtual Handle<String> Prompt(const char* prompt) = 0;
126  virtual bool Open(Isolate* isolate) { return true; }
127  virtual bool Close() { return true; }
128  virtual void AddHistory(const char* str) { }
129 
130  const char* name() { return name_; }
131  static LineEditor* Get() { return current_; }
132  private:
133  Type type_;
134  const char* name_;
135  static LineEditor* current_;
136 };
137 
138 
139 class SourceGroup {
140  public:
142 #ifndef V8_SHARED
143  next_semaphore_(0),
144  done_semaphore_(0),
145  thread_(NULL),
146 #endif // V8_SHARED
147  argv_(NULL),
148  begin_offset_(0),
149  end_offset_(0) {}
150 
151  ~SourceGroup();
152 
153  void Begin(char** argv, int offset) {
154  argv_ = const_cast<const char**>(argv);
155  begin_offset_ = offset;
156  }
157 
158  void End(int offset) { end_offset_ = offset; }
159 
160  void Execute(Isolate* isolate);
161 
162 #ifndef V8_SHARED
163  void StartExecuteInThread();
164  void WaitForThread();
165 
166  private:
167  class IsolateThread : public i::Thread {
168  public:
169  explicit IsolateThread(SourceGroup* group)
170  : i::Thread(GetThreadOptions()), group_(group) {}
171 
172  virtual void Run() {
173  group_->ExecuteInThread();
174  }
175 
176  private:
177  SourceGroup* group_;
178  };
179 
180  static i::Thread::Options GetThreadOptions();
181  void ExecuteInThread();
182 
183  i::Semaphore next_semaphore_;
184  i::Semaphore done_semaphore_;
185  i::Thread* thread_;
186 #endif // V8_SHARED
187 
188  void ExitShell(int exit_code);
189  Handle<String> ReadFile(Isolate* isolate, const char* name);
190 
191  const char** argv_;
192  int begin_offset_;
193  int end_offset_;
194 };
195 
196 
198  public:
199  BinaryResource(const char* string, int length)
200  : data_(string),
201  length_(length) { }
202 
204  delete[] data_;
205  data_ = NULL;
206  length_ = 0;
207  }
208 
209  virtual const char* data() const { return data_; }
210  virtual size_t length() const { return length_; }
211 
212  private:
213  const char* data_;
214  size_t length_;
215 };
216 
217 
219  public:
221 #ifndef V8_SHARED
224 #endif // V8_SHARED
226  last_run(true),
228  stress_opt(false),
231  test_shell(false),
235  num_isolates(1),
237  icu_data_file(NULL) { }
238 
240 #ifndef V8_SHARED
241  delete[] parallel_files;
242 #endif // V8_SHARED
243  delete[] isolate_sources;
244  }
245 
246 #ifndef V8_SHARED
249 #endif // V8_SHARED
251  bool last_run;
262  const char* icu_data_file;
263 };
264 
265 #ifdef V8_SHARED
266 class Shell {
267 #else
268 class Shell : public i::AllStatic {
269 #endif // V8_SHARED
270 
271  public:
272  static bool ExecuteString(Isolate* isolate,
273  Handle<String> source,
275  bool print_result,
276  bool report_exceptions);
277  static const char* ToCString(const v8::String::Utf8Value& value);
278  static void ReportException(Isolate* isolate, TryCatch* try_catch);
279  static Handle<String> ReadFile(Isolate* isolate, const char* name);
281  static int RunMain(Isolate* isolate, int argc, char* argv[]);
282  static int Main(int argc, char* argv[]);
283  static void Exit(int exit_code);
284  static void OnExit();
285 
286 #ifndef V8_SHARED
287  static Handle<Array> GetCompletions(Isolate* isolate,
288  Handle<String> text,
289  Handle<String> full);
290  static int* LookupCounter(const char* name);
291  static void* CreateHistogram(const char* name,
292  int min,
293  int max,
294  size_t buckets);
295  static void AddHistogramSample(void* histogram, int sample);
296  static void MapCounters(const char* name);
297 
298 #ifdef ENABLE_DEBUGGER_SUPPORT
299  static Local<Object> DebugMessageDetails(Isolate* isolate,
301  static Local<Value> DebugCommandToJSONRequest(Isolate* isolate,
302  Handle<String> command);
303  static void DispatchDebugMessages();
304 #endif // ENABLE_DEBUGGER_SUPPORT
305 
306  static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args);
307 #endif // V8_SHARED
308 
309  static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args);
310  static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args);
311  static void RealmGlobal(const v8::FunctionCallbackInfo<v8::Value>& args);
312  static void RealmCreate(const v8::FunctionCallbackInfo<v8::Value>& args);
313  static void RealmDispose(const v8::FunctionCallbackInfo<v8::Value>& args);
314  static void RealmSwitch(const v8::FunctionCallbackInfo<v8::Value>& args);
315  static void RealmEval(const v8::FunctionCallbackInfo<v8::Value>& args);
316  static void RealmSharedGet(Local<String> property,
318  static void RealmSharedSet(Local<String> property,
319  Local<Value> value,
320  const PropertyCallbackInfo<void>& info);
321 
322  static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
323  static void Write(const v8::FunctionCallbackInfo<v8::Value>& args);
324  static void Quit(const v8::FunctionCallbackInfo<v8::Value>& args);
325  static void Version(const v8::FunctionCallbackInfo<v8::Value>& args);
326  static void Read(const v8::FunctionCallbackInfo<v8::Value>& args);
327  static void ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
328  static Handle<String> ReadFromStdin(Isolate* isolate);
330  args.GetReturnValue().Set(ReadFromStdin(args.GetIsolate()));
331  }
332  static void Load(const v8::FunctionCallbackInfo<v8::Value>& args);
333  static void ArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
334  static void Int8Array(const v8::FunctionCallbackInfo<v8::Value>& args);
335  static void Uint8Array(const v8::FunctionCallbackInfo<v8::Value>& args);
336  static void Int16Array(const v8::FunctionCallbackInfo<v8::Value>& args);
337  static void Uint16Array(const v8::FunctionCallbackInfo<v8::Value>& args);
338  static void Int32Array(const v8::FunctionCallbackInfo<v8::Value>& args);
339  static void Uint32Array(const v8::FunctionCallbackInfo<v8::Value>& args);
340  static void Float32Array(const v8::FunctionCallbackInfo<v8::Value>& args);
341  static void Float64Array(const v8::FunctionCallbackInfo<v8::Value>& args);
342  static void Uint8ClampedArray(
344  static void ArrayBufferSlice(const v8::FunctionCallbackInfo<v8::Value>& args);
345  static void ArraySubArray(const v8::FunctionCallbackInfo<v8::Value>& args);
346  static void ArraySet(const v8::FunctionCallbackInfo<v8::Value>& args);
347  // The OS object on the global object contains methods for performing
348  // operating system calls:
349  //
350  // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will
351  // run the command, passing the arguments to the program. The standard output
352  // of the program will be picked up and returned as a multiline string. If
353  // timeout1 is present then it should be a number. -1 indicates no timeout
354  // and a positive number is used as a timeout in milliseconds that limits the
355  // time spent waiting between receiving output characters from the program.
356  // timeout2, if present, should be a number indicating the limit in
357  // milliseconds on the total running time of the program. Exceptions are
358  // thrown on timeouts or other errors or if the exit status of the program
359  // indicates an error.
360  //
361  // os.chdir(dir) changes directory to the given directory. Throws an
362  // exception/ on error.
363  //
364  // os.setenv(variable, value) sets an environment variable. Repeated calls to
365  // this method leak memory due to the API of setenv in the standard C library.
366  //
367  // os.umask(alue) calls the umask system call and returns the old umask.
368  //
369  // os.mkdirp(name, mask) creates a directory. The mask (if present) is anded
370  // with the current umask. Intermediate directories are created if necessary.
371  // An exception is not thrown if the directory already exists. Analogous to
372  // the "mkdir -p" command.
373  static void OSObject(const v8::FunctionCallbackInfo<v8::Value>& args);
374  static void System(const v8::FunctionCallbackInfo<v8::Value>& args);
375  static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
376  static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
377  static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
378  static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args);
379  static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
380  static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
381 
382  static void AddOSMethods(v8::Isolate* isolate,
383  Handle<ObjectTemplate> os_template);
384 
385  static const char* kPrompt;
387 
388  private:
389  static Persistent<Context> evaluation_context_;
390 #ifndef V8_SHARED
391  static Persistent<Context> utility_context_;
392  static CounterMap* counter_map_;
393  // We statically allocate a set of local counters to be used if we
394  // don't want to store the stats in a memory-mapped file
395  static CounterCollection local_counters_;
396  static CounterCollection* counters_;
397  static i::OS::MemoryMappedFile* counters_file_;
398  static i::Mutex context_mutex_;
399  static const i::TimeTicks kInitialTicks;
400 
401  static Counter* GetCounter(const char* name, bool is_histogram);
402  static void InstallUtilityScript(Isolate* isolate);
403 #endif // V8_SHARED
404  static void Initialize(Isolate* isolate);
405  static void InitializeDebugger(Isolate* isolate);
406  static void RunShell(Isolate* isolate);
407  static bool SetOptions(int argc, char* argv[]);
409  static Handle<FunctionTemplate> CreateArrayBufferTemplate(FunctionCallback);
410  static Handle<FunctionTemplate> CreateArrayTemplate(FunctionCallback);
411  static Handle<Value> CreateExternalArrayBuffer(Isolate* isolate,
412  Handle<Object> buffer,
413  int32_t size);
414  static Handle<Object> CreateExternalArray(Isolate* isolate,
415  Handle<Object> array,
416  Handle<Object> buffer,
417  ExternalArrayType type,
418  int32_t length,
419  int32_t byteLength,
420  int32_t byteOffset,
421  int32_t element_size);
422  static void CreateExternalArray(
424  ExternalArrayType type,
425  int32_t element_size);
426  static void ExternalArrayWeakCallback(Isolate* isolate,
427  Persistent<Object>* object,
428  uint8_t* data);
429 };
430 
431 
432 } // namespace v8
433 
434 
435 #endif // V8_D8_H_
static void Float64Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Exit(int exit_code)
Definition: d8.cc:997
const char * icu_data_file
Definition: d8.h:262
~ShellOptions()
Definition: d8.h:239
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
void Set(const char *name, Counter *value)
Definition: d8.h:90
int num_parallel_files
Definition: d8.h:247
static LineEditor * Get()
Definition: d8.h:131
CounterMap()
Definition: d8.h:81
static void SetUMask(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:568
static void OSObject(const v8::FunctionCallbackInfo< v8::Value > &args)
char ** parallel_files
Definition: d8.h:248
SourceGroup()
Definition: d8.h:141
static void ArrayBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Read(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:473
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
Definition: v8.h:2603
V8_INLINE Isolate * GetIsolate() const
Definition: v8.h:6061
static bool ExecuteString(Isolate *isolate, Handle< String > source, Handle< Value > name, bool print_result, bool report_exceptions)
Definition: d8.cc:191
static int Main(int argc, char *argv[])
Definition: d8.cc:1678
void WaitForThread()
Definition: d8.cc:1377
static void AddHistogramSample(void *histogram, int sample)
Definition: d8.cc:770
void AddSample(int32_t sample)
Definition: d8.cc:688
V8_INLINE ReturnValue< T > GetReturnValue() const
Definition: v8.h:6067
bool interactive_shell
Definition: d8.h:255
static int RunMain(Isolate *isolate, int argc, char *argv[])
Definition: d8.cc:1504
TickSample * sample
static void RemoveDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:660
virtual size_t length() const
Definition: d8.h:210
int int32_t
Definition: unicode.cc:47
static Handle< Array > GetCompletions(Isolate *isolate, Handle< String > text, Handle< String > full)
Definition: d8.cc:613
int32_t * ptr()
Definition: d8.h:49
static void ReportException(Isolate *isolate, TryCatch *try_catch)
Definition: d8.cc:562
Counter * GetNextCounter()
Definition: d8.cc:702
int32_t * Bind(const char *name, bool histogram)
Definition: d8.cc:678
#define ASSERT(condition)
Definition: checks.h:329
ExternalArrayType
Definition: v8.h:2113
void End(int offset)
Definition: d8.h:158
static void RealmCurrent(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:324
static void Int8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static const int kMaxNameSize
Definition: d8.h:47
static void Uint8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
bool expected_to_throw
Definition: d8.h:258
static void RealmSharedGet(Local< String > property, const PropertyCallbackInfo< Value > &info)
Definition: d8.cc:424
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage message
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
static void System(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:459
Iterator(CounterMap *map)
Definition: d8.h:100
static void ArrayBufferSlice(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Version(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:556
static Local< Context > CreateEvaluationContext(Isolate *isolate)
Definition: d8.cc:966
static ShellOptions options
Definition: d8.h:386
static void SetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:678
virtual const char * data() const
Definition: d8.h:209
static void Quit(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:549
LineEditor(Type type, const char *name)
Definition: d8.cc:131
static void Int16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
bool is_histogram()
Definition: d8.h:52
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths true
static Handle< String > ReadFile(Isolate *isolate, const char *name)
Definition: d8.cc:1176
static void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:441
static void Uint8ClampedArray(const v8::FunctionCallbackInfo< v8::Value > &args)
static const char * ToCString(const v8::String::Utf8Value &value)
Definition: d8.cc:185
int32_t sample_total()
Definition: d8.h:51
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
static void RealmGlobal(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:349
SourceGroup * isolate_sources
Definition: d8.h:261
Counter * CurrentValue()
Definition: d8.h:105
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
Definition: hashmap.h:131
~SourceGroup()
Definition: d8.cc:1273
int num_isolates
Definition: d8.h:260
static void ChangeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:546
static const char * kPrompt
Definition: d8.h:385
static void Uint16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
bool stress_opt
Definition: d8.h:253
void Execute(Isolate *isolate)
Definition: d8.cc:1281
v8::Handle< v8::ObjectTemplate > CreateGlobalTemplate(v8::Isolate *isolate, v8::FunctionCallback terminate, v8::FunctionCallback doloop)
static void * CreateHistogram(const char *name, int min, int max, size_t buckets)
Definition: d8.cc:762
const char * name()
Definition: d8.h:130
ShellOptions()
Definition: d8.h:220
static void RealmCreate(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:359
bool stress_deopt
Definition: d8.h:254
virtual bool Close()
Definition: d8.h:127
Counter * Lookup(const char *name)
Definition: d8.h:82
BinaryResource(const char *string, int length)
Definition: d8.h:199
Definition: d8.h:268
virtual Handle< String > Prompt(const char *prompt)=0
static void RealmSharedSet(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
Definition: d8.cc:432
static void ArraySet(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Int32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void ReadLine(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.h:329
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
bool mock_arraybuffer_allocator
Definition: d8.h:259
static void RealmEval(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:402
static void Load(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:524
virtual bool Open(Isolate *isolate)
Definition: d8.h:126
static void RealmSwitch(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:392
static void ArraySubArray(const v8::FunctionCallbackInfo< v8::Value > &args)
void Begin(char **argv, int offset)
Definition: d8.h:153
static void MapCounters(const char *name)
Definition: d8.cc:708
virtual ~LineEditor()
Definition: d8.h:123
static void UnsetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:705
int32_t count()
Definition: d8.h:50
static void RealmDispose(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:377
bool test_shell
Definition: d8.h:256
static void Write(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:448
const char * CurrentKey()
Definition: d8.h:104
virtual void AddHistory(const char *str)
Definition: d8.h:128
static void ReadBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:1123
static int * LookupCounter(const char *name)
Definition: d8.cc:751
static void AddOSMethods(v8::Isolate *isolate, Handle< ObjectTemplate > os_template)
Definition: d8-posix.cc:724
~BinaryResource()
Definition: d8.h:203
static Handle< String > ReadFromStdin(Isolate *isolate)
Definition: d8.cc:488
bool script_executed
Definition: d8.h:250
bool send_idle_notification
Definition: d8.h:252
static void PerformanceNow(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:316
void RunShell(v8::Handle< v8::Context > context)
Definition: shell.cc:276
static void Float32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.h:45
void StartExecuteInThread()
Definition: d8.cc:1368
static void OnExit()
Definition: d8.cc:1019
bool dump_heap_constants
Definition: d8.h:257
Entry * Next(Entry *p) const
Definition: hashmap.h:243
static void RealmOwner(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:334
static void MakeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:632
static void Uint32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
bool last_run
Definition: d8.h:251