Index: src/heap/incremental-marking.h |
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h |
index 200fbf39c48a8114bc3faf271e90a232ab8ee930..c777693d6341942fb4bcfbdc80c2b2e3c1264266 100644 |
--- a/src/heap/incremental-marking.h |
+++ b/src/heap/incremental-marking.h |
@@ -32,6 +32,27 @@ class V8_EXPORT_PRIVATE IncrementalMarking { |
enum GCRequestType { NONE, COMPLETE_MARKING, FINALIZATION }; |
+ class PauseBlackAllocationScope { |
+ public: |
+ explicit PauseBlackAllocationScope(IncrementalMarking* marking) |
+ : marking_(marking), paused_(false) { |
+ if (marking_->black_allocation()) { |
+ paused_ = true; |
+ marking_->PauseBlackAllocation(); |
+ } |
+ } |
+ |
+ ~PauseBlackAllocationScope() { |
+ if (paused_) { |
+ marking_->StartBlackAllocation(); |
+ } |
+ } |
+ |
+ private: |
+ IncrementalMarking* marking_; |
+ bool paused_; |
+ }; |
+ |
static void Initialize(); |
explicit IncrementalMarking(Heap* heap); |
@@ -254,6 +275,7 @@ class V8_EXPORT_PRIVATE IncrementalMarking { |
void StartMarking(); |
void StartBlackAllocation(); |
+ void PauseBlackAllocation(); |
void FinishBlackAllocation(); |
void MarkRoots(); |