Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/heap/incremental-marking.h

Issue 2862563002: [heap] Pause black allocation during GCs (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698