Chromium Code Reviews| Index: src/mark-compact.h |
| diff --git a/src/mark-compact.h b/src/mark-compact.h |
| index b5d60fd41e80f81f5395dff0ee0f665dc161c8d2..f349bb3d7ac61fc1e7aa55f3e2b2ebca04b7c3d8 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 SweepingScope BASE_EMBEDDED { |
|
Michael Starzinger
2013/03/05 17:20:11
Naming this "SequentialSweepingScope" would be mor
Hannes Payer (out of office)
2013/03/05 17:27:04
Done.
|
| + public: |
| + explicit SweepingScope(MarkCompactCollector *collector) : |
| + collector_(collector) { |
| + collector_->set_sequential_sweeping(true); |
| + } |
| + |
| + ~SweepingScope() { |
| + collector_->set_sequential_sweeping(false); |
| + } |
| + |
| + private: |
| + MarkCompactCollector* collector_; |
| +}; |
| + |
| + |
| const char* AllocationSpaceName(AllocationSpace space); |
| } } // namespace v8::internal |