| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/profiler/allocation-tracker.h" | 5 #include "src/profiler/allocation-tracker.h" |
| 6 | 6 |
| 7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
| 9 #include "src/profiler/heap-snapshot-generator-inl.h" | 9 #include "src/profiler/heap-snapshot-generator-inl.h" |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 | 188 |
| 189 void AllocationTracker::DeleteFunctionInfo(FunctionInfo** info) { | 189 void AllocationTracker::DeleteFunctionInfo(FunctionInfo** info) { |
| 190 delete *info; | 190 delete *info; |
| 191 } | 191 } |
| 192 | 192 |
| 193 AllocationTracker::AllocationTracker(HeapObjectsMap* ids, StringsStorage* names) | 193 AllocationTracker::AllocationTracker(HeapObjectsMap* ids, StringsStorage* names) |
| 194 : ids_(ids), | 194 : ids_(ids), |
| 195 names_(names), | 195 names_(names), |
| 196 id_to_function_info_index_(base::HashMap::PointersMatch), | 196 id_to_function_info_index_(), |
| 197 info_index_for_other_state_(0) { | 197 info_index_for_other_state_(0) { |
| 198 FunctionInfo* info = new FunctionInfo(); | 198 FunctionInfo* info = new FunctionInfo(); |
| 199 info->name = "(root)"; | 199 info->name = "(root)"; |
| 200 function_info_list_.Add(info); | 200 function_info_list_.Add(info); |
| 201 } | 201 } |
| 202 | 202 |
| 203 | 203 |
| 204 AllocationTracker::~AllocationTracker() { | 204 AllocationTracker::~AllocationTracker() { |
| 205 unresolved_locations_.Iterate(DeleteUnresolvedLocation); | 205 unresolved_locations_.Iterate(DeleteUnresolvedLocation); |
| 206 function_info_list_.Iterate(&DeleteFunctionInfo); | 206 function_info_list_.Iterate(&DeleteFunctionInfo); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 const v8::WeakCallbackInfo<void>& data) { | 327 const v8::WeakCallbackInfo<void>& data) { |
| 328 UnresolvedLocation* loc = | 328 UnresolvedLocation* loc = |
| 329 reinterpret_cast<UnresolvedLocation*>(data.GetParameter()); | 329 reinterpret_cast<UnresolvedLocation*>(data.GetParameter()); |
| 330 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location())); | 330 GlobalHandles::Destroy(reinterpret_cast<Object**>(loc->script_.location())); |
| 331 loc->script_ = Handle<Script>::null(); | 331 loc->script_ = Handle<Script>::null(); |
| 332 } | 332 } |
| 333 | 333 |
| 334 | 334 |
| 335 } // namespace internal | 335 } // namespace internal |
| 336 } // namespace v8 | 336 } // namespace v8 |
| OLD | NEW |