74 class CodeEventListener;
75 class CompilationInfo;
79 class PositionsRecorder;
86 #define LOG(isolate, Call) \
88 v8::internal::Logger* logger = \
89 (isolate)->logger(); \
90 if (logger->is_logging()) \
94 #define LOG_CODE_EVENT(isolate, Call) \
96 v8::internal::Logger* logger = \
97 (isolate)->logger(); \
98 if (logger->is_logging_code_events()) \
103 #define LOG_EVENTS_AND_TAGS_LIST(V) \
104 V(CODE_CREATION_EVENT, "code-creation") \
105 V(CODE_MOVE_EVENT, "code-move") \
106 V(CODE_DELETE_EVENT, "code-delete") \
107 V(CODE_MOVING_GC, "code-moving-gc") \
108 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
109 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
110 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \
111 V(TICK_EVENT, "tick") \
112 V(REPEAT_META_EVENT, "repeat") \
113 V(BUILTIN_TAG, "Builtin") \
114 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \
115 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \
116 V(CALL_INITIALIZE_TAG, "CallInitialize") \
117 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \
118 V(CALL_MISS_TAG, "CallMiss") \
119 V(CALL_NORMAL_TAG, "CallNormal") \
120 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic") \
121 V(LOAD_INITIALIZE_TAG, "LoadInitialize") \
122 V(LOAD_PREMONOMORPHIC_TAG, "LoadPreMonomorphic") \
123 V(LOAD_MEGAMORPHIC_TAG, "LoadMegamorphic") \
124 V(STORE_INITIALIZE_TAG, "StoreInitialize") \
125 V(STORE_PREMONOMORPHIC_TAG, "StorePreMonomorphic") \
126 V(STORE_GENERIC_TAG, "StoreGeneric") \
127 V(STORE_MEGAMORPHIC_TAG, "StoreMegamorphic") \
128 V(KEYED_CALL_DEBUG_BREAK_TAG, "KeyedCallDebugBreak") \
129 V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG, \
130 "KeyedCallDebugPrepareStepIn") \
131 V(KEYED_CALL_INITIALIZE_TAG, "KeyedCallInitialize") \
132 V(KEYED_CALL_MEGAMORPHIC_TAG, "KeyedCallMegamorphic") \
133 V(KEYED_CALL_MISS_TAG, "KeyedCallMiss") \
134 V(KEYED_CALL_NORMAL_TAG, "KeyedCallNormal") \
135 V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic") \
136 V(CALLBACK_TAG, "Callback") \
137 V(EVAL_TAG, "Eval") \
138 V(FUNCTION_TAG, "Function") \
139 V(HANDLER_TAG, "Handler") \
140 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \
141 V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \
142 V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \
143 V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \
144 V(KEYED_STORE_POLYMORPHIC_IC_TAG, "KeyedStorePolymorphicIC") \
145 V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \
146 V(LAZY_COMPILE_TAG, "LazyCompile") \
147 V(LOAD_IC_TAG, "LoadIC") \
148 V(LOAD_POLYMORPHIC_IC_TAG, "LoadPolymorphicIC") \
149 V(REG_EXP_TAG, "RegExp") \
150 V(SCRIPT_TAG, "Script") \
151 V(STORE_IC_TAG, "StoreIC") \
152 V(STORE_POLYMORPHIC_IC_TAG, "StorePolymorphicIC") \
153 V(STUB_TAG, "Stub") \
154 V(NATIVE_FUNCTION_TAG, "Function") \
155 V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \
156 V(NATIVE_SCRIPT_TAG, "Script")
162 class PerfBasicLogger;
163 class LowLevelLogger;
169 #define DECLARE_ENUM(enum_item, ignore) enum_item,
221 void DebugTag(
const char* call_site_tag);
260 Name* source,
int line,
int column);
294 int number,
int bytes);
300 intptr_t capacity, intptr_t used);
325 : isolate_(isolate), name_(name) {
384 static const int kSamplingIntervalMs = 1;
395 void ProfilerBeginEvent();
398 void CallbackEventInternal(
const char* prefix,
409 void LogCodeObject(
Object* code_object);
417 void ApiEvent(
const char*
name, ...);
420 void UncheckedStringEvent(
const char*
name,
const char* value);
423 void UncheckedIntEvent(
const char*
name,
int value);
424 void UncheckedIntPtrTEvent(
const char*
name, intptr_t value);
437 const char*
const* log_events_;
458 bool is_initialized_;
472 const char* comment) = 0;
486 int line,
int column) = 0;
508 const char* comment);
525 int line,
int column);
537 virtual void LogRecordedBuffer(
Code* code,
542 NameBuffer* name_buffer_;
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
static void LogInternalEvents(const char *name, int se)
static void NewEventStatic(const char *name, void *object, size_t size)
void RegExpCodeCreateEvent(Code *code, String *source)
static const char * v8_recompile_concurrent
void CodeMoveEvent(Address from, Address to)
static void EnterExternal(Isolate *isolate)
void CallbackEvent(Name *name, Address entry_point)
static void DeleteEventStatic(const char *name, void *object)
void GetterCallbackEvent(Name *name, Address entry_point)
bool is_logging_code_events()
void LogCompiledFunctions()
void CodeDeleteEvent(Address from)
void CodeNameEvent(Address addr, int pos, const char *code_name)
void IntPtrTEvent(const char *name, intptr_t value)
void ApiNamedSecurityCheck(Object *key)
void LogTimerEvent(StartEnd se)
void HandleEvent(const char *name, Object **location)
TimerEventScope(Isolate *isolate, const char *name)
virtual void GetterCallbackEvent(Name *name, Address entry_point)
void ApiIndexedSecurityCheck(uint32_t index)
void CodeStartLinePosInfoRecordEvent(PositionsRecorder *pos_recorder)
void SnapshotPositionEvent(Address addr, int pos)
void CodeDeoptEvent(Code *code)
void HeapSampleJSProducerEvent(const char *constructor, Address *stack)
friend class LoggerTestHelper
void HeapSampleBeginEvent(const char *space, const char *kind)
void CodeLinePosInfoAddPositionEvent(void *jit_handler_data, int pc_offset, int position)
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
void addCodeEventListener(CodeEventListener *listener)
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
static const char * v8_external
void CodeEndLinePosInfoRecordEvent(Code *code, void *jit_handler_data)
#define DECLARE_ENUM(enum_item, ignore)
bool SetUp(Isolate *isolate)
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
virtual void SetterCallbackEvent(Name *name, Address entry_point)
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 code(assertions) for debugging") DEFINE_bool(code_comments
void RegExpCompileEvent(Handle< JSRegExp > regexp, bool in_cache)
void LogRuntime(Vector< const char > format, Handle< JSArray > args)
void HeapSampleStats(const char *space, const char *kind, intptr_t capacity, intptr_t used)
INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script *))
void SuspectReadEvent(Name *name, Object *obj)
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
virtual void CallbackEvent(Name *name, Address entry_point)
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
void SharedLibraryEvent(const char *library_path, uintptr_t start, uintptr_t end)
static const char * v8_execute
void ApiEntryCall(const char *name)
void(* JitCodeEventHandler)(const JitCodeEvent *event)
bool hasCodeEventListener(CodeEventListener *listener)
void HeapSampleEndEvent(const char *space, const char *kind)
static void EmptyLogInternalEvents(const char *name, int se)
virtual void CodeMovingGCEvent()
void HeapSampleJSConstructorEvent(const char *constructor, int number, int bytes)
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
void HeapSampleItemEvent(const char *type, int number, int bytes)
void DeleteEvent(const char *name, void *object)
static const char * v8_recompile_synchronous
void ApiObjectAccess(const char *tag, JSObject *obj)
virtual ~CodeEventListener()
void CodeLinePosInfoAddStatementPositionEvent(void *jit_handler_data, int pc_offset, int position)
static void LeaveExternal(Isolate *isolate)
static const int kSamplingIntervalMs
static const char * v8_compile_full_code
void HeapSampleJSRetainersEvent(const char *constructor, const char *event)
void SharedFunctionInfoMoveEvent(Address from, Address to)
void IntEvent(const char *name, int value)
void LogAccessorCallbacks()
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)
void removeCodeEventListener(CodeEventListener *listener)
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
void DebugTag(const char *call_site_tag)
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
void ResourceEvent(const char *name, const char *tag)
void NewEvent(const char *name, void *object, size_t size)
#define LOG_EVENTS_AND_TAGS_LIST(V)
void TimerEvent(StartEnd se, const char *name)
void StringEvent(const char *name, const char *value)
void SetterCallbackEvent(Name *name, Address entry_point)
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)