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

Side by Side Diff: src/heap-profiler.cc

Issue 177983003: [Heap profiler] Add construction stack trace to heap object (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 6 years, 9 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
« no previous file with comments | « src/allocation-tracker.cc ('k') | src/heap-snapshot-generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009-2010 the V8 project authors. All rights reserved. 1 // Copyright 2009-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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 162
163 SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Object> obj) { 163 SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Object> obj) {
164 if (!obj->IsHeapObject()) 164 if (!obj->IsHeapObject())
165 return v8::HeapProfiler::kUnknownObjectId; 165 return v8::HeapProfiler::kUnknownObjectId;
166 return ids_->FindEntry(HeapObject::cast(*obj)->address()); 166 return ids_->FindEntry(HeapObject::cast(*obj)->address());
167 } 167 }
168 168
169 169
170 void HeapProfiler::ObjectMoveEvent(Address from, Address to, int size) { 170 void HeapProfiler::ObjectMoveEvent(Address from, Address to, int size) {
171 ids_->MoveObject(from, to, size); 171 bool known_object = ids_->MoveObject(from, to, size);
172 if (!known_object && !allocation_tracker_.is_empty()) {
173 allocation_tracker_->address_to_trace()->MoveObject(from, to, size);
174 }
172 } 175 }
173 176
174 177
175 void HeapProfiler::AllocationEvent(Address addr, int size) { 178 void HeapProfiler::AllocationEvent(Address addr, int size) {
176 DisallowHeapAllocation no_allocation; 179 DisallowHeapAllocation no_allocation;
177 if (!allocation_tracker_.is_empty()) { 180 if (!allocation_tracker_.is_empty()) {
178 allocation_tracker_->AllocationEvent(addr, size); 181 allocation_tracker_->AllocationEvent(addr, size);
179 } 182 }
180 } 183 }
181 184
(...skipping 30 matching lines...) Expand all
212 } 215 }
213 216
214 217
215 void HeapProfiler::ClearHeapObjectMap() { 218 void HeapProfiler::ClearHeapObjectMap() {
216 ids_.Reset(new HeapObjectsMap(heap())); 219 ids_.Reset(new HeapObjectsMap(heap()));
217 if (!is_tracking_allocations()) is_tracking_object_moves_ = false; 220 if (!is_tracking_allocations()) is_tracking_object_moves_ = false;
218 } 221 }
219 222
220 223
221 } } // namespace v8::internal 224 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/allocation-tracker.cc ('k') | src/heap-snapshot-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698