| Index: src/heap-snapshot-generator.cc
|
| diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
|
| index 1c8a7b3dc4d7a3bb93cee7dce1d5ab68eae4c248..4cbbbf958dd082143fb28c890d1ce8c6c53e008b 100644
|
| --- a/src/heap-snapshot-generator.cc
|
| +++ b/src/heap-snapshot-generator.cc
|
| @@ -729,10 +729,11 @@ HeapObject* const V8HeapExplorer::kLastGcSubrootObject =
|
|
|
|
|
| V8HeapExplorer::V8HeapExplorer(
|
| + Heap* heap,
|
| HeapSnapshot* snapshot,
|
| SnapshottingProgressReportingInterface* progress,
|
| v8::HeapProfiler::ObjectNameResolver* resolver)
|
| - : heap_(Isolate::Current()->heap()),
|
| + : heap_(heap),
|
| snapshot_(snapshot),
|
| collection_(snapshot_->collection()),
|
| progress_(progress),
|
| @@ -1852,7 +1853,7 @@ class GlobalObjectsEnumerator : public ObjectVisitor {
|
|
|
| // Modifies heap. Must not be run during heap traversal.
|
| void V8HeapExplorer::TagGlobalObjects() {
|
| - Isolate* isolate = Isolate::Current();
|
| + Isolate* isolate = heap_->isolate();
|
| HandleScope scope(isolate);
|
| GlobalObjectsEnumerator enumerator;
|
| isolate->global_handles()->IterateAllRoots(&enumerator);
|
| @@ -1927,8 +1928,11 @@ HeapEntry* BasicHeapEntriesAllocator::AllocateEntry(HeapThing ptr) {
|
|
|
|
|
| NativeObjectsExplorer::NativeObjectsExplorer(
|
| - HeapSnapshot* snapshot, SnapshottingProgressReportingInterface* progress)
|
| - : snapshot_(snapshot),
|
| + Isolate* isolate,
|
| + HeapSnapshot* snapshot,
|
| + SnapshottingProgressReportingInterface* progress)
|
| + : isolate_(isolate),
|
| + snapshot_(snapshot),
|
| collection_(snapshot_->collection()),
|
| progress_(progress),
|
| embedder_queried_(false),
|
| @@ -1973,7 +1977,7 @@ int NativeObjectsExplorer::EstimateObjectsCount() {
|
|
|
| void NativeObjectsExplorer::FillRetainedObjects() {
|
| if (embedder_queried_) return;
|
| - Isolate* isolate = Isolate::Current();
|
| + Isolate* isolate = isolate_;
|
| const GCType major_gc_type = kGCTypeMarkSweepCompact;
|
| // Record objects that are joined into ObjectGroups.
|
| isolate->heap()->CallGCPrologueCallbacks(
|
| @@ -2000,7 +2004,7 @@ void NativeObjectsExplorer::FillRetainedObjects() {
|
|
|
|
|
| void NativeObjectsExplorer::FillImplicitReferences() {
|
| - Isolate* isolate = Isolate::Current();
|
| + Isolate* isolate = isolate_;
|
| List<ImplicitRefGroup*>* groups =
|
| isolate->global_handles()->implicit_ref_groups();
|
| for (int i = 0; i < groups->length(); ++i) {
|
| @@ -2157,7 +2161,7 @@ void NativeObjectsExplorer::SetRootNativeRootsReference() {
|
|
|
| void NativeObjectsExplorer::VisitSubtreeWrapper(Object** p, uint16_t class_id) {
|
| if (in_groups_.Contains(*p)) return;
|
| - Isolate* isolate = Isolate::Current();
|
| + Isolate* isolate = isolate_;
|
| v8::RetainedObjectInfo* info =
|
| isolate->heap_profiler()->ExecuteWrapperClassCallback(class_id, p);
|
| if (info == NULL) return;
|
| @@ -2230,8 +2234,8 @@ HeapSnapshotGenerator::HeapSnapshotGenerator(
|
| Heap* heap)
|
| : snapshot_(snapshot),
|
| control_(control),
|
| - v8_heap_explorer_(snapshot_, this, resolver),
|
| - dom_explorer_(snapshot_, this),
|
| + v8_heap_explorer_(heap, snapshot_, this, resolver),
|
| + dom_explorer_(heap->isolate(), snapshot_, this),
|
| heap_(heap) {
|
| }
|
|
|
| @@ -2243,15 +2247,15 @@ bool HeapSnapshotGenerator::GenerateSnapshot() {
|
| // full GC is reachable from the root when computing dominators.
|
| // This is not true for weakly reachable objects.
|
| // As a temporary solution we call GC twice.
|
| - Isolate::Current()->heap()->CollectAllGarbage(
|
| + heap_->CollectAllGarbage(
|
| Heap::kMakeHeapIterableMask,
|
| "HeapSnapshotGenerator::GenerateSnapshot");
|
| - Isolate::Current()->heap()->CollectAllGarbage(
|
| + heap_->CollectAllGarbage(
|
| Heap::kMakeHeapIterableMask,
|
| "HeapSnapshotGenerator::GenerateSnapshot");
|
|
|
| #ifdef VERIFY_HEAP
|
| - Heap* debug_heap = Isolate::Current()->heap();
|
| + Heap* debug_heap = heap_;
|
| CHECK(!debug_heap->old_data_space()->was_swept_conservatively());
|
| CHECK(!debug_heap->old_pointer_space()->was_swept_conservatively());
|
| CHECK(!debug_heap->code_space()->was_swept_conservatively());
|
|
|