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 100 matching lines...) Loading... |
111 | 111 |
112 | 112 |
113 int HeapEntry::set_children_index(int index) { | 113 int HeapEntry::set_children_index(int index) { |
114 children_index_ = index; | 114 children_index_ = index; |
115 int next_index = index + children_count_; | 115 int next_index = index + children_count_; |
116 children_count_ = 0; | 116 children_count_ = 0; |
117 return next_index; | 117 return next_index; |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 int HeapEntry::set_retainers_index(int index) { | |
122 retainers_index_ = index; | |
123 int next_index = index + retainers_count_; | |
124 retainers_count_ = 0; | |
125 return next_index; | |
126 } | |
127 | |
128 | |
129 HeapGraphEdge** HeapEntry::children_arr() { | 121 HeapGraphEdge** HeapEntry::children_arr() { |
130 ASSERT(children_index_ >= 0); | 122 ASSERT(children_index_ >= 0); |
131 return &snapshot_->children()[children_index_]; | 123 return &snapshot_->children()[children_index_]; |
132 } | 124 } |
133 | 125 |
134 | 126 |
135 HeapGraphEdge** HeapEntry::retainers_arr() { | |
136 ASSERT(retainers_index_ >= 0); | |
137 return &snapshot_->retainers()[retainers_index_]; | |
138 } | |
139 | |
140 | |
141 HeapEntry* HeapEntry::dominator() const { | |
142 ASSERT(dominator_ >= 0); | |
143 return &snapshot_->entries()[dominator_]; | |
144 } | |
145 | |
146 | |
147 SnapshotObjectId HeapObjectsMap::GetNthGcSubrootId(int delta) { | 127 SnapshotObjectId HeapObjectsMap::GetNthGcSubrootId(int delta) { |
148 return kGcRootsFirstSubrootId + delta * kObjectIdStep; | 128 return kGcRootsFirstSubrootId + delta * kObjectIdStep; |
149 } | 129 } |
150 | 130 |
151 | 131 |
152 HeapObject* V8HeapExplorer::GetNthGcSubrootObject(int delta) { | 132 HeapObject* V8HeapExplorer::GetNthGcSubrootObject(int delta) { |
153 return reinterpret_cast<HeapObject*>( | 133 return reinterpret_cast<HeapObject*>( |
154 reinterpret_cast<char*>(kFirstGcSubrootObject) + | 134 reinterpret_cast<char*>(kFirstGcSubrootObject) + |
155 delta * HeapObjectsMap::kObjectIdStep); | 135 delta * HeapObjectsMap::kObjectIdStep); |
156 } | 136 } |
157 | 137 |
158 | 138 |
159 int V8HeapExplorer::GetGcSubrootOrder(HeapObject* subroot) { | 139 int V8HeapExplorer::GetGcSubrootOrder(HeapObject* subroot) { |
160 return static_cast<int>( | 140 return static_cast<int>( |
161 (reinterpret_cast<char*>(subroot) - | 141 (reinterpret_cast<char*>(subroot) - |
162 reinterpret_cast<char*>(kFirstGcSubrootObject)) / | 142 reinterpret_cast<char*>(kFirstGcSubrootObject)) / |
163 HeapObjectsMap::kObjectIdStep); | 143 HeapObjectsMap::kObjectIdStep); |
164 } | 144 } |
165 | 145 |
166 } } // namespace v8::internal | 146 } } // namespace v8::internal |
167 | 147 |
168 #endif // V8_PROFILE_GENERATOR_INL_H_ | 148 #endif // V8_PROFILE_GENERATOR_INL_H_ |
OLD | NEW |