28 #ifndef V8_PROFILE_GENERATOR_H_
29 #define V8_PROFILE_GENERATOR_H_
33 #include "../include/v8-profiler.h"
47 const char*
GetCopy(
const char* src);
57 static const int kMaxNameSize = 1024;
59 static bool StringsMatch(
void* key1,
void* key2);
60 const char* BeautifyFunctionName(
const char* name);
61 const char* AddOrDisposeString(
char* str,
int len);
62 HashMap::Entry* GetEntry(
const char* str,
int len);
85 const char*
name()
const {
return name_; }
101 no_frame_ranges_ = ranges;
117 const char* name_prefix_;
119 const char* resource_name_;
125 const char* bailout_reason_;
145 unsigned id()
const {
return id_; }
147 void Print(
int indent);
150 static bool CodeEntriesMatch(
void* entry1,
void* entry2) {
151 return reinterpret_cast<CodeEntry*
>(entry1)->IsSameAs(
152 reinterpret_cast<CodeEntry*>(entry2));
155 static uint32_t CodeEntryHash(CodeEntry* entry) {
161 unsigned self_ticks_;
164 List<ProfileNode*> children_list_;
186 template <
typename Callback>
187 void TraverseDepthFirst(Callback* callback);
190 unsigned next_node_id_;
205 const char*
title()
const {
return title_; }
220 bool record_samples_;
242 struct CodeEntryInfo {
243 CodeEntryInfo(
CodeEntry* an_entry,
unsigned a_size)
244 : entry(an_entry),
size(a_size) { }
249 struct CodeTreeConfig {
251 typedef CodeEntryInfo Value;
252 static const Key kNoKey;
253 static const Value NoValue() {
return CodeEntryInfo(
NULL, 0); }
254 static int Compare(
const Key& a,
const Key& b) {
255 return a < b ? -1 : (a > b ? 1 : 0);
258 typedef SplayTree<CodeTreeConfig> CodeTree;
260 class CodeTreePrinter {
262 void Call(
const Address& key,
const CodeEntryInfo& value);
268 static CodeEntry*
const kSharedFunctionCodeEntry;
273 DISALLOW_COPY_AND_ASSIGN(
CodeMap);
286 return function_and_resource_names_.
GetName(name);
289 return function_and_resource_names_.
GetName(args_count);
321 Semaphore current_profiles_semaphore_;
359 #endif // V8_PROFILE_GENERATOR_H_
CodeEntry(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)
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
static const char *const kEmptyBailoutReason
size_t GetUsedMemorySize() const
bool IsLastProfile(const char *title)
const char * title() const
const char * bailout_reason() const
uint32_t GetCallUid() const
static const int kMaxSimultaneousProfiles
ProfileNode * root() const
void CalculateTotalTicksAndSamplingRate()
void set_shared_id(int shared_id)
ProfileGenerator(CpuProfilesCollection *profiles)
static const char *const kUnresolvedFunctionName
void IncreaseSelfTicks(unsigned amount)
void set_bailout_reason(const char *bailout_reason)
const char * GetName(Name *name)
CodeEntry * entry() const
ProfileNode * sample(int index) const
const char * GetFormatted(const char *format,...)
List< OffsetRange > * no_frame_ranges() const
void SetBuiltinId(Builtins::Name id)
const char * GetName(int args_count)
const List< ProfileNode * > * children() const
const char * GetName(Name *name)
void set_no_frame_ranges(List< OffsetRange > *ranges)
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
const ProfileTree * top_down() const
static const int kNoColumnNumberInfo
void RecordTickSample(const TickSample &sample)
const char * GetFunctionName(Name *name)
int GetSharedId(Address addr)
void IncrementSelfTicks()
ProfileNode * FindChild(CodeEntry *entry)
int Compare(const T &a, const T &b)
int samples_count() const
void MoveCode(Address from, Address to)
static const char *const kProgramEntryName
bool is_js_function() const
CpuProfile(const char *title, bool record_samples)
const char * resource_name() const
bool StartProfiling(const char *title, bool record_samples)
bool IsSameAs(CodeEntry *entry) const
CpuProfilesCollection(Heap *heap)
StringsStorage(Heap *heap)
void RemoveProfile(CpuProfile *profile)
const char * name() const
static const char *const kGarbageCollectorEntryName
void AddPathToCurrentProfiles(const Vector< CodeEntry * > &path)
static const char *const kIdleEntryName
Builtins::Name builtin_id() const
ProfileNode(ProfileTree *tree, CodeEntry *entry)
void AddPath(const Vector< CodeEntry * > &path)
void AddCode(Address addr, CodeEntry *entry, unsigned size)
void AddPathFromStart(const Vector< CodeEntry * > &path)
static const char *const kAnonymousFunctionName
static const char *const kEmptyResourceName
int column_number() const
const char * GetCopy(const char *src)
TemplateHashMapImpl< FreeStoreAllocationPolicy > HashMap
List< CpuProfile * > * profiles()
static const char *const kEmptyNamePrefix
const char * GetFunctionName(const char *name)
const char * GetFunctionName(Name *name)
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)
ProfileNode * AddPathFromEnd(const Vector< CodeEntry * > &path)
CpuProfile * StopProfiling(const char *title)
unsigned self_ticks() const
const char * GetVFormatted(const char *format, va_list args)
CodeEntry * FindEntry(Address addr, Address *start=NULL)
static const int kNoLineNumberInfo
bool has_name_prefix() const
ProfileNode * FindOrAddChild(CodeEntry *entry)
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
static bool is_js_function_tag(Logger::LogEventsAndTags tag)
const char * name_prefix() const
void set_script_id(int script_id)