5 #ifndef V8_CPU_PROFILER_H_
6 #define V8_CPU_PROFILER_H_
21 class CompilationInfo;
23 class CpuProfilesCollection;
24 class ProfileGenerator;
26 #define CODE_EVENTS_TYPE_LIST(V) \
27 V(CODE_CREATION, CodeCreateEventRecord) \
28 V(CODE_MOVE, CodeMoveEventRecord) \
29 V(CODE_DISABLE_OPT, CodeDisableOptEventRecord) \
30 V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord) \
31 V(REPORT_BUILTIN, ReportBuiltinEventRecord)
36 #define DECLARE_TYPE(type, ignore) type,
116 #define DECLARE_CLASS(ignore, type) type type##_;
129 base::TimeDelta period);
134 void StopSynchronously();
135 INLINE(
bool running()) {
return running_; }
139 void AddCurrentStack(
Isolate* isolate);
146 inline void FinishTickSample();
150 void*
operator new(
size_t size);
151 void operator delete(
void* ptr);
155 bool ProcessCodeEvent();
162 SampleProcessingResult ProcessOneSample();
170 static const size_t kTickSampleBufferSize = 1 *
MB;
171 static const size_t kTickSampleQueueLength =
181 #define PROFILE(IsolateGetter, Call) \
183 Isolate* cpu_profiler_isolate = (IsolateGetter); \
184 v8::internal::Logger* logger = cpu_profiler_isolate->logger(); \
185 CpuProfiler* cpu_profiler = cpu_profiler_isolate->cpu_profiler(); \
186 if (logger->is_logging_code_events() || cpu_profiler->is_profiling()) { \
204 void StartProfiling(
const char* title,
bool record_samples =
false);
221 Code* code,
const char* comment);
230 int line,
int column);
232 Code* code,
int args_count);
INLINE(void UpdateCodeMap(CodeMap *code_map))
const char * bailout_reason
INLINE(void UpdateCodeMap(CodeMap *code_map))
CodeEventsContainer(CodeEventRecord::Type type=CodeEventRecord::NONE)
INLINE(void UpdateCodeMap(CodeMap *code_map))
void StartProcessorIfNotStarted()
void StartProfiling(const char *title, bool record_samples=false)
CpuProfile * StopProfiling(const char *title)
CpuProfile * GetProfile(int index)
bool * is_profiling_address()
void StopProcessorIfLastProfile(const char *title)
ProfileGenerator * generator() const
TickSample * StartTickSample()
CpuProfiler(Isolate *isolate)
virtual void CallbackEvent(Name *name, Address entry_point)
DISALLOW_COPY_AND_ASSIGN(CpuProfiler)
virtual void GetterCallbackEvent(Name *name, Address entry_point)
ProfilerEventsProcessor * processor_
void set_sampling_interval(base::TimeDelta value)
Isolate * isolate() const
virtual void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
INLINE(bool is_profiling() const)
CpuProfilesCollection * profiles_
virtual void CodeMoveEvent(Address from, Address to)
virtual void CodeMovingGCEvent()
ProfilerEventsProcessor * processor() const
virtual void CodeDeleteEvent(Address from)
base::TimeDelta sampling_interval_
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)
virtual void RegExpCodeCreateEvent(Code *code, String *source)
ProfileGenerator * generator_
virtual void SharedFunctionInfoMoveEvent(Address from, Address to)
void DeleteProfile(CpuProfile *profile)
virtual void SetterCallbackEvent(Name *name, Address entry_point)
unsigned last_code_event_id_
@ FoundSampleForNextCodeEvent
UnboundQueue< CodeEventsContainer > events_buffer_
const base::TimeDelta period_
UnboundQueue< TickSampleEventRecord > ticks_from_vm_buffer_
ProfileGenerator * generator_
virtual ~ProfilerEventsProcessor()
SamplingCircularQueue< TickSampleEventRecord, kTickSampleQueueLength > ticks_buffer_
unsigned last_processed_code_event_id_
INLINE(void UpdateCodeMap(CodeMap *code_map))
Builtins::Name builtin_id
INLINE(void UpdateCodeMap(CodeMap *code_map))
TickSampleEventRecord(unsigned order)
#define DECLARE_TYPE(type, ignore)
#define CODE_EVENTS_TYPE_LIST(V)
#define DECLARE_CLASS(ignore, type)
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
Debugger support for the V8 JavaScript engine.