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
cpu-profiler.cc
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 #include "v8.h"
29 
30 #include "cpu-profiler-inl.h"
31 
32 #include "compiler.h"
33 #include "frames-inl.h"
34 #include "hashmap.h"
35 #include "log-inl.h"
36 #include "vm-state-inl.h"
37 
38 #include "../include/v8-profiler.h"
39 
40 namespace v8 {
41 namespace internal {
42 
43 static const int kProfilerStackSize = 64 * KB;
44 
45 
47  ProfileGenerator* generator,
48  Sampler* sampler,
49  TimeDelta period)
50  : Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)),
51  generator_(generator),
52  sampler_(sampler),
53  running_(true),
54  period_(period),
55  last_code_event_id_(0), last_processed_code_event_id_(0) {
56 }
57 
58 
60  event.generic.order = ++last_code_event_id_;
61  events_buffer_.Enqueue(event);
62 }
63 
64 
66  TickSampleEventRecord record(last_code_event_id_);
67  RegisterState regs;
68  StackFrameIterator it(isolate);
69  if (!it.done()) {
70  StackFrame* frame = it.frame();
71  regs.sp = frame->sp();
72  regs.fp = frame->fp();
73  regs.pc = frame->pc();
74  }
75  record.sample.Init(isolate, regs);
76  ticks_from_vm_buffer_.Enqueue(record);
77 }
78 
79 
81  if (!running_) return;
82  running_ = false;
83  Join();
84 }
85 
86 
87 bool ProfilerEventsProcessor::ProcessCodeEvent() {
88  CodeEventsContainer record;
89  if (events_buffer_.Dequeue(&record)) {
90  switch (record.generic.type) {
91 #define PROFILER_TYPE_CASE(type, clss) \
92  case CodeEventRecord::type: \
93  record.clss##_.UpdateCodeMap(generator_->code_map()); \
94  break;
95 
97 
98 #undef PROFILER_TYPE_CASE
99  default: return true; // Skip record.
100  }
101  last_processed_code_event_id_ = record.generic.order;
102  return true;
103  }
104  return false;
105 }
106 
107 ProfilerEventsProcessor::SampleProcessingResult
108  ProfilerEventsProcessor::ProcessOneSample() {
109  if (!ticks_from_vm_buffer_.IsEmpty()
110  && ticks_from_vm_buffer_.Peek()->order ==
111  last_processed_code_event_id_) {
112  TickSampleEventRecord record;
113  ticks_from_vm_buffer_.Dequeue(&record);
114  generator_->RecordTickSample(record.sample);
115  return OneSampleProcessed;
116  }
117 
118  const TickSampleEventRecord* record = ticks_buffer_.Peek();
119  if (record == NULL) {
120  if (ticks_from_vm_buffer_.IsEmpty()) return NoSamplesInQueue;
121  return FoundSampleForNextCodeEvent;
122  }
123  if (record->order != last_processed_code_event_id_) {
124  return FoundSampleForNextCodeEvent;
125  }
126  generator_->RecordTickSample(record->sample);
127  ticks_buffer_.Remove();
128  return OneSampleProcessed;
129 }
130 
131 
133  while (running_) {
134  ElapsedTimer timer;
135  timer.Start();
136  // Keep processing existing events until we need to do next sample.
137  do {
138  if (FoundSampleForNextCodeEvent == ProcessOneSample()) {
139  // All ticks of the current last_processed_code_event_id_ are
140  // processed, proceed to the next code event.
141  ProcessCodeEvent();
142  }
143  } while (!timer.HasExpired(period_));
144 
145  // Schedule next sample. sampler_ is NULL in tests.
146  if (sampler_) sampler_->DoSample();
147  }
148 
149  // Process remaining tick events.
150  do {
151  SampleProcessingResult result;
152  do {
153  result = ProcessOneSample();
154  } while (result == OneSampleProcessed);
155  } while (ProcessCodeEvent());
156 }
157 
158 
159 void* ProfilerEventsProcessor::operator new(size_t size) {
161 }
162 
163 
164 void ProfilerEventsProcessor::operator delete(void* ptr) {
165  AlignedFree(ptr);
166 }
167 
168 
170  // The count of profiles doesn't depend on a security token.
171  return profiles_->profiles()->length();
172 }
173 
174 
176  return profiles_->profiles()->at(index);
177 }
178 
179 
181  if (is_profiling_) StopProcessor();
182  ResetProfiles();
183 }
184 
185 
187  profiles_->RemoveProfile(profile);
188  delete profile;
189  if (profiles_->profiles()->is_empty() && !is_profiling_) {
190  // If this was the last profile, clean up all accessory data as well.
191  ResetProfiles();
192  }
193 }
194 
195 
196 static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag) {
197  return FLAG_prof_browser_mode
198  && (tag != Logger::CALLBACK_TAG
199  && tag != Logger::FUNCTION_TAG
200  && tag != Logger::LAZY_COMPILE_TAG
201  && tag != Logger::REG_EXP_TAG
202  && tag != Logger::SCRIPT_TAG);
203 }
204 
205 
207  if (FilterOutCodeCreateEvent(Logger::CALLBACK_TAG)) return;
208  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
209  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
210  rec->start = entry_point;
211  rec->entry = profiles_->NewCodeEntry(
212  Logger::CALLBACK_TAG,
213  profiles_->GetName(name));
214  rec->size = 1;
215  rec->shared = NULL;
216  processor_->Enqueue(evt_rec);
217 }
218 
219 
221  Code* code,
222  const char* name) {
223  if (FilterOutCodeCreateEvent(tag)) return;
224  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
225  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
226  rec->start = code->address();
227  rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
228  rec->size = code->ExecutableSize();
229  rec->shared = NULL;
230  processor_->Enqueue(evt_rec);
231 }
232 
233 
235  Code* code,
236  Name* name) {
237  if (FilterOutCodeCreateEvent(tag)) return;
238  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
239  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
240  rec->start = code->address();
241  rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
242  rec->size = code->ExecutableSize();
243  rec->shared = NULL;
244  processor_->Enqueue(evt_rec);
245 }
246 
247 
249  Code* code,
250  SharedFunctionInfo* shared,
252  Name* name) {
253  if (FilterOutCodeCreateEvent(tag)) return;
254  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
255  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
256  rec->start = code->address();
257  rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
258  if (info) {
260  }
261  if (shared->script()->IsScript()) {
262  ASSERT(Script::cast(shared->script()));
263  Script* script = Script::cast(shared->script());
264  rec->entry->set_script_id(script->id()->value());
267  }
268  rec->size = code->ExecutableSize();
269  rec->shared = shared->address();
270  processor_->Enqueue(evt_rec);
271 }
272 
273 
275  Code* code,
276  SharedFunctionInfo* shared,
278  Name* source, int line, int column) {
279  if (FilterOutCodeCreateEvent(tag)) return;
280  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
281  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
282  rec->start = code->address();
283  rec->entry = profiles_->NewCodeEntry(
284  tag,
285  profiles_->GetFunctionName(shared->DebugName()),
287  profiles_->GetName(source),
288  line,
289  column);
290  if (info) {
292  }
293  ASSERT(Script::cast(shared->script()));
294  Script* script = Script::cast(shared->script());
295  rec->entry->set_script_id(script->id()->value());
296  rec->size = code->ExecutableSize();
297  rec->shared = shared->address();
300  processor_->Enqueue(evt_rec);
301 }
302 
303 
305  Code* code,
306  int args_count) {
307  if (FilterOutCodeCreateEvent(tag)) return;
308  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
309  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
310  rec->start = code->address();
311  rec->entry = profiles_->NewCodeEntry(
312  tag,
313  profiles_->GetName(args_count),
314  "args_count: ");
315  rec->size = code->ExecutableSize();
316  rec->shared = NULL;
317  processor_->Enqueue(evt_rec);
318 }
319 
320 
322  CodeEventsContainer evt_rec(CodeEventRecord::CODE_MOVE);
323  CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_;
324  rec->from = from;
325  rec->to = to;
326  processor_->Enqueue(evt_rec);
327 }
328 
329 
331 }
332 
333 
335  CodeEventsContainer evt_rec(CodeEventRecord::SHARED_FUNC_MOVE);
337  &evt_rec.SharedFunctionInfoMoveEventRecord_;
338  rec->from = from;
339  rec->to = to;
340  processor_->Enqueue(evt_rec);
341 }
342 
343 
345  if (FilterOutCodeCreateEvent(Logger::CALLBACK_TAG)) return;
346  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
347  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
348  rec->start = entry_point;
349  rec->entry = profiles_->NewCodeEntry(
350  Logger::CALLBACK_TAG,
351  profiles_->GetName(name),
352  "get ");
353  rec->size = 1;
354  rec->shared = NULL;
355  processor_->Enqueue(evt_rec);
356 }
357 
358 
360  if (FilterOutCodeCreateEvent(Logger::REG_EXP_TAG)) return;
361  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
362  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
363  rec->start = code->address();
364  rec->entry = profiles_->NewCodeEntry(
365  Logger::REG_EXP_TAG,
366  profiles_->GetName(source),
367  "RegExp: ");
368  rec->size = code->ExecutableSize();
369  processor_->Enqueue(evt_rec);
370 }
371 
372 
374  if (FilterOutCodeCreateEvent(Logger::CALLBACK_TAG)) return;
375  CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
376  CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
377  rec->start = entry_point;
378  rec->entry = profiles_->NewCodeEntry(
379  Logger::CALLBACK_TAG,
380  profiles_->GetName(name),
381  "set ");
382  rec->size = 1;
383  rec->shared = NULL;
384  processor_->Enqueue(evt_rec);
385 }
386 
387 
389  : isolate_(isolate),
390  sampling_interval_(TimeDelta::FromMicroseconds(
391  FLAG_cpu_profiler_sampling_interval)),
392  profiles_(new CpuProfilesCollection(isolate->heap())),
393  generator_(NULL),
394  processor_(NULL),
395  is_profiling_(false) {
396 }
397 
398 
400  CpuProfilesCollection* test_profiles,
401  ProfileGenerator* test_generator,
402  ProfilerEventsProcessor* test_processor)
403  : isolate_(isolate),
404  sampling_interval_(TimeDelta::FromMicroseconds(
405  FLAG_cpu_profiler_sampling_interval)),
406  profiles_(test_profiles),
407  generator_(test_generator),
408  processor_(test_processor),
409  is_profiling_(false) {
410 }
411 
412 
414  ASSERT(!is_profiling_);
415  delete profiles_;
416 }
417 
418 
419 void CpuProfiler::set_sampling_interval(TimeDelta value) {
420  ASSERT(!is_profiling_);
421  sampling_interval_ = value;
422 }
423 
424 
425 void CpuProfiler::ResetProfiles() {
426  delete profiles_;
427  profiles_ = new CpuProfilesCollection(isolate()->heap());
428 }
429 
430 
431 void CpuProfiler::StartProfiling(const char* title, bool record_samples) {
432  if (profiles_->StartProfiling(title, record_samples)) {
433  StartProcessorIfNotStarted();
434  }
435  processor_->AddCurrentStack(isolate_);
436 }
437 
438 
439 void CpuProfiler::StartProfiling(String* title, bool record_samples) {
440  StartProfiling(profiles_->GetName(title), record_samples);
441 }
442 
443 
444 void CpuProfiler::StartProcessorIfNotStarted() {
445  if (processor_ == NULL) {
446  Logger* logger = isolate_->logger();
447  // Disable logging when using the new implementation.
448  saved_is_logging_ = logger->is_logging_;
449  logger->is_logging_ = false;
450  generator_ = new ProfileGenerator(profiles_);
451  Sampler* sampler = logger->sampler();
452  processor_ = new ProfilerEventsProcessor(
453  generator_, sampler, sampling_interval_);
454  is_profiling_ = true;
455  // Enumerate stuff we already have in the heap.
456  ASSERT(isolate_->heap()->HasBeenSetUp());
457  if (!FLAG_prof_browser_mode) {
458  logger->LogCodeObjects();
459  }
460  logger->LogCompiledFunctions();
461  logger->LogAccessorCallbacks();
462  LogBuiltins();
463  // Enable stack sampling.
464  sampler->SetHasProcessingThread(true);
465  sampler->IncreaseProfilingDepth();
466  processor_->StartSynchronously();
467  }
468 }
469 
470 
472  if (!is_profiling_) return NULL;
473  StopProcessorIfLastProfile(title);
474  CpuProfile* result = profiles_->StopProfiling(title);
475  if (result != NULL) {
476  result->Print();
477  }
478  return result;
479 }
480 
481 
483  if (!is_profiling_) return NULL;
484  const char* profile_title = profiles_->GetName(title);
485  StopProcessorIfLastProfile(profile_title);
486  return profiles_->StopProfiling(profile_title);
487 }
488 
489 
490 void CpuProfiler::StopProcessorIfLastProfile(const char* title) {
491  if (profiles_->IsLastProfile(title)) StopProcessor();
492 }
493 
494 
495 void CpuProfiler::StopProcessor() {
496  Logger* logger = isolate_->logger();
497  Sampler* sampler = reinterpret_cast<Sampler*>(logger->ticker_);
498  is_profiling_ = false;
499  processor_->StopSynchronously();
500  delete processor_;
501  delete generator_;
502  processor_ = NULL;
503  generator_ = NULL;
504  sampler->SetHasProcessingThread(false);
505  sampler->DecreaseProfilingDepth();
506  logger->is_logging_ = saved_is_logging_;
507 }
508 
509 
510 void CpuProfiler::LogBuiltins() {
511  Builtins* builtins = isolate_->builtins();
512  ASSERT(builtins->is_initialized());
513  for (int i = 0; i < Builtins::builtin_count; i++) {
514  CodeEventsContainer evt_rec(CodeEventRecord::REPORT_BUILTIN);
515  ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_;
516  Builtins::Name id = static_cast<Builtins::Name>(i);
517  rec->start = builtins->builtin(id)->address();
518  rec->builtin_id = id;
519  processor_->Enqueue(evt_rec);
520  }
521 }
522 
523 
524 } } // namespace v8::internal
void StartProfiling(const char *title, bool record_samples=false)
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
void DeleteProfile(CpuProfile *profile)
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)
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
Definition: flags.cc:208
virtual void CodeDeleteEvent(Address from)
void AddCurrentStack(Isolate *isolate)
Definition: cpu-profiler.cc:65
const int KB
Definition: globals.h:245
ProfilerEventsProcessor(ProfileGenerator *generator, Sampler *sampler, TimeDelta period)
Definition: cpu-profiler.cc:46
void set_bailout_reason(const char *bailout_reason)
Sampler * sampler()
Definition: log.cc:2118
Builtins * builtins()
Definition: isolate.h:948
void LogCompiledFunctions()
Definition: log.cc:1950
CpuProfile * StopProfiling(const char *title)
#define CODE_EVENTS_TYPE_LIST(V)
Definition: cpu-profiler.h:49
#define ASSERT(condition)
Definition: checks.h:329
static Script * cast(Object *obj)
void set_no_frame_ranges(List< OffsetRange > *ranges)
virtual void SetterCallbackEvent(Name *name, Address entry_point)
HANDLE HANDLE LPSTACKFRAME64 StackFrame
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 IncreaseProfilingDepth()
Definition: sampler.cc:678
void RecordTickSample(const TickSample &sample)
StackFrame * frame() const
Definition: frames.h:863
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
#define V8_ALIGNOF(type)
Definition: v8config.h:471
virtual void GetterCallbackEvent(Name *name, Address entry_point)
bool StartProfiling(const char *title, bool record_samples)
void Enqueue(const CodeEventsContainer &event)
Definition: cpu-profiler.cc:59
Isolate * isolate() const
Definition: cpu-profiler.h:264
bool HasBeenSetUp()
Definition: heap.cc:260
void RemoveProfile(CpuProfile *profile)
void StartSynchronously()
Definition: platform.h:550
BailoutReason DisableOptimizationReason()
Definition: objects-inl.h:5455
void LogCodeObjects()
Definition: log.cc:1890
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)
void AlignedFree(void *ptr)
Definition: allocation.cc:125
void SetHasProcessingThread(bool value)
Definition: sampler.h:111
const char * GetBailoutReason(BailoutReason reason)
Definition: objects.cc:16437
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 * AlignedAlloc(size_t size, size_t alignment)
Definition: allocation.cc:108
int ExecutableSize()
Definition: objects.h:5499
CpuProfile * GetProfile(int index)
static const char *const kEmptyNamePrefix
const char * GetFunctionName(Name *name)
CpuProfiler(Isolate *isolate)
void set_sampling_interval(TimeDelta value)
void Init(Isolate *isolate, const RegisterState &state)
Definition: sampler.cc:589
CodeEntry * NewCodeEntry(Logger::LogEventsAndTags tag, const char *name, const char *name_prefix=CodeEntry::kEmptyNamePrefix, const char *resource_name=CodeEntry::kEmptyResourceName, int line_number=v8::CpuProfileNode::kNoLineNumberInfo, int column_number=v8::CpuProfileNode::kNoColumnNumberInfo)
Logger * logger()
Definition: isolate.h:868
void LogAccessorCallbacks()
Definition: log.cc:1971
List< OffsetRange > * ReleaseNoFrameRanges()
Definition: compiler.h:300
virtual void RegExpCodeCreateEvent(Code *code, String *source)
CpuProfile * StopProfiling(const char *title)
#define PROFILER_TYPE_CASE(type, clss)
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
virtual void CallbackEvent(Name *name, Address entry_point)
virtual void CodeMoveEvent(Address from, Address to)
void set_script_id(int script_id)