V8 Project
d8.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_D8_H_
6 #define V8_D8_H_
7 
8 #ifndef V8_SHARED
9 #include "src/allocation.h"
10 #include "src/hashmap.h"
11 #include "src/smart-pointers.h"
12 #include "src/v8.h"
13 #else
14 #include "include/v8.h"
16 #endif // !V8_SHARED
17 
18 namespace v8 {
19 
20 
21 #ifndef V8_SHARED
22 // A single counter in a counter collection.
23 class Counter {
24  public:
25  static const int kMaxNameSize = 64;
26  int32_t* Bind(const char* name, bool histogram);
27  int32_t* ptr() { return &count_; }
28  int32_t count() { return count_; }
30  bool is_histogram() { return is_histogram_; }
31  void AddSample(int32_t sample);
32  private:
36  uint8_t name_[kMaxNameSize];
37 };
38 
39 
40 // A set of counters and associated information. An instance of this
41 // class is stored directly in the memory-mapped counters file if
42 // the --map-counters options is used
44  public:
47  private:
48  static const unsigned kMaxCounters = 512;
54 };
55 
56 
57 class CounterMap {
58  public:
60  Counter* Lookup(const char* name) {
61  i::HashMap::Entry* answer = hash_map_.Lookup(
62  const_cast<char*>(name),
63  Hash(name),
64  false);
65  if (!answer) return NULL;
66  return reinterpret_cast<Counter*>(answer->value);
67  }
68  void Set(const char* name, Counter* value) {
69  i::HashMap::Entry* answer = hash_map_.Lookup(
70  const_cast<char*>(name),
71  Hash(name),
72  true);
73  DCHECK(answer != NULL);
74  answer->value = value;
75  }
76  class Iterator {
77  public:
78  explicit Iterator(CounterMap* map)
79  : map_(&map->hash_map_), entry_(map_->Start()) { }
80  void Next() { entry_ = map_->Next(entry_); }
81  bool More() { return entry_ != NULL; }
82  const char* CurrentKey() { return static_cast<const char*>(entry_->key); }
83  Counter* CurrentValue() { return static_cast<Counter*>(entry_->value); }
84  private:
86  i::HashMap::Entry* entry_;
87  };
88 
89  private:
90  static int Hash(const char* name);
91  static bool Match(void* key1, void* key2);
93 };
94 #endif // !V8_SHARED
95 
96 
97 class LineEditor {
98  public:
99  enum Type { DUMB = 0, READLINE = 1 };
100  LineEditor(Type type, const char* name);
101  virtual ~LineEditor() { }
102 
103  virtual Handle<String> Prompt(const char* prompt) = 0;
104  virtual bool Open(Isolate* isolate) { return true; }
105  virtual bool Close() { return true; }
106  virtual void AddHistory(const char* str) { }
107 
108  const char* name() { return name_; }
109  static LineEditor* Get() { return current_; }
110  private:
112  const char* name_;
114 };
115 
116 
117 class SourceGroup {
118  public:
120 #ifndef V8_SHARED
121  next_semaphore_(0),
122  done_semaphore_(0),
123  thread_(NULL),
124 #endif // !V8_SHARED
125  argv_(NULL),
126  begin_offset_(0),
127  end_offset_(0) {}
128 
129  ~SourceGroup();
130 
131  void Begin(char** argv, int offset) {
132  argv_ = const_cast<const char**>(argv);
133  begin_offset_ = offset;
134  }
135 
136  void End(int offset) { end_offset_ = offset; }
137 
138  void Execute(Isolate* isolate);
139 
140 #ifndef V8_SHARED
141  void StartExecuteInThread();
142  void WaitForThread();
143 
144  private:
145  class IsolateThread : public base::Thread {
146  public:
147  explicit IsolateThread(SourceGroup* group)
148  : base::Thread(GetThreadOptions()), group_(group) {}
149 
150  virtual void Run() {
152  }
153 
154  private:
156  };
157 
159  void ExecuteInThread();
160 
161  base::Semaphore next_semaphore_;
162  base::Semaphore done_semaphore_;
164 #endif // !V8_SHARED
165 
166  void ExitShell(int exit_code);
167  Handle<String> ReadFile(Isolate* isolate, const char* name);
168 
169  const char** argv_;
172 };
173 
174 
176  public:
177  BinaryResource(const char* string, int length)
178  : data_(string),
179  length_(length) { }
180 
182  delete[] data_;
183  data_ = NULL;
184  length_ = 0;
185  }
186 
187  virtual const char* data() const { return data_; }
188  virtual size_t length() const { return length_; }
189 
190  private:
191  const char* data_;
192  size_t length_;
193 };
194 
195 
197  public:
200  last_run(true),
203  stress_opt(false),
206  test_shell(false),
210  num_isolates(1),
211  compile_options(v8::ScriptCompiler::kNoCompileOptions),
215  snapshot_blob(NULL) {}
216 
218  delete[] isolate_sources;
219  }
220 
223  }
224 
226  bool last_run;
239  const char* icu_data_file;
240  const char* natives_blob;
241  const char* snapshot_blob;
242 };
243 
244 #ifdef V8_SHARED
245 class Shell {
246 #else
247 class Shell : public i::AllStatic {
248 #endif // V8_SHARED
249 
250  public:
252  Isolate* isolate, Local<String> source, Local<Value> name,
253  v8::ScriptCompiler::CompileOptions compile_options);
254  static bool ExecuteString(Isolate* isolate,
255  Handle<String> source,
257  bool print_result,
258  bool report_exceptions);
259  static const char* ToCString(const v8::String::Utf8Value& value);
260  static void ReportException(Isolate* isolate, TryCatch* try_catch);
261  static Handle<String> ReadFile(Isolate* isolate, const char* name);
263  static int RunMain(Isolate* isolate, int argc, char* argv[]);
264  static int Main(int argc, char* argv[]);
265  static void Exit(int exit_code);
266  static void OnExit();
267 
268 #ifndef V8_SHARED
269  static Handle<Array> GetCompletions(Isolate* isolate,
270  Handle<String> text,
271  Handle<String> full);
272  static int* LookupCounter(const char* name);
273  static void* CreateHistogram(const char* name,
274  int min,
275  int max,
276  size_t buckets);
277  static void AddHistogramSample(void* histogram, int sample);
278  static void MapCounters(v8::Isolate* isolate, const char* name);
279 
280  static Local<Object> DebugMessageDetails(Isolate* isolate,
281  Handle<String> message);
283  Handle<String> command);
284 
285  static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args);
286 #endif // !V8_SHARED
287 
288  static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args);
289  static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args);
290  static void RealmGlobal(const v8::FunctionCallbackInfo<v8::Value>& args);
291  static void RealmCreate(const v8::FunctionCallbackInfo<v8::Value>& args);
292  static void RealmDispose(const v8::FunctionCallbackInfo<v8::Value>& args);
293  static void RealmSwitch(const v8::FunctionCallbackInfo<v8::Value>& args);
294  static void RealmEval(const v8::FunctionCallbackInfo<v8::Value>& args);
295  static void RealmSharedGet(Local<String> property,
296  const PropertyCallbackInfo<Value>& info);
297  static void RealmSharedSet(Local<String> property,
298  Local<Value> value,
299  const PropertyCallbackInfo<void>& info);
300 
301  static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
302  static void Write(const v8::FunctionCallbackInfo<v8::Value>& args);
303  static void Quit(const v8::FunctionCallbackInfo<v8::Value>& args);
304  static void Version(const v8::FunctionCallbackInfo<v8::Value>& args);
305  static void Read(const v8::FunctionCallbackInfo<v8::Value>& args);
306  static void ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
307  static Handle<String> ReadFromStdin(Isolate* isolate);
309  args.GetReturnValue().Set(ReadFromStdin(args.GetIsolate()));
310  }
311  static void Load(const v8::FunctionCallbackInfo<v8::Value>& args);
321  static void Uint8ClampedArray(
326  // The OS object on the global object contains methods for performing
327  // operating system calls:
328  //
329  // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will
330  // run the command, passing the arguments to the program. The standard output
331  // of the program will be picked up and returned as a multiline string. If
332  // timeout1 is present then it should be a number. -1 indicates no timeout
333  // and a positive number is used as a timeout in milliseconds that limits the
334  // time spent waiting between receiving output characters from the program.
335  // timeout2, if present, should be a number indicating the limit in
336  // milliseconds on the total running time of the program. Exceptions are
337  // thrown on timeouts or other errors or if the exit status of the program
338  // indicates an error.
339  //
340  // os.chdir(dir) changes directory to the given directory. Throws an
341  // exception/ on error.
342  //
343  // os.setenv(variable, value) sets an environment variable. Repeated calls to
344  // this method leak memory due to the API of setenv in the standard C library.
345  //
346  // os.umask(alue) calls the umask system call and returns the old umask.
347  //
348  // os.mkdirp(name, mask) creates a directory. The mask (if present) is anded
349  // with the current umask. Intermediate directories are created if necessary.
350  // An exception is not thrown if the directory already exists. Analogous to
351  // the "mkdir -p" command.
353  static void System(const v8::FunctionCallbackInfo<v8::Value>& args);
354  static void ChangeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
355  static void SetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
356  static void UnsetEnvironment(const v8::FunctionCallbackInfo<v8::Value>& args);
357  static void SetUMask(const v8::FunctionCallbackInfo<v8::Value>& args);
358  static void MakeDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
359  static void RemoveDirectory(const v8::FunctionCallbackInfo<v8::Value>& args);
360 
361  static void AddOSMethods(v8::Isolate* isolate,
362  Handle<ObjectTemplate> os_template);
363 
364  static const char* kPrompt;
366 
367  private:
369 #ifndef V8_SHARED
372  // We statically allocate a set of local counters to be used if we
373  // don't want to store the stats in a memory-mapped file
377  static base::Mutex context_mutex_;
378  static const base::TimeTicks kInitialTicks;
379 
380  static Counter* GetCounter(const char* name, bool is_histogram);
381  static void InstallUtilityScript(Isolate* isolate);
382 #endif // !V8_SHARED
383  static void Initialize(Isolate* isolate);
384  static void InitializeDebugger(Isolate* isolate);
385  static void RunShell(Isolate* isolate);
386  static bool SetOptions(int argc, char* argv[]);
391  Handle<Object> buffer,
392  int32_t size);
394  Handle<Object> array,
395  Handle<Object> buffer,
396  ExternalArrayType type,
397  int32_t length,
398  int32_t byteLength,
399  int32_t byteOffset,
400  int32_t element_size);
401  static void CreateExternalArray(
403  ExternalArrayType type,
404  int32_t element_size);
405  static void ExternalArrayWeakCallback(Isolate* isolate,
406  Persistent<Object>* object,
407  uint8_t* data);
408 };
409 
410 
411 } // namespace v8
412 
413 
414 #endif // V8_D8_H_
virtual size_t length() const
The number of Latin-1 characters in the string.
Definition: d8.h:188
~BinaryResource()
Definition: d8.h:181
BinaryResource(const char *string, int length)
Definition: d8.h:177
size_t length_
Definition: d8.h:192
virtual const char * data() const
The string data from the underlying buffer.
Definition: d8.h:187
const char * data_
Definition: d8.h:191
uint32_t max_name_size_
Definition: d8.h:51
Counter counters_[kMaxCounters]
Definition: d8.h:53
uint32_t max_counters_
Definition: d8.h:50
uint32_t magic_number_
Definition: d8.h:49
Counter * GetNextCounter()
Definition: d8.cc:713
uint32_t counters_in_use_
Definition: d8.h:52
static const unsigned kMaxCounters
Definition: d8.h:48
const char * CurrentKey()
Definition: d8.h:82
i::HashMap::Entry * entry_
Definition: d8.h:86
Counter * CurrentValue()
Definition: d8.h:83
i::HashMap * map_
Definition: d8.h:85
Iterator(CounterMap *map)
Definition: d8.h:78
static int Hash(const char *name)
Definition: d8.cc:735
static bool Match(void *key1, void *key2)
Definition: d8.cc:166
i::HashMap hash_map_
Definition: d8.h:92
void Set(const char *name, Counter *value)
Definition: d8.h:68
Counter * Lookup(const char *name)
Definition: d8.h:60
CounterMap()
Definition: d8.h:59
Definition: d8.h:23
int32_t * Bind(const char *name, bool histogram)
Definition: d8.cc:689
uint8_t name_[kMaxNameSize]
Definition: d8.h:36
int32_t count_
Definition: d8.h:33
static const int kMaxNameSize
Definition: d8.h:25
int32_t sample_total()
Definition: d8.h:29
int32_t * ptr()
Definition: d8.h:27
int32_t count()
Definition: d8.h:28
bool is_histogram()
Definition: d8.h:30
bool is_histogram_
Definition: d8.h:35
void AddSample(int32_t sample)
Definition: d8.cc:699
int32_t sample_total_
Definition: d8.h:34
The argument information given to function call callbacks.
Definition: v8.h:2650
ReturnValue< T > GetReturnValue() const
Definition: v8.h:6348
Isolate * GetIsolate() const
Definition: v8.h:6342
An object reference managed by the v8 garbage collector.
Definition: v8.h:198
Isolate represents an isolated instance of the V8 engine.
Definition: v8.h:4356
virtual bool Close()
Definition: d8.h:105
virtual Handle< String > Prompt(const char *prompt)=0
const char * name_
Definition: d8.h:112
const char * name()
Definition: d8.h:108
static LineEditor * Get()
Definition: d8.h:109
virtual bool Open(Isolate *isolate)
Definition: d8.h:104
@ DUMB
Definition: d8.h:99
@ READLINE
Definition: d8.h:99
Type type_
Definition: d8.h:111
virtual void AddHistory(const char *str)
Definition: d8.h:106
static LineEditor * current_
Definition: d8.h:113
virtual ~LineEditor()
Definition: d8.h:101
LineEditor(Type type, const char *name)
Definition: d8.cc:120
A light-weight stack-allocated object handle.
Definition: v8.h:334
A PersistentBase which allows copy and assignment.
Definition: v8.h:627
The information passed to a property callback about the context of the property access.
Definition: v8.h:2691
For compiling scripts.
Definition: v8.h:1019
const char * natives_blob
Definition: d8.h:240
SourceGroup * isolate_sources
Definition: d8.h:238
const char * icu_data_file
Definition: d8.h:239
bool mock_arraybuffer_allocator
Definition: d8.h:235
bool use_interactive_shell()
Definition: d8.h:221
bool script_executed
Definition: d8.h:225
bool last_run
Definition: d8.h:226
~ShellOptions()
Definition: d8.h:217
const char * snapshot_blob
Definition: d8.h:241
v8::ScriptCompiler::CompileOptions compile_options
Definition: d8.h:237
bool invoke_weak_callbacks
Definition: d8.h:228
bool test_shell
Definition: d8.h:232
bool interactive_shell
Definition: d8.h:231
bool dump_heap_constants
Definition: d8.h:233
bool stress_opt
Definition: d8.h:229
bool stress_deopt
Definition: d8.h:230
bool send_idle_notification
Definition: d8.h:227
int num_isolates
Definition: d8.h:236
ShellOptions()
Definition: d8.h:198
bool expected_to_throw
Definition: d8.h:234
Definition: d8.h:247
static void Int8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static int Main(int argc, char *argv[])
Definition: d8.cc:1603
static void Read(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:501
static Local< UnboundScript > CompileString(Isolate *isolate, Local< String > source, Local< Value > name, v8::ScriptCompiler::CompileOptions compile_options)
Definition: d8.cc:181
static CounterCollection * counters_
Definition: d8.h:375
static void SetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:663
static void AddHistogramSample(void *histogram, int sample)
Definition: d8.cc:781
static base::OS::MemoryMappedFile * counters_file_
Definition: d8.h:376
static void Quit(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:574
static void RealmSharedGet(Local< String > property, const PropertyCallbackInfo< Value > &info)
Definition: d8.cc:452
static void PerformanceNow(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:337
static void RealmEval(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:430
static void ArraySet(const v8::FunctionCallbackInfo< v8::Value > &args)
static Persistent< Context > utility_context_
Definition: d8.h:370
static void RealmCreate(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:387
static void ReadBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:1115
static Handle< Array > GetCompletions(Isolate *isolate, Handle< String > text, Handle< String > full)
Definition: d8.cc:638
static void ReadLine(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.h:308
static void CreateExternalArray(const v8::FunctionCallbackInfo< v8::Value > &args, ExternalArrayType type, int32_t element_size)
static void ReportException(Isolate *isolate, TryCatch *try_catch)
Definition: d8.cc:587
static const char * ToCString(const v8::String::Utf8Value &value)
Definition: d8.cc:175
static Handle< FunctionTemplate > CreateArrayBufferTemplate(FunctionCallback)
static Local< Object > DebugMessageDetails(Isolate *isolate, Handle< String > message)
Definition: d8.cc:657
static void * CreateHistogram(const char *name, int min, int max, size_t buckets)
Definition: d8.cc:773
static void Version(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:581
static void Uint16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void ExternalArrayWeakCallback(Isolate *isolate, Persistent< Object > *object, uint8_t *data)
static void MakeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:617
static void Int32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:469
static void InstallUtilityScript(Isolate *isolate)
Definition: d8.cc:787
static Local< Context > CreateEvaluationContext(Isolate *isolate)
Definition: d8.cc:960
static const char * kPrompt
Definition: d8.h:364
static void Uint32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Float64Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void RealmSharedSet(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
Definition: d8.cc:460
static void RealmDispose(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:405
static void Initialize(Isolate *isolate)
Definition: d8.cc:925
static void RunShell(Isolate *isolate)
Definition: d8.cc:1156
static void ArrayBufferSlice(const v8::FunctionCallbackInfo< v8::Value > &args)
static int RunMain(Isolate *isolate, int argc, char *argv[])
Definition: d8.cc:1421
static void AddOSMethods(v8::Isolate *isolate, Handle< ObjectTemplate > os_template)
Definition: d8-posix.cc:709
static base::Mutex context_mutex_
Definition: d8.h:377
static const base::TimeTicks kInitialTicks
Definition: d8.h:378
static Counter * GetCounter(const char *name, bool is_histogram)
Definition: d8.cc:746
static void RealmCurrent(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:352
static void RealmOwner(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:362
static void Int16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void ChangeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:527
static bool SetOptions(int argc, char *argv[])
Definition: d8.cc:1302
static void Exit(int exit_code)
Definition: d8.cc:991
static Local< Value > DebugCommandToJSONRequest(Isolate *isolate, Handle< String > command)
Definition: d8.cc:673
static int * LookupCounter(const char *name)
Definition: d8.cc:762
static void RealmSwitch(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:420
static void Load(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:549
static void OnExit()
Definition: d8.cc:1013
static CounterCollection local_counters_
Definition: d8.h:374
static void ArrayBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
static Handle< String > ReadFromStdin(Isolate *isolate)
Definition: d8.cc:516
static CounterMap * counter_map_
Definition: d8.h:371
static Handle< FunctionTemplate > CreateArrayTemplate(FunctionCallback)
static void Uint8ClampedArray(const v8::FunctionCallbackInfo< v8::Value > &args)
static void RealmGlobal(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:377
static void ArraySubArray(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Uint8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static Handle< String > ReadFile(Isolate *isolate, const char *name)
Definition: d8.cc:1145
static void Float32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void InitializeDebugger(Isolate *isolate)
Definition: d8.cc:949
static void System(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:440
static bool ExecuteString(Isolate *isolate, Handle< String > source, Handle< Value > name, bool print_result, bool report_exceptions)
Definition: d8.cc:211
static void UnsetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:690
static Handle< ObjectTemplate > CreateGlobalTemplate(Isolate *isolate)
Definition: d8.cc:870
static Persistent< Context > evaluation_context_
Definition: d8.h:368
static void RemoveDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:645
static Handle< Value > CreateExternalArrayBuffer(Isolate *isolate, Handle< Object > buffer, int32_t size)
static ShellOptions options
Definition: d8.h:365
static void SetUMask(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8-posix.cc:549
static Handle< Object > CreateExternalArray(Isolate *isolate, Handle< Object > array, Handle< Object > buffer, ExternalArrayType type, int32_t length, int32_t byteLength, int32_t byteOffset, int32_t element_size)
static void OSObject(const v8::FunctionCallbackInfo< v8::Value > &args)
static void MapCounters(v8::Isolate *isolate, const char *name)
Definition: d8.cc:719
static void Write(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: d8.cc:476
IsolateThread(SourceGroup *group)
Definition: d8.h:147
virtual void Run()
Definition: d8.h:150
SourceGroup * group_
Definition: d8.h:155
void Begin(char **argv, int offset)
Definition: d8.h:131
base::Thread * thread_
Definition: d8.h:163
static base::Thread::Options GetThreadOptions()
Definition: d8.cc:1233
void ExitShell(int exit_code)
void Execute(Isolate *isolate)
Definition: d8.cc:1184
base::Semaphore done_semaphore_
Definition: d8.h:162
void End(int offset)
Definition: d8.h:136
void StartExecuteInThread()
Definition: d8.cc:1277
base::Semaphore next_semaphore_
Definition: d8.h:161
SourceGroup()
Definition: d8.h:119
int end_offset_
Definition: d8.h:171
const char ** argv_
Definition: d8.h:169
void WaitForThread()
Definition: d8.cc:1286
~SourceGroup()
Definition: d8.cc:1176
Handle< String > ReadFile(Isolate *isolate, const char *name)
Definition: d8.cc:1221
void ExecuteInThread()
Definition: d8.cc:1242
int begin_offset_
Definition: d8.h:170
An ExternalOneByteStringResource is a wrapper around an one-byte string buffer that resides outside V...
Definition: v8.h:1918
Converts an object to a UTF-8-encoded character array.
Definition: v8.h:2048
An external exception handler.
Definition: v8.h:5271
Thread(const Options &options)
Entry * Next(Entry *p) const
Definition: hashmap.h:226
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
Definition: hashmap.h:114
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions true
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
Definition: logging.h:205
int int32_t
Definition: unicode.cc:24
static int min(int a, int b)
Definition: liveedit.cc:273
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
Definition: v8.h:2717
ExternalArrayType
Definition: v8.h:2217