Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 8487857923d9fb0fc17f1fd7ab7fc91cc96bb446..524218d602c0d00c4244d7a9e7bdf290c5e43c71 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -7239,12 +7239,12 @@ class HeapObjectsFilter { |
class UnreachableObjectsFilter : public HeapObjectsFilter { |
public: |
- UnreachableObjectsFilter() { |
+ explicit UnreachableObjectsFilter(Heap* heap) : heap_(heap) { |
MarkReachableObjects(); |
} |
~UnreachableObjectsFilter() { |
- Isolate::Current()->heap()->mark_compact_collector()->ClearMarkbits(); |
+ heap_->mark_compact_collector()->ClearMarkbits(); |
} |
bool SkipObject(HeapObject* object) { |
@@ -7281,12 +7281,12 @@ class UnreachableObjectsFilter : public HeapObjectsFilter { |
}; |
void MarkReachableObjects() { |
- Heap* heap = Isolate::Current()->heap(); |
MarkingVisitor visitor; |
- heap->IterateRoots(&visitor, VISIT_ALL); |
+ heap_->IterateRoots(&visitor, VISIT_ALL); |
visitor.TransitiveClosure(); |
} |
+ Heap* heap_; |
DisallowHeapAllocation no_allocation_; |
}; |
@@ -7318,7 +7318,7 @@ void HeapIterator::Init() { |
space_iterator_ = new SpaceIterator(heap_); |
switch (filtering_) { |
case kFilterUnreachable: |
- filter_ = new UnreachableObjectsFilter; |
+ filter_ = new UnreachableObjectsFilter(heap_); |
break; |
default: |
break; |
@@ -7863,9 +7863,9 @@ void Heap::GarbageCollectionGreedyCheck() { |
#endif |
-TranscendentalCache::SubCache::SubCache(Type t) |
+TranscendentalCache::SubCache::SubCache(Isolate* isolate, Type t) |
: type_(t), |
- isolate_(Isolate::Current()) { |
+ isolate_(isolate) { |
uint32_t in0 = 0xffffffffu; // Bit-pattern for a NaN that isn't |
uint32_t in1 = 0xffffffffu; // generated by the FPU. |
for (int i = 0; i < kCacheSize; i++) { |