Revision f230a1cf deps/v8/src/profile-generator.h
deps/v8/src/profile-generator.h | ||
---|---|---|
49 | 49 |
const char* GetVFormatted(const char* format, va_list args); |
50 | 50 |
const char* GetName(Name* name); |
51 | 51 |
const char* GetName(int index); |
52 |
inline const char* GetFunctionName(Name* name);
|
|
53 |
inline const char* GetFunctionName(const char* name);
|
|
52 |
const char* GetFunctionName(Name* name); |
|
53 |
const char* GetFunctionName(const char* name); |
|
54 | 54 |
size_t GetUsedMemorySize() const; |
55 | 55 |
|
56 | 56 |
private: |
57 | 57 |
static const int kMaxNameSize = 1024; |
58 | 58 |
|
59 |
INLINE(static bool StringsMatch(void* key1, void* key2)) { |
|
60 |
return strcmp(reinterpret_cast<char*>(key1), |
|
61 |
reinterpret_cast<char*>(key2)) == 0; |
|
62 |
} |
|
63 |
const char* AddOrDisposeString(char* str, uint32_t hash); |
|
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); |
|
64 | 63 |
|
65 |
// Mapping of strings by String::Hash to const char* strings. |
|
66 | 64 |
uint32_t hash_seed_; |
67 | 65 |
HashMap names_; |
68 | 66 |
|
... | ... | |
73 | 71 |
class CodeEntry { |
74 | 72 |
public: |
75 | 73 |
// CodeEntry doesn't own name strings, just references them. |
76 |
INLINE(CodeEntry(Logger::LogEventsAndTags tag,
|
|
74 |
inline CodeEntry(Logger::LogEventsAndTags tag,
|
|
77 | 75 |
const char* name, |
78 | 76 |
const char* name_prefix = CodeEntry::kEmptyNamePrefix, |
79 | 77 |
const char* resource_name = CodeEntry::kEmptyResourceName, |
80 |
int line_number = v8::CpuProfileNode::kNoLineNumberInfo)); |
|
78 |
int line_number = v8::CpuProfileNode::kNoLineNumberInfo, |
|
79 |
int column_number = v8::CpuProfileNode::kNoColumnNumberInfo); |
|
81 | 80 |
~CodeEntry(); |
82 | 81 |
|
83 |
INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } |
|
84 |
INLINE(const char* name_prefix() const) { return name_prefix_; } |
|
85 |
INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } |
|
86 |
INLINE(const char* name() const) { return name_; } |
|
87 |
INLINE(const char* resource_name() const) { return resource_name_; } |
|
88 |
INLINE(int line_number() const) { return line_number_; } |
|
89 |
INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } |
|
90 |
INLINE(int script_id() const) { return script_id_; } |
|
91 |
INLINE(void set_script_id(int script_id)) { script_id_ = script_id; } |
|
92 |
INLINE(void set_bailout_reason(const char* bailout_reason)) { |
|
82 |
bool is_js_function() const { return is_js_function_tag(tag_); } |
|
83 |
const char* name_prefix() const { return name_prefix_; } |
|
84 |
bool has_name_prefix() const { return name_prefix_[0] != '\0'; } |
|
85 |
const char* name() const { return name_; } |
|
86 |
const char* resource_name() const { return resource_name_; } |
|
87 |
int line_number() const { return line_number_; } |
|
88 |
int column_number() const { return column_number_; } |
|
89 |
void set_shared_id(int shared_id) { shared_id_ = shared_id; } |
|
90 |
int script_id() const { return script_id_; } |
|
91 |
void set_script_id(int script_id) { script_id_ = script_id; } |
|
92 |
void set_bailout_reason(const char* bailout_reason) { |
|
93 | 93 |
bailout_reason_ = bailout_reason; |
94 | 94 |
} |
95 |
INLINE(const char* bailout_reason() const) { return bailout_reason_; }
|
|
95 |
const char* bailout_reason() const { return bailout_reason_; }
|
|
96 | 96 |
|
97 |
INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
|
|
97 |
static inline bool is_js_function_tag(Logger::LogEventsAndTags tag);
|
|
98 | 98 |
|
99 | 99 |
List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } |
100 | 100 |
void set_no_frame_ranges(List<OffsetRange>* ranges) { |
... | ... | |
104 | 104 |
void SetBuiltinId(Builtins::Name id); |
105 | 105 |
Builtins::Name builtin_id() const { return builtin_id_; } |
106 | 106 |
|
107 |
void CopyData(const CodeEntry& source); |
|
108 | 107 |
uint32_t GetCallUid() const; |
109 | 108 |
bool IsSameAs(CodeEntry* entry) const; |
110 | 109 |
|
... | ... | |
119 | 118 |
const char* name_; |
120 | 119 |
const char* resource_name_; |
121 | 120 |
int line_number_; |
121 |
int column_number_; |
|
122 | 122 |
int shared_id_; |
123 | 123 |
int script_id_; |
124 | 124 |
List<OffsetRange>* no_frame_ranges_; |
... | ... | |
132 | 132 |
|
133 | 133 |
class ProfileNode { |
134 | 134 |
public: |
135 |
INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry));
|
|
135 |
inline ProfileNode(ProfileTree* tree, CodeEntry* entry);
|
|
136 | 136 |
|
137 | 137 |
ProfileNode* FindChild(CodeEntry* entry); |
138 | 138 |
ProfileNode* FindOrAddChild(CodeEntry* entry); |
139 |
INLINE(void IncrementSelfTicks()) { ++self_ticks_; }
|
|
140 |
INLINE(void IncreaseSelfTicks(unsigned amount)) { self_ticks_ += amount; }
|
|
139 |
void IncrementSelfTicks() { ++self_ticks_; }
|
|
140 |
void IncreaseSelfTicks(unsigned amount) { self_ticks_ += amount; }
|
|
141 | 141 |
|
142 |
INLINE(CodeEntry* entry() const) { return entry_; }
|
|
143 |
INLINE(unsigned self_ticks() const) { return self_ticks_; }
|
|
144 |
INLINE(const List<ProfileNode*>* children() const) { return &children_list_; }
|
|
142 |
CodeEntry* entry() const { return entry_; }
|
|
143 |
unsigned self_ticks() const { return self_ticks_; }
|
|
144 |
const List<ProfileNode*>* children() const { return &children_list_; }
|
|
145 | 145 |
unsigned id() const { return id_; } |
146 | 146 |
|
147 | 147 |
void Print(int indent); |
148 | 148 |
|
149 | 149 |
private: |
150 |
INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) {
|
|
150 |
static bool CodeEntriesMatch(void* entry1, void* entry2) {
|
|
151 | 151 |
return reinterpret_cast<CodeEntry*>(entry1)->IsSameAs( |
152 | 152 |
reinterpret_cast<CodeEntry*>(entry2)); |
153 | 153 |
} |
154 | 154 |
|
155 |
INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) {
|
|
155 |
static uint32_t CodeEntryHash(CodeEntry* entry) {
|
|
156 | 156 |
return entry->GetCallUid(); |
157 | 157 |
} |
158 | 158 |
|
... | ... | |
304 | 304 |
const char* name, |
305 | 305 |
const char* name_prefix = CodeEntry::kEmptyNamePrefix, |
306 | 306 |
const char* resource_name = CodeEntry::kEmptyResourceName, |
307 |
int line_number = v8::CpuProfileNode::kNoLineNumberInfo); |
|
307 |
int line_number = v8::CpuProfileNode::kNoLineNumberInfo, |
|
308 |
int column_number = v8::CpuProfileNode::kNoColumnNumberInfo); |
|
308 | 309 |
|
309 | 310 |
// Called from profile generator thread. |
310 | 311 |
void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path); |
... | ... | |
331 | 332 |
|
332 | 333 |
void RecordTickSample(const TickSample& sample); |
333 | 334 |
|
334 |
INLINE(CodeMap* code_map()) { return &code_map_; }
|
|
335 |
CodeMap* code_map() { return &code_map_; }
|
|
335 | 336 |
|
336 | 337 |
static const char* const kAnonymousFunctionName; |
337 | 338 |
static const char* const kProgramEntryName; |
... | ... | |
342 | 343 |
static const char* const kUnresolvedFunctionName; |
343 | 344 |
|
344 | 345 |
private: |
345 |
INLINE(CodeEntry* EntryForVMState(StateTag tag));
|
|
346 |
CodeEntry* EntryForVMState(StateTag tag);
|
|
346 | 347 |
|
347 | 348 |
CpuProfilesCollection* profiles_; |
348 | 349 |
CodeMap code_map_; |
Also available in: Unified diff