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

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

Issue 17642009: CPUProfiler: propagate scriptId to the front-end (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: unnecessary line was removed 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
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 int script_id,
102 const char* resource_name, 103 const char* resource_name,
103 int line_number, 104 int line_number,
104 int security_token_id)); 105 int security_token_id));
105 ~CodeEntry(); 106 ~CodeEntry();
106 107
107 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } 108 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); }
108 INLINE(const char* name_prefix() const) { return name_prefix_; } 109 INLINE(const char* name_prefix() const) { return name_prefix_; }
109 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } 110 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; }
110 INLINE(const char* name() const) { return name_; } 111 INLINE(const char* name() const) { return name_; }
112 INLINE(int script_id() const) { return script_id_; }
111 INLINE(const char* resource_name() const) { return resource_name_; } 113 INLINE(const char* resource_name() const) { return resource_name_; }
112 INLINE(int line_number() const) { return line_number_; } 114 INLINE(int line_number() const) { return line_number_; }
113 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } 115 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; }
114 INLINE(int security_token_id() const) { return security_token_id_; } 116 INLINE(int security_token_id() const) { return security_token_id_; }
115 117
116 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); 118 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
117 119
118 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } 120 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; }
119 void set_no_frame_ranges(List<OffsetRange>* ranges) { 121 void set_no_frame_ranges(List<OffsetRange>* ranges) {
120 no_frame_ranges_ = ranges; 122 no_frame_ranges_ = ranges;
121 } 123 }
122 124
123 void CopyData(const CodeEntry& source); 125 void CopyData(const CodeEntry& source);
124 uint32_t GetCallUid() const; 126 uint32_t GetCallUid() const;
125 bool IsSameAs(CodeEntry* entry) const; 127 bool IsSameAs(CodeEntry* entry) const;
126 128
127 static const char* const kEmptyNamePrefix; 129 static const char* const kEmptyNamePrefix;
128 130
129 private: 131 private:
130 Logger::LogEventsAndTags tag_; 132 Logger::LogEventsAndTags tag_;
131 const char* name_prefix_; 133 const char* name_prefix_;
132 const char* name_; 134 const char* name_;
135 int script_id_;
133 const char* resource_name_; 136 const char* resource_name_;
134 int line_number_; 137 int line_number_;
135 int shared_id_; 138 int shared_id_;
136 int security_token_id_; 139 int security_token_id_;
137 List<OffsetRange>* no_frame_ranges_; 140 List<OffsetRange>* no_frame_ranges_;
138 141
139 DISALLOW_COPY_AND_ASSIGN(CodeEntry); 142 DISALLOW_COPY_AND_ASSIGN(CodeEntry);
140 }; 143 };
141 144
142 145
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return function_and_resource_names_.GetName(name); 318 return function_and_resource_names_.GetName(name);
316 } 319 }
317 const char* GetName(int args_count) { 320 const char* GetName(int args_count) {
318 return function_and_resource_names_.GetName(args_count); 321 return function_and_resource_names_.GetName(args_count);
319 } 322 }
320 CpuProfile* GetProfile(int security_token_id, unsigned uid); 323 CpuProfile* GetProfile(int security_token_id, unsigned uid);
321 bool IsLastProfile(const char* title); 324 bool IsLastProfile(const char* title);
322 void RemoveProfile(CpuProfile* profile); 325 void RemoveProfile(CpuProfile* profile);
323 bool HasDetachedProfiles() { return detached_profiles_.length() > 0; } 326 bool HasDetachedProfiles() { return detached_profiles_.length() > 0; }
324 327
325 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, 328 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, Name* name,
326 Name* name, String* resource_name, int line_number); 329 int script_id, String* resource_name, int line_number);
327 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name); 330 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, const char* name);
328 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, 331 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag,
329 const char* name_prefix, Name* name); 332 const char* name_prefix, Name* name);
330 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count); 333 CodeEntry* NewCodeEntry(Logger::LogEventsAndTags tag, int args_count);
331 CodeEntry* NewCodeEntry(int security_token_id); 334 CodeEntry* NewCodeEntry(int security_token_id);
332 335
333 // Called from profile generator thread. 336 // Called from profile generator thread.
334 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path); 337 void AddPathToCurrentProfiles(const Vector<CodeEntry*>& path);
335 338
336 // Limits the number of profiles that can be simultaneously collected. 339 // 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_; 434 CodeEntry* gc_entry_;
432 SampleRateCalculator sample_rate_calc_; 435 SampleRateCalculator sample_rate_calc_;
433 436
434 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); 437 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
435 }; 438 };
436 439
437 440
438 } } // namespace v8::internal 441 } } // namespace v8::internal
439 442
440 #endif // V8_PROFILE_GENERATOR_H_ 443 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698