| Index: src/profile-generator.cc
|
| ===================================================================
|
| --- src/profile-generator.cc (revision 9618)
|
| +++ src/profile-generator.cc (working copy)
|
| @@ -983,6 +983,11 @@
|
| }
|
|
|
|
|
| +Handle<HeapObject> HeapEntry::GetHeapObject() {
|
| + return snapshot_->collection()->FindHeapObjectById(id());
|
| +}
|
| +
|
| +
|
| template<class Visitor>
|
| void HeapEntry::ApplyAndPaintAllReachable(Visitor* visitor) {
|
| List<HeapEntry*> list(10);
|
| @@ -1343,8 +1348,8 @@
|
|
|
|
|
| void HeapObjectsMap::SnapshotGenerationFinished() {
|
| - initial_fill_mode_ = false;
|
| - RemoveDeadEntries();
|
| + initial_fill_mode_ = false;
|
| + RemoveDeadEntries();
|
| }
|
|
|
|
|
| @@ -1490,6 +1495,24 @@
|
| }
|
|
|
|
|
| +Handle<HeapObject> HeapSnapshotsCollection::FindHeapObjectById(uint64_t id) {
|
| + AssertNoAllocation no_allocation;
|
| + HeapObject* object = NULL;
|
| + HeapIterator iterator(HeapIterator::kFilterUnreachable);
|
| + // Make sure that object with the given id is still reachable.
|
| + for (HeapObject* obj = iterator.next();
|
| + obj != NULL;
|
| + obj = iterator.next()) {
|
| + if (ids_.FindObject(obj->address()) == id) {
|
| + ASSERT(object == NULL);
|
| + object = obj;
|
| + // Can't break -- kFilterUnreachable requires full heap traversal.
|
| + }
|
| + }
|
| + return object != NULL ? Handle<HeapObject>(object) : Handle<HeapObject>();
|
| +}
|
| +
|
| +
|
| HeapEntry *const HeapEntriesMap::kHeapEntryPlaceholder =
|
| reinterpret_cast<HeapEntry*>(1);
|
|
|
|
|