Index: src/mark-compact.h |
diff --git a/src/mark-compact.h b/src/mark-compact.h |
index b5d60fd41e80f81f5395dff0ee0f665dc161c8d2..1c508fe2a8fea191a6b8de047c396a1aab7e9596 100644 |
--- a/src/mark-compact.h |
+++ b/src/mark-compact.h |
@@ -698,6 +698,14 @@ class MarkCompactCollector { |
void FinalizeSweeping(); |
+ void set_sequential_sweeping(bool sequential_sweeping) { |
+ sequential_sweeping_ = sequential_sweeping; |
+ } |
+ |
+ bool sequential_sweeping() const { |
+ return sequential_sweeping_; |
+ } |
+ |
// Parallel marking support. |
void MarkInParallel(); |
@@ -749,6 +757,8 @@ class MarkCompactCollector { |
// True if concurrent or parallel sweeping is currently in progress. |
bool sweeping_pending_; |
+ bool sequential_sweeping_; |
+ |
// A pointer to the current stack-allocated GC tracer object during a full |
// collection (NULL before and after). |
GCTracer* tracer_; |
@@ -904,6 +914,22 @@ class MarkCompactCollector { |
}; |
+class SequentialSweepingScope BASE_EMBEDDED { |
+ public: |
+ explicit SequentialSweepingScope(MarkCompactCollector *collector) : |
+ collector_(collector) { |
+ collector_->set_sequential_sweeping(true); |
+ } |
+ |
+ ~SequentialSweepingScope() { |
+ collector_->set_sequential_sweeping(false); |
+ } |
+ |
+ private: |
+ MarkCompactCollector* collector_; |
+}; |
+ |
+ |
const char* AllocationSpaceName(AllocationSpace space); |
} } // namespace v8::internal |