58 class CodeEventListener;
59 class CompilationInfo;
63 class PositionsRecorder;
69 #define LOG(isolate, Call) \
71 v8::internal::Logger* logger = \
72 (isolate)->logger(); \
73 if (logger->is_logging()) \
77 #define LOG_CODE_EVENT(isolate, Call) \
79 v8::internal::Logger* logger = \
80 (isolate)->logger(); \
81 if (logger->is_logging_code_events()) \
86 #define LOG_EVENTS_AND_TAGS_LIST(V) \
87 V(CODE_CREATION_EVENT, "code-creation") \
88 V(CODE_DISABLE_OPT_EVENT, "code-disable-optimization") \
89 V(CODE_MOVE_EVENT, "code-move") \
90 V(CODE_DELETE_EVENT, "code-delete") \
91 V(CODE_MOVING_GC, "code-moving-gc") \
92 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
93 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
94 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \
95 V(TICK_EVENT, "tick") \
96 V(REPEAT_META_EVENT, "repeat") \
97 V(BUILTIN_TAG, "Builtin") \
98 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \
99 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \
100 V(CALL_INITIALIZE_TAG, "CallInitialize") \
101 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \
102 V(CALL_MISS_TAG, "CallMiss") \
103 V(CALL_NORMAL_TAG, "CallNormal") \
104 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic") \
105 V(LOAD_INITIALIZE_TAG, "LoadInitialize") \
106 V(LOAD_PREMONOMORPHIC_TAG, "LoadPreMonomorphic") \
107 V(LOAD_MEGAMORPHIC_TAG, "LoadMegamorphic") \
108 V(STORE_INITIALIZE_TAG, "StoreInitialize") \
109 V(STORE_PREMONOMORPHIC_TAG, "StorePreMonomorphic") \
110 V(STORE_GENERIC_TAG, "StoreGeneric") \
111 V(STORE_MEGAMORPHIC_TAG, "StoreMegamorphic") \
112 V(KEYED_CALL_DEBUG_BREAK_TAG, "KeyedCallDebugBreak") \
113 V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG, \
114 "KeyedCallDebugPrepareStepIn") \
115 V(KEYED_CALL_INITIALIZE_TAG, "KeyedCallInitialize") \
116 V(KEYED_CALL_MEGAMORPHIC_TAG, "KeyedCallMegamorphic") \
117 V(KEYED_CALL_MISS_TAG, "KeyedCallMiss") \
118 V(KEYED_CALL_NORMAL_TAG, "KeyedCallNormal") \
119 V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic") \
120 V(CALLBACK_TAG, "Callback") \
121 V(EVAL_TAG, "Eval") \
122 V(FUNCTION_TAG, "Function") \
123 V(HANDLER_TAG, "Handler") \
124 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \
125 V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \
126 V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \
127 V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \
128 V(KEYED_STORE_POLYMORPHIC_IC_TAG, "KeyedStorePolymorphicIC") \
129 V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \
130 V(LAZY_COMPILE_TAG, "LazyCompile") \
131 V(CALL_IC_TAG, "CallIC") \
132 V(LOAD_IC_TAG, "LoadIC") \
133 V(LOAD_POLYMORPHIC_IC_TAG, "LoadPolymorphicIC") \
134 V(REG_EXP_TAG, "RegExp") \
135 V(SCRIPT_TAG, "Script") \
136 V(STORE_IC_TAG, "StoreIC") \
137 V(STORE_POLYMORPHIC_IC_TAG, "StorePolymorphicIC") \
138 V(STUB_TAG, "Stub") \
139 V(NATIVE_FUNCTION_TAG, "Function") \
140 V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \
141 V(NATIVE_SCRIPT_TAG, "Script")
147 class PerfBasicLogger;
148 class LowLevelLogger;
156 #define DECLARE_ENUM(enum_item, ignore) enum_item,
208 void DebugTag(
const char* call_site_tag);
235 Code* code,
const char* source);
247 Name* source,
int line,
int column);
283 int number,
int bytes);
289 intptr_t capacity, intptr_t used);
423 #define TIMER_EVENTS_LIST(V) \
424 V(RecompileSynchronous, true) \
425 V(RecompileConcurrent, true) \
426 V(CompileFullCode, true) \
431 #define V(TimerName, expose) \
432 class TimerEvent##TimerName : public AllStatic { \
434 static const char* name(void* unused = NULL) { return "V8." #TimerName; } \
435 static bool expose_to_api() { return expose; } \
441 template <
class TimerEvent>
463 const char* comment) = 0;
477 int line,
int column) = 0;
500 const char* comment);
517 int line,
int column);
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, Name *name)=0
virtual void CodeMoveEvent(Address from, Address to)=0
virtual void CodeMovingGCEvent()=0
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, int args_count)=0
virtual void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)=0
virtual void CodeDeleteEvent(Address from)=0
virtual void CallbackEvent(Name *name, Address entry_point)=0
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *name)=0
virtual void GetterCallbackEvent(Name *name, Address entry_point)=0
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)=0
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)=0
virtual void SetterCallbackEvent(Name *name, Address entry_point)=0
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *source, int line, int column)=0
virtual void RegExpCodeCreateEvent(Code *code, String *source)=0
virtual ~CodeEventListener()
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)
virtual ~CodeEventLogger()
virtual void SetterCallbackEvent(Name *name, Address entry_point)
virtual void LogRecordedBuffer(Code *code, SharedFunctionInfo *shared, const char *name, int length)=0
virtual void RegExpCodeCreateEvent(Code *code, String *source)
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)
virtual void CodeMovingGCEvent()
NameBuffer * name_buffer_
virtual void GetterCallbackEvent(Name *name, Address entry_point)
virtual void CallbackEvent(Name *name, Address entry_point)
void SharedLibraryEvent(const std::string &library_path, uintptr_t start, uintptr_t end)
void ApiNamedSecurityCheck(Object *key)
void removeCodeEventListener(CodeEventListener *listener)
void CodeEndLinePosInfoRecordEvent(Code *code, void *jit_handler_data)
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
void UncheckedIntPtrTEvent(const char *name, intptr_t value)
void ApiEntryCall(const char *name)
void HeapSampleJSConstructorEvent(const char *constructor, int number, int bytes)
void DeleteEvent(const char *name, void *object)
static void DeleteEventStatic(const char *name, void *object)
void IntEvent(const char *name, int value)
void GetterCallbackEvent(Name *name, Address entry_point)
void HeapSampleItemEvent(const char *type, int number, int bytes)
static void EmptyTimerEventsLogger(const char *name, int se)
void CodeNameEvent(Address addr, int pos, const char *code_name)
void RegExpCodeCreateEvent(Code *code, String *source)
bool is_logging_code_events()
void SetterCallbackEvent(Name *name, Address entry_point)
void HeapSampleJSRetainersEvent(const char *constructor, const char *event)
void NewEvent(const char *name, void *object, size_t size)
PerfJitLogger * perf_jit_logger_
friend class LoggerTestHelper
void LogAccessorCallbacks()
void addCodeEventListener(CodeEventListener *listener)
void ProfilerBeginEvent()
void SharedFunctionInfoMoveEvent(Address from, Address to)
bool SetUp(Isolate *isolate)
void CodeLinePosInfoAddPositionEvent(void *jit_handler_data, int pc_offset, int position)
void CodeDeoptEvent(Code *code)
const char *const * log_events_
void CodeLinePosInfoAddStatementPositionEvent(void *jit_handler_data, int pc_offset, int position)
void UncheckedIntEvent(const char *name, int value)
static void LeaveExternal(Isolate *isolate)
static void DefaultTimerEventsLogger(const char *name, int se)
void ResourceEvent(const char *name, const char *tag)
void ApiEvent(const char *name,...)
void LogCompiledFunctions()
bool hasCodeEventListener(CodeEventListener *listener)
void MoveEventInternal(LogEventsAndTags event, Address from, Address to)
void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
void SuspectReadEvent(Name *name, Object *obj)
void LogRegExpSource(Handle< JSRegExp > regexp)
static void EnterExternal(Isolate *isolate)
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
void HeapSampleStats(const char *space, const char *kind, intptr_t capacity, intptr_t used)
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
void CodeDeleteEvent(Address from)
PerfBasicLogger * perf_basic_logger_
INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script *))
static void NewEventStatic(const char *name, void *object, size_t size)
void TimerEvent(StartEnd se, const char *name)
void HandleEvent(const char *name, Object **location)
LowLevelLogger * ll_logger_
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
void StringEvent(const char *name, const char *value)
void CallbackEventInternal(const char *prefix, Name *name, Address entry_point)
void UncheckedStringEvent(const char *name, const char *value)
void SnapshotPositionEvent(Address addr, int pos)
base::ElapsedTimer timer_
void CodeStartLinePosInfoRecordEvent(PositionsRecorder *pos_recorder)
void RegExpCompileEvent(Handle< JSRegExp > regexp, bool in_cache)
void HeapSampleEndEvent(const char *space, const char *kind)
void CallbackEvent(Name *name, Address entry_point)
void CodeMoveEvent(Address from, Address to)
void ApiIndexedSecurityCheck(uint32_t index)
void ApiObjectAccess(const char *tag, JSObject *obj)
void TickEvent(TickSample *sample, bool overflow)
void HeapSampleJSProducerEvent(const char *constructor, Address *stack)
List< CodeEventListener * > listeners_
void IntPtrTEvent(const char *name, intptr_t value)
static const int kSamplingIntervalMs
void InitNameBuffer(LogEventsAndTags tag)
void DebugTag(const char *call_site_tag)
void HeapSampleBeginEvent(const char *space, const char *kind)
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
void LogCodeObject(Object *code_object)
void LogTimerEvent(Logger::StartEnd se)
TimerEventScope(Isolate *isolate)
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 only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
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 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 space(in MBytes)
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 TIMER_EVENTS_LIST(V)
#define DECLARE_ENUM(enum_item, ignore)
#define LOG_EVENTS_AND_TAGS_LIST(V)
Debugger support for the V8 JavaScript engine.
void(* JitCodeEventHandler)(const JitCodeEvent *event)
Callback function passed to SetJitCodeEventHandler.