37 #include "../include/v8.h"
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];
83 i::HashMap::Entry* answer = hash_map_.
Lookup(
84 const_cast<char*>(name),
87 if (!answer)
return NULL;
88 return reinterpret_cast<Counter*
>(answer->value);
91 i::HashMap::Entry* answer = hash_map_.
Lookup(
92 const_cast<char*>(name),
96 answer->value = value;
101 : map_(&map->hash_map_), entry_(map_->Start()) { }
104 const char*
CurrentKey() {
return static_cast<const char*
>(entry_->key); }
108 i::HashMap::Entry* entry_;
112 static int Hash(
const char*
name);
113 static bool Match(
void* key1,
void* key2);
127 virtual bool Close() {
return true; }
130 const char*
name() {
return name_; }
153 void Begin(
char** argv,
int offset) {
154 argv_ =
const_cast<const char**
>(argv);
155 begin_offset_ = offset;
158 void End(
int offset) { end_offset_ = offset; }
170 : i::Thread(GetThreadOptions()), group_(group) {}
173 group_->ExecuteInThread();
180 static i::Thread::Options GetThreadOptions();
181 void ExecuteInThread();
183 i::Semaphore next_semaphore_;
184 i::Semaphore done_semaphore_;
188 void ExitShell(
int exit_code);
189 Handle<String> ReadFile(Isolate* isolate,
const char*
name);
209 virtual const char*
data()
const {
return data_; }
210 virtual size_t length()
const {
return length_; }
276 bool report_exceptions);
282 static int Main(
int argc,
char* argv[]);
283 static void Exit(
int exit_code);
298 #ifdef ENABLE_DEBUGGER_SUPPORT
303 static void DispatchDebugMessages();
304 #endif // ENABLE_DEBUGGER_SUPPORT
397 static i::OS::MemoryMappedFile* counters_file_;
398 static i::Mutex context_mutex_;
399 static const i::TimeTicks kInitialTicks;
401 static Counter* GetCounter(
const char* name,
bool is_histogram);
402 static void InstallUtilityScript(
Isolate* isolate);
404 static void Initialize(
Isolate* isolate);
405 static void InitializeDebugger(
Isolate* isolate);
407 static bool SetOptions(
int argc,
char* argv[]);
422 static void CreateExternalArray(
426 static void ExternalArrayWeakCallback(
Isolate* isolate,
static void Float64Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Exit(int exit_code)
const char * icu_data_file
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)
static LineEditor * Get()
static void SetUMask(const v8::FunctionCallbackInfo< v8::Value > &args)
static void OSObject(const v8::FunctionCallbackInfo< v8::Value > &args)
static void ArrayBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Read(const v8::FunctionCallbackInfo< v8::Value > &args)
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
V8_INLINE Isolate * GetIsolate() const
static bool ExecuteString(Isolate *isolate, Handle< String > source, Handle< Value > name, bool print_result, bool report_exceptions)
static int Main(int argc, char *argv[])
static void AddHistogramSample(void *histogram, int sample)
void AddSample(int32_t sample)
V8_INLINE ReturnValue< T > GetReturnValue() const
static int RunMain(Isolate *isolate, int argc, char *argv[])
static void RemoveDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
virtual size_t length() const
static Handle< Array > GetCompletions(Isolate *isolate, Handle< String > text, Handle< String > full)
static void ReportException(Isolate *isolate, TryCatch *try_catch)
Counter * GetNextCounter()
int32_t * Bind(const char *name, bool histogram)
#define ASSERT(condition)
static void RealmCurrent(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Int8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static const int kMaxNameSize
static void Uint8Array(const v8::FunctionCallbackInfo< v8::Value > &args)
static void RealmSharedGet(Local< String > property, const PropertyCallbackInfo< Value > &info)
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)
Iterator(CounterMap *map)
static void ArrayBufferSlice(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Version(const v8::FunctionCallbackInfo< v8::Value > &args)
static Local< Context > CreateEvaluationContext(Isolate *isolate)
static ShellOptions options
static void SetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
virtual const char * data() const
static void Quit(const v8::FunctionCallbackInfo< v8::Value > &args)
LineEditor(Type type, const char *name)
static void Int16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
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)
static void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Uint8ClampedArray(const v8::FunctionCallbackInfo< v8::Value > &args)
static const char * ToCString(const v8::String::Utf8Value &value)
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)
SourceGroup * isolate_sources
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
static void ChangeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
static const char * kPrompt
static void Uint16Array(const v8::FunctionCallbackInfo< v8::Value > &args)
void Execute(Isolate *isolate)
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)
static void RealmCreate(const v8::FunctionCallbackInfo< v8::Value > &args)
Counter * Lookup(const char *name)
BinaryResource(const char *string, int length)
virtual Handle< String > Prompt(const char *prompt)=0
static void RealmSharedSet(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
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)
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
static void RealmEval(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Load(const v8::FunctionCallbackInfo< v8::Value > &args)
virtual bool Open(Isolate *isolate)
static void RealmSwitch(const v8::FunctionCallbackInfo< v8::Value > &args)
static void ArraySubArray(const v8::FunctionCallbackInfo< v8::Value > &args)
void Begin(char **argv, int offset)
static void MapCounters(const char *name)
static void UnsetEnvironment(const v8::FunctionCallbackInfo< v8::Value > &args)
static void RealmDispose(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Write(const v8::FunctionCallbackInfo< v8::Value > &args)
const char * CurrentKey()
virtual void AddHistory(const char *str)
static void ReadBuffer(const v8::FunctionCallbackInfo< v8::Value > &args)
static int * LookupCounter(const char *name)
static void AddOSMethods(v8::Isolate *isolate, Handle< ObjectTemplate > os_template)
static Handle< String > ReadFromStdin(Isolate *isolate)
bool send_idle_notification
static void PerformanceNow(const v8::FunctionCallbackInfo< v8::Value > &args)
void RunShell(v8::Handle< v8::Context > context)
static void Float32Array(const v8::FunctionCallbackInfo< v8::Value > &args)
void StartExecuteInThread()
Entry * Next(Entry *p) const
static void RealmOwner(const v8::FunctionCallbackInfo< v8::Value > &args)
static void MakeDirectory(const v8::FunctionCallbackInfo< v8::Value > &args)
static void Uint32Array(const v8::FunctionCallbackInfo< v8::Value > &args)