OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 }; | 70 }; |
71 | 71 |
72 | 72 |
73 class CodeEntry { | 73 class CodeEntry { |
74 public: | 74 public: |
75 // CodeEntry doesn't own name strings, just references them. | 75 // CodeEntry doesn't own name strings, just references them. |
76 INLINE(CodeEntry(Logger::LogEventsAndTags tag, | 76 INLINE(CodeEntry(Logger::LogEventsAndTags tag, |
77 const char* name, | 77 const char* name, |
78 const char* name_prefix = CodeEntry::kEmptyNamePrefix, | 78 const char* name_prefix = CodeEntry::kEmptyNamePrefix, |
79 const char* resource_name = CodeEntry::kEmptyResourceName, | 79 const char* resource_name = CodeEntry::kEmptyResourceName, |
80 int line_number = v8::CpuProfileNode::kNoLineNumberInfo)); | 80 int line_number = v8::CpuProfileNode::kNoLineNumberInfo, |
| 81 int column_number = |
| 82 v8::CpuProfileNode::kNoColumnNumberInfo)); |
81 ~CodeEntry(); | 83 ~CodeEntry(); |
82 | 84 |
83 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } | 85 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } |
84 INLINE(const char* name_prefix() const) { return name_prefix_; } | 86 INLINE(const char* name_prefix() const) { return name_prefix_; } |
85 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } | 87 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } |
86 INLINE(const char* name() const) { return name_; } | 88 INLINE(const char* name() const) { return name_; } |
87 INLINE(const char* resource_name() const) { return resource_name_; } | 89 INLINE(const char* resource_name() const) { return resource_name_; } |
88 INLINE(int line_number() const) { return line_number_; } | 90 INLINE(int line_number() const) { return line_number_; } |
| 91 int column_number() const { return column_number_; } |
89 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } | 92 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } |
90 INLINE(int script_id() const) { return script_id_; } | 93 INLINE(int script_id() const) { return script_id_; } |
91 INLINE(void set_script_id(int script_id)) { script_id_ = script_id; } | 94 INLINE(void set_script_id(int script_id)) { script_id_ = script_id; } |
92 INLINE(void set_bailout_reason(const char* bailout_reason)) { | 95 INLINE(void set_bailout_reason(const char* bailout_reason)) { |
93 bailout_reason_ = bailout_reason; | 96 bailout_reason_ = bailout_reason; |
94 } | 97 } |
95 INLINE(const char* bailout_reason() const) { return bailout_reason_; } | 98 INLINE(const char* bailout_reason() const) { return bailout_reason_; } |
96 | 99 |
97 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); | 100 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); |
98 | 101 |
(...skipping 13 matching lines...) Expand all Loading... |
112 static const char* const kEmptyResourceName; | 115 static const char* const kEmptyResourceName; |
113 static const char* const kEmptyBailoutReason; | 116 static const char* const kEmptyBailoutReason; |
114 | 117 |
115 private: | 118 private: |
116 Logger::LogEventsAndTags tag_ : 8; | 119 Logger::LogEventsAndTags tag_ : 8; |
117 Builtins::Name builtin_id_ : 8; | 120 Builtins::Name builtin_id_ : 8; |
118 const char* name_prefix_; | 121 const char* name_prefix_; |
119 const char* name_; | 122 const char* name_; |
120 const char* resource_name_; | 123 const char* resource_name_; |
121 int line_number_; | 124 int line_number_; |
| 125 int column_number_; |
122 int shared_id_; | 126 int shared_id_; |
123 int script_id_; | 127 int script_id_; |
124 List<OffsetRange>* no_frame_ranges_; | 128 List<OffsetRange>* no_frame_ranges_; |
125 const char* bailout_reason_; | 129 const char* bailout_reason_; |
126 | 130 |
127 DISALLOW_COPY_AND_ASSIGN(CodeEntry); | 131 DISALLOW_COPY_AND_ASSIGN(CodeEntry); |
128 }; | 132 }; |
129 | 133 |
130 | 134 |
131 class ProfileTree; | 135 class ProfileTree; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return function_and_resource_names_.GetFunctionName(name); | 301 return function_and_resource_names_.GetFunctionName(name); |
298 } | 302 } |
299 bool IsLastProfile(const char* title); | 303 bool IsLastProfile(const char* title); |
300 void RemoveProfile(CpuProfile* profile); | 304 void RemoveProfile(CpuProfile* profile); |
301 | 305 |
302 CodeEntry* NewCodeEntry( | 306 CodeEntry* NewCodeEntry( |
303 Logger::LogEventsAndTags tag, | 307 Logger::LogEventsAndTags tag, |
304 const char* name, | 308 const char* name, |
305 const char* name_prefix = CodeEntry::kEmptyNamePrefix, | 309 const char* name_prefix = CodeEntry::kEmptyNamePrefix, |
306 const char* resource_name = CodeEntry::kEmptyResourceName, | 310 const char* resource_name = CodeEntry::kEmptyResourceName, |
307 int line_number = v8::CpuProfileNode::kNoLineNumberInfo); | 311 int line_number = v8::CpuProfileNode::kNoLineNumberInfo, |
| 312 int column_number = v8::CpuProfileNode::kNoColumnNumberInfo); |
308 | 313 |
309 // Called from profile generator thread. | 314 // Called from profile generator thread. |
310 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path); | 315 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path); |
311 | 316 |
312 // Limits the number of profiles that can be simultaneously collected. | 317 // Limits the number of profiles that can be simultaneously collected. |
313 static const int kMaxSimultaneousProfiles = 100; | 318 static const int kMaxSimultaneousProfiles = 100; |
314 | 319 |
315 private: | 320 private: |
316 StringsStorage function_and_resource_names_; | 321 StringsStorage function_and_resource_names_; |
317 List<CodeEntry*> code_entries_; | 322 List<CodeEntry*> code_entries_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 CodeEntry* gc_entry_; | 356 CodeEntry* gc_entry_; |
352 CodeEntry* unresolved_entry_; | 357 CodeEntry* unresolved_entry_; |
353 | 358 |
354 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 359 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
355 }; | 360 }; |
356 | 361 |
357 | 362 |
358 } } // namespace v8::internal | 363 } } // namespace v8::internal |
359 | 364 |
360 #endif // V8_PROFILE_GENERATOR_H_ | 365 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |