OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 unsigned uid_; | 229 unsigned uid_; |
230 ProfileTree top_down_; | 230 ProfileTree top_down_; |
231 ProfileTree bottom_up_; | 231 ProfileTree bottom_up_; |
232 | 232 |
233 DISALLOW_COPY_AND_ASSIGN(CpuProfile); | 233 DISALLOW_COPY_AND_ASSIGN(CpuProfile); |
234 }; | 234 }; |
235 | 235 |
236 | 236 |
237 class CodeMap { | 237 class CodeMap { |
238 public: | 238 public: |
239 CodeMap() : next_sfi_tag_(1) { } | 239 CodeMap() : next_shared_id_(1) { } |
240 INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size)); | 240 INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size)); |
241 INLINE(void MoveCode(Address from, Address to)); | 241 INLINE(void MoveCode(Address from, Address to)); |
242 INLINE(void DeleteCode(Address addr)); | 242 INLINE(void DeleteCode(Address addr)); |
243 CodeEntry* FindEntry(Address addr); | 243 CodeEntry* FindEntry(Address addr); |
244 int GetSFITag(Address addr); | 244 int GetSharedId(Address addr); |
245 | 245 |
246 void Print(); | 246 void Print(); |
247 | 247 |
248 private: | 248 private: |
249 struct CodeEntryInfo { | 249 struct CodeEntryInfo { |
250 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) | 250 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) |
251 : entry(an_entry), size(a_size) { } | 251 : entry(an_entry), size(a_size) { } |
252 CodeEntry* entry; | 252 CodeEntry* entry; |
253 unsigned size; | 253 unsigned size; |
254 }; | 254 }; |
255 | 255 |
256 struct CodeTreeConfig { | 256 struct CodeTreeConfig { |
257 typedef Address Key; | 257 typedef Address Key; |
258 typedef CodeEntryInfo Value; | 258 typedef CodeEntryInfo Value; |
259 static const Key kNoKey; | 259 static const Key kNoKey; |
260 static const Value kNoValue; | 260 static const Value kNoValue; |
261 static int Compare(const Key& a, const Key& b) { | 261 static int Compare(const Key& a, const Key& b) { |
262 return a < b ? -1 : (a > b ? 1 : 0); | 262 return a < b ? -1 : (a > b ? 1 : 0); |
263 } | 263 } |
264 }; | 264 }; |
265 typedef SplayTree<CodeTreeConfig> CodeTree; | 265 typedef SplayTree<CodeTreeConfig> CodeTree; |
266 | 266 |
267 class CodeTreePrinter { | 267 class CodeTreePrinter { |
268 public: | 268 public: |
269 void Call(const Address& key, const CodeEntryInfo& value); | 269 void Call(const Address& key, const CodeEntryInfo& value); |
270 }; | 270 }; |
271 | 271 |
272 // Fake CodeEntry pointer to distinguish SFI entries. | 272 // Fake CodeEntry pointer to distinguish shared function entries. |
273 static CodeEntry* const kSfiCodeEntry; | 273 static CodeEntry* const kSharedFunctionCodeEntry; |
274 | 274 |
275 CodeTree tree_; | 275 CodeTree tree_; |
276 int next_sfi_tag_; | 276 int next_shared_id_; |
277 | 277 |
278 DISALLOW_COPY_AND_ASSIGN(CodeMap); | 278 DISALLOW_COPY_AND_ASSIGN(CodeMap); |
279 }; | 279 }; |
280 | 280 |
281 | 281 |
282 class CpuProfilesCollection { | 282 class CpuProfilesCollection { |
283 public: | 283 public: |
284 CpuProfilesCollection(); | 284 CpuProfilesCollection(); |
285 ~CpuProfilesCollection(); | 285 ~CpuProfilesCollection(); |
286 | 286 |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 }; | 1142 }; |
1143 | 1143 |
1144 | 1144 |
1145 String* GetConstructorNameForHeapProfile(JSObject* object); | 1145 String* GetConstructorNameForHeapProfile(JSObject* object); |
1146 | 1146 |
1147 } } // namespace v8::internal | 1147 } } // namespace v8::internal |
1148 | 1148 |
1149 #endif // ENABLE_LOGGING_AND_PROFILING | 1149 #endif // ENABLE_LOGGING_AND_PROFILING |
1150 | 1150 |
1151 #endif // V8_PROFILE_GENERATOR_H_ | 1151 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |