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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 class ProfileNode { | 58 class ProfileNode { |
59 public: | 59 public: |
60 INLINE(explicit ProfileNode(CodeEntry* entry)); | 60 INLINE(explicit ProfileNode(CodeEntry* entry)); |
61 | 61 |
62 ProfileNode* FindChild(CodeEntry* entry); | 62 ProfileNode* FindChild(CodeEntry* entry); |
63 ProfileNode* FindOrAddChild(CodeEntry* entry); | 63 ProfileNode* FindOrAddChild(CodeEntry* entry); |
64 INLINE(void IncrementSelfTicks()) { ++self_ticks_; } | 64 INLINE(void IncrementSelfTicks()) { ++self_ticks_; } |
65 INLINE(void IncreaseTotalTicks(unsigned amount)) { total_ticks_ += amount; } | 65 INLINE(void IncreaseTotalTicks(unsigned amount)) { total_ticks_ += amount; } |
66 | 66 |
67 INLINE(CodeEntry* entry()) { return entry_; } | 67 INLINE(CodeEntry* entry() const) { return entry_; } |
68 INLINE(unsigned total_ticks()) { return total_ticks_; } | 68 INLINE(unsigned total_ticks() const) { return total_ticks_; } |
69 INLINE(unsigned self_ticks()) { return self_ticks_; } | 69 INLINE(unsigned self_ticks() const) { return self_ticks_; } |
| 70 void GetChildren(List<ProfileNode*>* children); |
70 | 71 |
71 void Print(int indent); | 72 void Print(int indent); |
72 | 73 |
73 private: | 74 private: |
74 INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) { | 75 INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) { |
75 return entry1 == entry2; | 76 return entry1 == entry2; |
76 } | 77 } |
77 | 78 |
78 INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) { | 79 INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) { |
79 return static_cast<int32_t>(reinterpret_cast<intptr_t>(entry)); | 80 return static_cast<int32_t>(reinterpret_cast<intptr_t>(entry)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 CpuProfilesCollection* profiles_; | 238 CpuProfilesCollection* profiles_; |
238 CodeMap code_map_; | 239 CodeMap code_map_; |
239 | 240 |
240 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 241 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
241 }; | 242 }; |
242 | 243 |
243 | 244 |
244 } } // namespace v8::internal | 245 } } // namespace v8::internal |
245 | 246 |
246 #endif // V8_PROFILE_GENERATOR_H_ | 247 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |