v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
log.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_LOG_H_
29 #define V8_LOG_H_
30 
31 #include "allocation.h"
32 #include "objects.h"
33 #include "platform.h"
34 #include "platform/elapsed-timer.h"
35 
36 namespace v8 {
37 namespace internal {
38 
39 // Logger is used for collecting logging information from V8 during
40 // execution. The result is dumped to a file.
41 //
42 // Available command line flags:
43 //
44 // --log
45 // Minimal logging (no API, code, or GC sample events), default is off.
46 //
47 // --log-all
48 // Log all events to the file, default is off. This is the same as combining
49 // --log-api, --log-code, --log-gc, and --log-regexp.
50 //
51 // --log-api
52 // Log API events to the logfile, default is off. --log-api implies --log.
53 //
54 // --log-code
55 // Log code (create, move, and delete) events to the logfile, default is off.
56 // --log-code implies --log.
57 //
58 // --log-gc
59 // Log GC heap samples after each GC that can be processed by hp2ps, default
60 // is off. --log-gc implies --log.
61 //
62 // --log-regexp
63 // Log creation and use of regular expressions, Default is off.
64 // --log-regexp implies --log.
65 //
66 // --logfile <filename>
67 // Specify the name of the logfile, default is "v8.log".
68 //
69 // --prof
70 // Collect statistical profiling information (ticks), default is off. The
71 // tick profiler requires code events, so --prof implies --log-code.
72 
73 // Forward declarations.
74 class CodeEventListener;
75 class CompilationInfo;
76 class CpuProfiler;
77 class Isolate;
78 class Log;
79 class PositionsRecorder;
80 class Profiler;
81 class Semaphore;
82 class Ticker;
83 struct TickSample;
84 
85 #undef LOG
86 #define LOG(isolate, Call) \
87  do { \
88  v8::internal::Logger* logger = \
89  (isolate)->logger(); \
90  if (logger->is_logging()) \
91  logger->Call; \
92  } while (false)
93 
94 #define LOG_CODE_EVENT(isolate, Call) \
95  do { \
96  v8::internal::Logger* logger = \
97  (isolate)->logger(); \
98  if (logger->is_logging_code_events()) \
99  logger->Call; \
100  } while (false)
101 
102 
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")
157 // Note that 'NATIVE_' cases for functions and scripts are mapped onto
158 // original tags when writing to the log.
159 
160 
161 class JitLogger;
162 class PerfBasicLogger;
163 class LowLevelLogger;
164 class PerfJitLogger;
165 class Sampler;
166 
167 class Logger {
168  public:
169 #define DECLARE_ENUM(enum_item, ignore) enum_item,
173  };
174 #undef DECLARE_ENUM
175 
176  // Acquires resources for logging if the right flags are set.
177  bool SetUp(Isolate* isolate);
178 
179  // Sets the current code event handler.
180  void SetCodeEventHandler(uint32_t options,
181  JitCodeEventHandler event_handler);
182 
183  Sampler* sampler();
184 
185  // Frees resources acquired in SetUp.
186  // When a temporary file is used for the log, returns its stream descriptor,
187  // leaving the file open.
188  FILE* TearDown();
189 
190  // Emits an event with a string value -> (name, value).
191  void StringEvent(const char* name, const char* value);
192 
193  // Emits an event with an int value -> (name, value).
194  void IntEvent(const char* name, int value);
195  void IntPtrTEvent(const char* name, intptr_t value);
196 
197  // Emits an event with an handle value -> (name, location).
198  void HandleEvent(const char* name, Object** location);
199 
200  // Emits memory management events for C allocated structures.
201  void NewEvent(const char* name, void* object, size_t size);
202  void DeleteEvent(const char* name, void* object);
203 
204  // Static versions of the above, operate on current isolate's logger.
205  // Used in TRACK_MEMORY(TypeName) defined in globals.h
206  static void NewEventStatic(const char* name, void* object, size_t size);
207  static void DeleteEventStatic(const char* name, void* object);
208 
209  // Emits an event with a tag, and some resource usage information.
210  // -> (name, tag, <rusage information>).
211  // Currently, the resource usage information is a process time stamp
212  // and a real time timestamp.
213  void ResourceEvent(const char* name, const char* tag);
214 
215  // Emits an event that an undefined property was read from an
216  // object.
218 
219  // Emits an event when a message is put on or read from a debugging queue.
220  // DebugTag lets us put a call-site specific label on the event.
221  void DebugTag(const char* call_site_tag);
222  void DebugEvent(const char* event_type, Vector<uint16_t> parameter);
223 
224 
225  // ==== Events logged by --log-api. ====
226  void ApiNamedSecurityCheck(Object* key);
227  void ApiIndexedSecurityCheck(uint32_t index);
228  void ApiNamedPropertyAccess(const char* tag, JSObject* holder, Object* name);
229  void ApiIndexedPropertyAccess(const char* tag,
230  JSObject* holder,
231  uint32_t index);
232  void ApiObjectAccess(const char* tag, JSObject* obj);
233  void ApiEntryCall(const char* name);
234 
235 
236  // ==== Events logged by --log-code. ====
237  void addCodeEventListener(CodeEventListener* listener);
239  bool hasCodeEventListener(CodeEventListener* listener);
240 
241 
242  // Emits a code event for a callback function.
243  void CallbackEvent(Name* name, Address entry_point);
244  void GetterCallbackEvent(Name* name, Address entry_point);
245  void SetterCallbackEvent(Name* name, Address entry_point);
246  // Emits a code create event.
248  Code* code, const char* source);
250  Code* code, Name* name);
252  Code* code,
253  SharedFunctionInfo* shared,
255  Name* name);
257  Code* code,
258  SharedFunctionInfo* shared,
260  Name* source, int line, int column);
261  void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count);
262  void CodeMovingGCEvent();
263  // Emits a code create event for a RegExp.
264  void RegExpCodeCreateEvent(Code* code, String* source);
265  // Emits a code move event.
266  void CodeMoveEvent(Address from, Address to);
267  // Emits a code delete event.
268  void CodeDeleteEvent(Address from);
269  // Emits a code line info add event with Postion type.
270  void CodeLinePosInfoAddPositionEvent(void* jit_handler_data,
271  int pc_offset,
272  int position);
273  // Emits a code line info add event with StatementPostion type.
274  void CodeLinePosInfoAddStatementPositionEvent(void* jit_handler_data,
275  int pc_offset,
276  int position);
277  // Emits a code line info start to record event
278  void CodeStartLinePosInfoRecordEvent(PositionsRecorder* pos_recorder);
279  // Emits a code line info finish record event.
280  // It's the callee's responsibility to dispose the parameter jit_handler_data.
281  void CodeEndLinePosInfoRecordEvent(Code* code, void* jit_handler_data);
282 
284 
285  void CodeNameEvent(Address addr, int pos, const char* code_name);
286  void SnapshotPositionEvent(Address addr, int pos);
287 
288  // ==== Events logged by --log-gc. ====
289  // Heap sampling events: start, end, and individual types.
290  void HeapSampleBeginEvent(const char* space, const char* kind);
291  void HeapSampleEndEvent(const char* space, const char* kind);
292  void HeapSampleItemEvent(const char* type, int number, int bytes);
293  void HeapSampleJSConstructorEvent(const char* constructor,
294  int number, int bytes);
295  void HeapSampleJSRetainersEvent(const char* constructor,
296  const char* event);
297  void HeapSampleJSProducerEvent(const char* constructor,
298  Address* stack);
299  void HeapSampleStats(const char* space, const char* kind,
300  intptr_t capacity, intptr_t used);
301 
302  void SharedLibraryEvent(const char* library_path,
303  uintptr_t start,
304  uintptr_t end);
305  void SharedLibraryEvent(const wchar_t* library_path,
306  uintptr_t start,
307  uintptr_t end);
308 
309  // ==== Events logged by --log-timer-events. ====
310  enum StartEnd { START, END };
311 
312  void CodeDeoptEvent(Code* code);
313 
314  void TimerEvent(StartEnd se, const char* name);
315 
316  static void EnterExternal(Isolate* isolate);
317  static void LeaveExternal(Isolate* isolate);
318 
319  static void EmptyLogInternalEvents(const char* name, int se) { }
320  static void LogInternalEvents(const char* name, int se);
321 
323  public:
324  TimerEventScope(Isolate* isolate, const char* name)
325  : isolate_(isolate), name_(name) {
327  }
328 
331  }
332 
333  void LogTimerEvent(StartEnd se);
334 
335  static const char* v8_recompile_synchronous;
336  static const char* v8_recompile_concurrent;
337  static const char* v8_compile_full_code;
338  static const char* v8_execute;
339  static const char* v8_external;
340 
341  private:
342  Isolate* isolate_;
343  const char* name_;
344  };
345 
346  // ==== Events logged by --log-regexp ====
347  // Regexp compilation and execution events.
348 
349  void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache);
350 
351  // Log an event reported from generated code
352  void LogRuntime(Vector<const char> format, Handle<JSArray> args);
353 
354  bool is_logging() {
355  return is_logging_;
356  }
357 
359  return is_logging() || jit_logger_ != NULL;
360  }
361 
362  // Stop collection of profiling data.
363  // When data collection is paused, CPU Tick events are discarded.
364  void StopProfiler();
365 
368  // Logs all compiled functions found in the heap.
369  void LogCompiledFunctions();
370  // Logs all accessor callbacks found in the heap.
371  void LogAccessorCallbacks();
372  // Used for logging stubs found in the snapshot.
373  void LogCodeObjects();
374 
375  // Converts tag to a corresponding NATIVE_... if the script is native.
376  INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script*));
377 
378  // Profiler's sampling interval (in milliseconds).
379 #if defined(ANDROID)
380  // Phones and tablets have processors that are much slower than desktop
381  // and laptop computers for which current heuristics are tuned.
382  static const int kSamplingIntervalMs = 5;
383 #else
384  static const int kSamplingIntervalMs = 1;
385 #endif
386 
387  // Callback from Log, stops profiling in case of insufficient resources.
388  void LogFailure();
389 
390  private:
391  explicit Logger(Isolate* isolate);
392  ~Logger();
393 
394  // Emits the profiler's first message.
395  void ProfilerBeginEvent();
396 
397  // Emits callback event messages.
398  void CallbackEventInternal(const char* prefix,
399  Name* name,
400  Address entry_point);
401 
402  // Internal configurable move event.
403  void MoveEventInternal(LogEventsAndTags event, Address from, Address to);
404 
405  // Emits the source code of a regexp. Used by regexp events.
406  void LogRegExpSource(Handle<JSRegExp> regexp);
407 
408  // Used for logging stubs found in the snapshot.
409  void LogCodeObject(Object* code_object);
410 
411  // Helper method. It resets name_buffer_ and add tag name into it.
412  void InitNameBuffer(LogEventsAndTags tag);
413 
414  // Emits a profiler tick event. Used by the profiler thread.
415  void TickEvent(TickSample* sample, bool overflow);
416 
417  void ApiEvent(const char* name, ...);
418 
419  // Logs a StringEvent regardless of whether FLAG_log is true.
420  void UncheckedStringEvent(const char* name, const char* value);
421 
422  // Logs an IntEvent regardless of whether FLAG_log is true.
423  void UncheckedIntEvent(const char* name, int value);
424  void UncheckedIntPtrTEvent(const char* name, intptr_t value);
425 
426  Isolate* isolate_;
427 
428  // The sampler used by the profiler and the sliding state window.
429  Ticker* ticker_;
430 
431  // When the statistical profile is active, profiler_
432  // points to a Profiler, that handles collection
433  // of samples.
434  Profiler* profiler_;
435 
436  // An array of log events names.
437  const char* const* log_events_;
438 
439  // Internal implementation classes with access to
440  // private members.
441  friend class EventLog;
442  friend class Isolate;
443  friend class TimeLog;
444  friend class Profiler;
445  template <StateTag Tag> friend class VMState;
446  friend class LoggerTestHelper;
447 
448  bool is_logging_;
449  Log* log_;
450  PerfBasicLogger* perf_basic_logger_;
451  PerfJitLogger* perf_jit_logger_;
452  LowLevelLogger* ll_logger_;
453  JitLogger* jit_logger_;
454  List<CodeEventListener*> listeners_;
455 
456  // Guards against multiple calls to TearDown() that can happen in some tests.
457  // 'true' between SetUp() and TearDown().
458  bool is_initialized_;
459 
460  ElapsedTimer timer_;
461 
462  friend class CpuProfiler;
463 };
464 
465 
467  public:
468  virtual ~CodeEventListener() {}
469 
470  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
471  Code* code,
472  const char* comment) = 0;
473  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
474  Code* code,
475  Name* name) = 0;
476  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
477  Code* code,
478  SharedFunctionInfo* shared,
480  Name* name) = 0;
481  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
482  Code* code,
483  SharedFunctionInfo* shared,
485  Name* source,
486  int line, int column) = 0;
487  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
488  Code* code,
489  int args_count) = 0;
490  virtual void CallbackEvent(Name* name, Address entry_point) = 0;
491  virtual void GetterCallbackEvent(Name* name, Address entry_point) = 0;
492  virtual void SetterCallbackEvent(Name* name, Address entry_point) = 0;
493  virtual void RegExpCodeCreateEvent(Code* code, String* source) = 0;
494  virtual void CodeMoveEvent(Address from, Address to) = 0;
495  virtual void CodeDeleteEvent(Address from) = 0;
496  virtual void SharedFunctionInfoMoveEvent(Address from, Address to) = 0;
497  virtual void CodeMovingGCEvent() = 0;
498 };
499 
500 
502  public:
503  CodeEventLogger();
504  virtual ~CodeEventLogger();
505 
506  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
507  Code* code,
508  const char* comment);
509  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
510  Code* code,
511  Name* name);
512  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
513  Code* code,
514  int args_count);
515  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
516  Code* code,
517  SharedFunctionInfo* shared,
519  Name* name);
520  virtual void CodeCreateEvent(Logger::LogEventsAndTags tag,
521  Code* code,
522  SharedFunctionInfo* shared,
523  CompilationInfo* info,
524  Name* source,
525  int line, int column);
526  virtual void RegExpCodeCreateEvent(Code* code, String* source);
527 
528  virtual void CallbackEvent(Name* name, Address entry_point) { }
529  virtual void GetterCallbackEvent(Name* name, Address entry_point) { }
530  virtual void SetterCallbackEvent(Name* name, Address entry_point) { }
531  virtual void SharedFunctionInfoMoveEvent(Address from, Address to) { }
532  virtual void CodeMovingGCEvent() { }
533 
534  private:
535  class NameBuffer;
536 
537  virtual void LogRecordedBuffer(Code* code,
538  SharedFunctionInfo* shared,
539  const char* name,
540  int length) = 0;
541 
542  NameBuffer* name_buffer_;
543 };
544 
545 
546 } } // namespace v8::internal
547 
548 
549 #endif // V8_LOG_H_
byte * Address
Definition: globals.h:186
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
Definition: flags.cc:269
static void LogInternalEvents(const char *name, int se)
Definition: log.cc:1127
static void NewEventStatic(const char *name, void *object, size_t size)
Definition: log.cc:1317
void RegExpCodeCreateEvent(Code *code, String *source)
Definition: log.cc:1519
static const char * v8_recompile_concurrent
Definition: log.h:336
void CodeMoveEvent(Address from, Address to)
Definition: log.cc:1536
static void EnterExternal(Isolate *isolate)
Definition: log.cc:1113
void CallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1355
static void DeleteEventStatic(const char *name, void *object)
Definition: log.cc:1322
bool is_logging()
Definition: log.h:354
void GetterCallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1361
TickSample * sample
Sampler * sampler()
Definition: log.cc:2118
bool is_logging_code_events()
Definition: log.h:358
void LogCompiledFunctions()
Definition: log.cc:1950
void CodeDeleteEvent(Address from)
Definition: log.cc:1545
void CodeNameEvent(Address addr, int pos, const char *code_name)
Definition: log.cc:1593
void IntPtrTEvent(const char *name, intptr_t value)
Definition: log.cc:996
void ApiNamedSecurityCheck(Object *key)
Definition: log.cc:1039
void LogTimerEvent(StartEnd se)
Definition: log.cc:1133
void HandleEvent(const char *name, Object **location)
Definition: log.cc:1017
TimerEventScope(Isolate *isolate, const char *name)
Definition: log.h:324
void StopProfiler()
Definition: log.cc:1753
virtual void GetterCallbackEvent(Name *name, Address entry_point)
Definition: log.h:529
friend class EventLog
Definition: log.h:441
void ApiIndexedSecurityCheck(uint32_t index)
Definition: log.cc:1241
void LogFailure()
Definition: log.cc:1764
void CodeStartLinePosInfoRecordEvent(PositionsRecorder *pos_recorder)
Definition: log.cc:1580
void SnapshotPositionEvent(Address addr, int pos)
Definition: log.cc:1603
void CodeDeoptEvent(Code *code)
Definition: log.cc:1091
void HeapSampleJSProducerEvent(const char *constructor, Address *stack)
friend class LoggerTestHelper
Definition: log.h:446
void HeapSampleBeginEvent(const char *space, const char *kind)
Definition: log.cc:1675
void CodeLinePosInfoAddPositionEvent(void *jit_handler_data, int pc_offset, int position)
Definition: log.cc:1560
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
Definition: flags.cc:211
void addCodeEventListener(CodeEventListener *listener)
Definition: log.cc:953
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
Definition: log.cc:1902
static const char * v8_external
Definition: log.h:339
void CodeEndLinePosInfoRecordEvent(Code *code, void *jit_handler_data)
Definition: log.cc:1587
#define DECLARE_ENUM(enum_item, ignore)
Definition: log.h:169
bool SetUp(Isolate *isolate)
Definition: log.cc:2050
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
Definition: log.cc:1710
virtual void SetterCallbackEvent(Name *name, Address entry_point)
Definition: log.h:530
FILE * TearDown()
Definition: log.cc:2123
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)
Definition: log.cc:1190
void LogRuntime(Vector< const char > format, Handle< JSArray > args)
Definition: log.cc:1200
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)
Definition: log.cc:1654
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
Definition: log.cc:1247
void LogCodeObjects()
Definition: log.cc:1890
virtual void CallbackEvent(Name *name, Address entry_point)
Definition: log.h:528
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
Definition: log.cc:1274
void SharedLibraryEvent(const char *library_path, uintptr_t start, uintptr_t end)
Definition: log.cc:1065
static const char * v8_execute
Definition: log.h:338
void ApiEntryCall(const char *name)
Definition: log.cc:1294
void(* JitCodeEventHandler)(const JitCodeEvent *event)
Definition: v8.h:4595
bool hasCodeEventListener(CodeEventListener *listener)
Definition: log.cc:965
void HeapSampleEndEvent(const char *space, const char *kind)
Definition: log.cc:1686
static void EmptyLogInternalEvents(const char *name, int se)
Definition: log.h:319
virtual void CodeMovingGCEvent()
Definition: log.h:532
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
Definition: flags.cc:317
void HeapSampleItemEvent(const char *type, int number, int bytes)
Definition: log.cc:1694
void DeleteEvent(const char *name, void *object)
Definition: log.cc:1309
static const char * v8_recompile_synchronous
Definition: log.h:335
void ApiObjectAccess(const char *tag, JSObject *obj)
Definition: log.cc:1285
virtual ~CodeEventListener()
Definition: log.h:468
void CodeLinePosInfoAddStatementPositionEvent(void *jit_handler_data, int pc_offset, int position)
Definition: log.cc:1570
static void LeaveExternal(Isolate *isolate)
Definition: log.cc:1120
static const int kSamplingIntervalMs
Definition: log.h:384
void CodeMovingGCEvent()
Definition: log.cc:1509
static const char * v8_compile_full_code
Definition: log.h:337
void HeapSampleJSRetainersEvent(const char *constructor, const char *event)
friend class TimeLog
Definition: log.h:443
void SharedFunctionInfoMoveEvent(Address from, Address to)
Definition: log.cc:1616
void IntEvent(const char *name, int value)
Definition: log.cc:991
void LogAccessorCallbacks()
Definition: log.cc:1971
HeapObject * obj
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)
Definition: log.h:531
void removeCodeEventListener(CodeEventListener *listener)
Definition: log.cc:959
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
Definition: log.cc:1386
void DebugTag(const char *call_site_tag)
Definition: log.cc:1702
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
Definition: flags.cc:505
void ResourceEvent(const char *name, const char *tag)
Definition: log.cc:1638
void NewEvent(const char *name, void *object, size_t size)
Definition: log.cc:1300
#define LOG_EVENTS_AND_TAGS_LIST(V)
Definition: log.h:103
void TimerEvent(StartEnd se, const char *name)
Definition: log.cc:1101
void StringEvent(const char *name, const char *value)
Definition: log.cc:978
void SetterCallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1367
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)
Definition: log.cc:2098