Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index 9b0198f82578e25064fa94207604ae14537188c7..1656424c934743e10474d3b9096d1be18aa5a854 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -53,10 +53,10 @@ struct Heap::StrongRootsList { |
| StrongRootsList* next; |
| }; |
| -class IdleScavengeObserver : public InlineAllocationObserver { |
| +class IdleScavengeObserver : public AllocationObserver { |
| public: |
| IdleScavengeObserver(Heap& heap, intptr_t step_size) |
| - : InlineAllocationObserver(step_size), heap_(heap) {} |
| + : AllocationObserver(step_size), heap_(heap) {} |
| void Step(int bytes_allocated, Address, size_t) override { |
| heap_.ScheduleIdleScavengeIfNeeded(bytes_allocated); |
| @@ -1420,7 +1420,11 @@ void Heap::CallGCEpilogueCallbacks(GCType gc_type, |
| void Heap::MarkCompact() { |
| - PauseInlineAllocationObserversScope pause_observers(new_space()); |
| + PauseAllocationObserversScope pause_new_observers(new_space()); |
| + PauseAllocationObserversScope pause_old_observers(old_space()); |
| + PauseAllocationObserversScope pause_code_observers(code_space()); |
| + PauseAllocationObserversScope pause_map_observers(map_space()); |
| + PauseAllocationObserversScope pause_lo_observers(lo_space()); |
|
ofrobots
2016/01/26 00:38:25
This is just begging to be refactored :).
Maybe k
mattloring
2016/01/30 00:38:03
Refactored to pause/unpause all spaces together.
|
| gc_state_ = MARK_COMPACT; |
| LOG(isolate_, ResourceEvent("markcompact", "begin")); |
| @@ -1627,7 +1631,11 @@ void Heap::Scavenge() { |
| // Bump-pointer allocations done during scavenge are not real allocations. |
| // Pause the inline allocation steps. |
| - PauseInlineAllocationObserversScope pause_observers(new_space()); |
| + PauseAllocationObserversScope pause_new_observers(new_space()); |
| + PauseAllocationObserversScope pause_old_observers(old_space()); |
| + PauseAllocationObserversScope pause_code_observers(code_space()); |
| + PauseAllocationObserversScope pause_map_observers(map_space()); |
| + PauseAllocationObserversScope pause_lo_observers(lo_space()); |
| #ifdef VERIFY_HEAP |
| if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); |
| @@ -5169,7 +5177,7 @@ bool Heap::SetUp() { |
| idle_scavenge_observer_ = new IdleScavengeObserver( |
| *this, ScavengeJob::kBytesAllocatedBeforeNextIdleTask); |
| - new_space()->AddInlineAllocationObserver(idle_scavenge_observer_); |
| + new_space()->AddAllocationObserver(idle_scavenge_observer_); |
| return true; |
| } |
| @@ -5269,7 +5277,7 @@ void Heap::TearDown() { |
| PrintAlloctionsHash(); |
| } |
| - new_space()->RemoveInlineAllocationObserver(idle_scavenge_observer_); |
| + new_space()->RemoveAllocationObserver(idle_scavenge_observer_); |
| delete idle_scavenge_observer_; |
| idle_scavenge_observer_ = nullptr; |