Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Side by Side Diff: src/profile-generator.h

Issue 17836002: CPUProfiler: Simplify CodeEntry constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/profile-generator.cc » ('j') | test/cctest/test-cpu-profiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DISALLOW_COPY_AND_ASSIGN(StringsStorage); 92 DISALLOW_COPY_AND_ASSIGN(StringsStorage);
93 }; 93 };
94 94
95 95
96 class CodeEntry { 96 class CodeEntry {
97 public: 97 public:
98 // CodeEntry doesn't own name strings, just references them. 98 // CodeEntry doesn't own name strings, just references them.
99 INLINE(CodeEntry(Logger::LogEventsAndTags tag, 99 INLINE(CodeEntry(Logger::LogEventsAndTags tag,
100 const char* name_prefix, 100 const char* name_prefix,
101 const char* name, 101 const char* name,
102 const char* resource_name, 102 int security_token_id = TokenEnumerator::kNoSecurityToken,
103 int line_number, 103 const char* resource_name = "",
104 int security_token_id)); 104 int line_number = v8::CpuProfileNode::kNoLineNumberInfo));
105 ~CodeEntry(); 105 ~CodeEntry();
106 106
107 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } 107 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); }
108 INLINE(const char* name_prefix() const) { return name_prefix_; } 108 INLINE(const char* name_prefix() const) { return name_prefix_; }
109 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } 109 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; }
110 INLINE(const char* name() const) { return name_; } 110 INLINE(const char* name() const) { return name_; }
111 INLINE(int script_id() const) { return script_id_; }
111 INLINE(const char* resource_name() const) { return resource_name_; } 112 INLINE(const char* resource_name() const) { return resource_name_; }
112 INLINE(int line_number() const) { return line_number_; } 113 INLINE(int line_number() const) { return line_number_; }
113 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } 114 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; }
114 INLINE(int security_token_id() const) { return security_token_id_; } 115 INLINE(int security_token_id() const) { return security_token_id_; }
115 116
116 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); 117 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
117 118
118 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } 119 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; }
119 void set_no_frame_ranges(List<OffsetRange>* ranges) { 120 void set_no_frame_ranges(List<OffsetRange>* ranges) {
120 no_frame_ranges_ = ranges; 121 no_frame_ranges_ = ranges;
121 } 122 }
122 123
123 void CopyData(const CodeEntry& source); 124 void CopyData(const CodeEntry& source);
124 uint32_t GetCallUid() const; 125 uint32_t GetCallUid() const;
125 bool IsSameAs(CodeEntry* entry) const; 126 bool IsSameAs(CodeEntry* entry) const;
126 127
127 static const char* const kEmptyNamePrefix; 128 static const char* const kEmptyNamePrefix;
128 129
129 private: 130 private:
130 Logger::LogEventsAndTags tag_; 131 Logger::LogEventsAndTags tag_;
131 const char* name_prefix_; 132 const char* name_prefix_;
132 const char* name_; 133 const char* name_;
134 int script_id_;
133 const char* resource_name_; 135 const char* resource_name_;
134 int line_number_; 136 int line_number_;
135 int shared_id_; 137 int shared_id_;
136 int security_token_id_; 138 int security_token_id_;
137 List<OffsetRange>* no_frame_ranges_; 139 List<OffsetRange>* no_frame_ranges_;
138 140
139 DISALLOW_COPY_AND_ASSIGN(CodeEntry); 141 DISALLOW_COPY_AND_ASSIGN(CodeEntry);
140 }; 142 };
141 143
142 144
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return function_and_resource_names_.GetName(name); 317 return function_and_resource_names_.GetName(name);
316 } 318 }
317 const char* GetName(int args_count) { 319 const char* GetName(int args_count) {
318 return function_and_resource_names_.GetName(args_count); 320 return function_and_resource_names_.GetName(args_count);
319 } 321 }
320 CpuProfile* GetProfile(int security_token_id, unsigned uid); 322 CpuProfile* GetProfile(int security_token_id, unsigned uid);
321 bool IsLastProfile(const char* title); 323 bool IsLastProfile(const char* title);
322 void RemoveProfile(CpuProfile* profile); 324 void RemoveProfile(CpuProfile* profile);
323 bool HasDetachedProfiles() { return detached_profiles_.length() > 0; } 325 bool HasDetachedProfiles() { return detached_profiles_.length() > 0; }
324 326
325 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, 327 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, Name* name,
yurys 2013/06/26 09:34:47 Revert this?
326 Name* name, String* resource_name, int line_number); 328 String* resource_name, int line_number);
327 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name); 329 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name);
328 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, 330 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
329 const char* name_prefix, Name* name); 331 const char* name_prefix, Name* name);
330 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count); 332 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count);
331 CodeEntry* NewCodeEntry(int security_token_id); 333 CodeEntry* NewCodeEntry(int security_token_id);
332 334
333 // Called from profile generator thread. 335 // Called from profile generator thread.
334 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path); 336 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path);
335 337
336 // Limits the number of profiles that can be simultaneously collected. 338 // Limits the number of profiles that can be simultaneously collected.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 CodeEntry* gc_entry_; 433 CodeEntry* gc_entry_;
432 SampleRateCalculator sample_rate_calc_; 434 SampleRateCalculator sample_rate_calc_;
433 435
434 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); 436 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
435 }; 437 };
436 438
437 439
438 } } // namespace v8::internal 440 } } // namespace v8::internal
439 441
440 #endif // V8_PROFILE_GENERATOR_H_ 442 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/profile-generator.cc » ('j') | test/cctest/test-cpu-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698