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

Unified Diff: src/heap/spaces.h

Issue 1465223009: [heap] pause observers during mark-compact (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use a scope for pausing/resuming inline allocation observers Created 5 years 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.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 5e473426028dc6dc3d21b931013781471a051836..94ab4dc513e1bb296ccd7d5bb05daa8b661345b7 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -2755,9 +2755,6 @@ class NewSpace : public Space {
// Removes a previously installed observer.
void RemoveInlineAllocationObserver(InlineAllocationObserver* observer);
- void PauseInlineAllocationObservers();
- void ResumeInlineAllocationObservers();
-
void DisableInlineAllocationSteps() {
top_on_previous_step_ = 0;
UpdateInlineAllocationLimit(0);
@@ -2879,10 +2876,28 @@ class NewSpace : public Space {
size_t size);
intptr_t GetNextInlineAllocationStepSize();
void StartNextInlineAllocationStep();
+ void PauseInlineAllocationObservers();
+ void ResumeInlineAllocationObservers();
+ friend class PauseInlineAllocationObserversScope;
friend class SemiSpaceIterator;
};
+class PauseInlineAllocationObserversScope {
+ public:
+ explicit PauseInlineAllocationObserversScope(NewSpace* new_space)
+ : new_space_(new_space) {
+ new_space_->PauseInlineAllocationObservers();
+ }
+ ~PauseInlineAllocationObserversScope() {
+ new_space_->ResumeInlineAllocationObservers();
+ }
+
+ private:
+ NewSpace* new_space_;
+ DISALLOW_COPY_AND_ASSIGN(PauseInlineAllocationObserversScope);
+};
+
// -----------------------------------------------------------------------------
// Compaction space that is used temporarily during compaction.
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698