diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-03-18 13:49:34 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-20 01:11:01 +0100 |
commit | 83261e789eb903da39f279cb5a161611482e7df5 (patch) | |
tree | 4133b5ca9f53bed4365e1a94544a227d68a0cf12 /deps/v8/src/log.h | |
parent | a05f973f82d2be8527aad4c371d40d3c7e4c564e (diff) | |
download | android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.tar.gz android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.tar.bz2 android-node-v8-83261e789eb903da39f279cb5a161611482e7df5.zip |
deps: update v8 to 3.17.13
Diffstat (limited to 'deps/v8/src/log.h')
-rw-r--r-- | deps/v8/src/log.h | 102 |
1 files changed, 79 insertions, 23 deletions
diff --git a/deps/v8/src/log.h b/deps/v8/src/log.h index 33f359a7f9..5c121bc316 100644 --- a/deps/v8/src/log.h +++ b/deps/v8/src/log.h @@ -74,8 +74,9 @@ namespace internal { class LogMessageBuilder; class Profiler; class Semaphore; -class SlidingStateWindow; class Ticker; +class Isolate; +class PositionsRecorder; #undef LOG #define LOG(isolate, Call) \ @@ -127,16 +128,18 @@ class Ticker; V(EVAL_TAG, "Eval") \ V(FUNCTION_TAG, "Function") \ V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \ - V(KEYED_LOAD_MEGAMORPHIC_IC_TAG, "KeyedLoadMegamorphicIC") \ + V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \ V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \ V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \ - V(KEYED_STORE_MEGAMORPHIC_IC_TAG, "KeyedStoreMegamorphicIC") \ + V(KEYED_STORE_POLYMORPHIC_IC_TAG, "KeyedStorePolymorphicIC") \ V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \ V(LAZY_COMPILE_TAG, "LazyCompile") \ V(LOAD_IC_TAG, "LoadIC") \ + V(LOAD_POLYMORPHIC_IC_TAG, "LoadPolymorphicIC") \ V(REG_EXP_TAG, "RegExp") \ V(SCRIPT_TAG, "Script") \ V(STORE_IC_TAG, "StoreIC") \ + V(STORE_POLYMORPHIC_IC_TAG, "StorePolymorphicIC") \ V(STUB_TAG, "Stub") \ V(NATIVE_FUNCTION_TAG, "Function") \ V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \ @@ -174,9 +177,6 @@ class Logger { // leaving the file open. FILE* TearDown(); - // Enable the computation of a sliding window of states. - void EnableSlidingStateWindow(); - // Emits an event with a string value -> (name, value). void StringEvent(const char* name, const char* value); @@ -204,7 +204,7 @@ class Logger { // Emits an event that an undefined property was read from an // object. - void SuspectReadEvent(String* name, Object* obj); + void SuspectReadEvent(Name* name, Object* obj); // Emits an event when a message is put on or read from a debugging queue. // DebugTag lets us put a call-site specific label on the event. @@ -225,22 +225,22 @@ class Logger { // ==== Events logged by --log-code. ==== // Emits a code event for a callback function. - void CallbackEvent(String* name, Address entry_point); - void GetterCallbackEvent(String* name, Address entry_point); - void SetterCallbackEvent(String* name, Address entry_point); + void CallbackEvent(Name* name, Address entry_point); + void GetterCallbackEvent(Name* name, Address entry_point); + void SetterCallbackEvent(Name* name, Address entry_point); // Emits a code create event. void CodeCreateEvent(LogEventsAndTags tag, Code* code, const char* source); void CodeCreateEvent(LogEventsAndTags tag, - Code* code, String* name); + Code* code, Name* name); void CodeCreateEvent(LogEventsAndTags tag, Code* code, SharedFunctionInfo* shared, - String* name); + Name* name); void CodeCreateEvent(LogEventsAndTags tag, Code* code, SharedFunctionInfo* shared, - String* source, int line); + Name* source, int line); void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count); void CodeMovingGCEvent(); // Emits a code create event for a RegExp. @@ -249,6 +249,19 @@ class Logger { void CodeMoveEvent(Address from, Address to); // Emits a code delete event. void CodeDeleteEvent(Address from); + // Emits a code line info add event with Postion type. + void CodeLinePosInfoAddPositionEvent(void* jit_handler_data, + int pc_offset, + int position); + // Emits a code line info add event with StatementPostion type. + void CodeLinePosInfoAddStatementPositionEvent(void* jit_handler_data, + int pc_offset, + int position); + // Emits a code line info start to record event + void CodeStartLinePosInfoRecordEvent(PositionsRecorder* pos_recorder); + // Emits a code line info finish record event. + // It's the callee's responsibility to dispose the parameter jit_handler_data. + void CodeEndLinePosInfoRecordEvent(Code* code, void* jit_handler_data); void SharedFunctionInfoMoveEvent(Address from, Address to); @@ -275,18 +288,54 @@ class Logger { uintptr_t start, uintptr_t end); + // ==== Events logged by --log-timer-events. ==== + enum StartEnd { START, END }; + + void TimerEvent(StartEnd se, const char* name); + + static void EnterExternal(); + static void LeaveExternal(); + + class TimerEventScope { + public: + TimerEventScope(Isolate* isolate, const char* name) + : isolate_(isolate), name_(name) { + if (FLAG_log_internal_timer_events) LogTimerEvent(START); + } + + ~TimerEventScope() { + if (FLAG_log_internal_timer_events) LogTimerEvent(END); + } + + void LogTimerEvent(StartEnd se); + + static const char* v8_recompile_synchronous; + static const char* v8_recompile_parallel; + static const char* v8_compile_full_code; + static const char* v8_execute; + static const char* v8_external; + + private: + Isolate* isolate_; + const char* name_; + }; + // ==== Events logged by --log-regexp ==== // Regexp compilation and execution events. void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); // Log an event reported from generated code - void LogRuntime(Vector<const char> format, JSArray* args); + void LogRuntime(Isolate* isolate, Vector<const char> format, JSArray* args); bool is_logging() { return logging_nesting_ > 0; } + bool is_code_event_handler_enabled() { + return code_event_handler_ != NULL; + } + bool is_logging_code_events() { return is_logging() || code_event_handler_ != NULL; } @@ -326,20 +375,28 @@ class Logger { class NameBuffer; class NameMap; - Logger(); + explicit Logger(Isolate* isolate); ~Logger(); // Issue code notifications. - void IssueCodeAddedEvent(Code* code, const char* name, size_t name_len); + void IssueCodeAddedEvent(Code* code, + Script* script, + const char* name, + size_t name_len); void IssueCodeMovedEvent(Address from, Address to); void IssueCodeRemovedEvent(Address from); - + void IssueAddCodeLinePosInfoEvent(void* jit_handler_data, + int pc_offset, + int position, + JitCodeEvent::PositionType position_Type); + void* IssueStartCodePosInfoEvent(); + void IssueEndCodePosInfoEvent(Code* code, void* jit_handler_data); // Emits the profiler's first message. void ProfilerBeginEvent(); // Emits callback event messages. void CallbackEventInternal(const char* prefix, - const char* name, + Name* name, Address entry_point); // Internal configurable move event. @@ -393,6 +450,8 @@ class Logger { // Returns whether profiler's sampler is active. bool IsProfilerSamplerActive(); + Isolate* isolate_; + // The sampler used by the profiler and the sliding state window. Ticker* ticker_; @@ -401,10 +460,6 @@ class Logger { // of samples. Profiler* profiler_; - // SlidingStateWindow instance keeping a sliding window of the most - // recent VM states. - SlidingStateWindow* sliding_state_window_; - // An array of log events names. const char* const* log_events_; @@ -415,7 +470,6 @@ class Logger { friend class LogMessageBuilder; friend class TimeLog; friend class Profiler; - friend class SlidingStateWindow; friend class StackTracer; friend class VMState; @@ -449,6 +503,8 @@ class Logger { // Logger::FunctionCreateEvent(...) Address prev_code_; + int64_t epoch_; + friend class CpuProfiler; }; |