Reviewers: Hannes Payer,
Description:
[heap] Remove obsolete was_marked_incrementally field.
[email protected]
Please review this at https://codereview.chromium.org/1273953004/
Base URL:
https://chromium.googlesource.com/v8/v8.git@local_cleanup-incremental-marking-stop
Affected files (+14, -17 lines):
M src/heap/mark-compact.h
M src/heap/mark-compact.cc
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index
73efe887d799009c37045513b6f83778998545db..7c585522803126e23d7e9f6cd990790c9a85195a
100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -45,7 +45,6 @@ MarkCompactCollector::MarkCompactCollector(Heap* heap)
finalize_incremental_marking_(false),
marking_parity_(ODD_MARKING_PARITY),
compacting_(false),
- was_marked_incrementally_(false),
sweeping_in_progress_(false),
pending_sweeper_jobs_semaphore_(0),
evacuation_(false),
@@ -787,7 +786,7 @@ void MarkCompactCollector::AbortCompaction() {
void MarkCompactCollector::Prepare() {
- was_marked_incrementally_ = heap()->incremental_marking()->IsMarking();
+ bool was_marked_incrementally =
heap()->incremental_marking()->IsMarking();
#ifdef DEBUG
DCHECK(state_ == IDLE);
@@ -802,18 +801,18 @@ void MarkCompactCollector::Prepare() {
}
// Clear marking bits if incremental marking is aborted.
- if (was_marked_incrementally_ && abort_incremental_marking_) {
+ if (was_marked_incrementally && abort_incremental_marking_) {
heap()->incremental_marking()->Stop();
ClearMarkbits();
AbortWeakCollections();
AbortWeakCells();
AbortCompaction();
- was_marked_incrementally_ = false;
+ was_marked_incrementally = false;
}
// Don't start compaction if we are in the middle of incremental
// marking cycle. We did not collect any slots.
- if (!FLAG_never_compact && !was_marked_incrementally_) {
+ if (!FLAG_never_compact && !was_marked_incrementally) {
StartCompaction(NON_INCREMENTAL_COMPACTION);
}
@@ -824,7 +823,7 @@ void MarkCompactCollector::Prepare() {
}
#ifdef VERIFY_HEAP
- if (!was_marked_incrementally_ && FLAG_verify_heap) {
+ if (!was_marked_incrementally && FLAG_verify_heap) {
VerifyMarkbitsAreClean();
}
#endif
@@ -2238,16 +2237,16 @@ void MarkCompactCollector::MarkLiveObjects() {
PostponeInterruptsScope postpone(isolate());
IncrementalMarking* incremental_marking = heap_->incremental_marking();
- if (was_marked_incrementally_) {
+ if (incremental_marking->IsMarking()) {
incremental_marking->Finalize();
} else {
- // Abort any pending incremental activities e.g. incremental sweeping.
- incremental_marking->Stop();
if (marking_deque_.in_use()) {
marking_deque_.Uninitialize(true);
}
}
+ DCHECK(incremental_marking->IsStopped());
+
#ifdef DEBUG
DCHECK(state_ == PREPARE_GC);
state_ = MARK_LIVE_OBJECTS;
@@ -3691,7 +3690,7 @@ void
MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
SlotsBuffer::SizeOfChain(migration_slots_buffer_));
}
- if (compacting_ && was_marked_incrementally_) {
+ if (compacting_ && heap()->incremental_marking()->IsMarking()) {
GCTracer::Scope gc_scope(heap()->tracer(),
GCTracer::Scope::MC_RESCAN_LARGE_OBJECTS);
// It's difficult to filter out slots recorded for large objects.
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index
d78e9bddee44b0f2a1b396e49a4bd90f60bd20d7..ea0d5e66e7bd45acf20c000a2cf8e7c108725d7b
100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -778,11 +778,11 @@ class MarkCompactCollector {
CollectorState state_;
#endif
- bool reduce_memory_footprint_;
-
- bool abort_incremental_marking_;
-
- bool finalize_incremental_marking_;
+ // The following flags are controlled via {SetFlags} by the caller, it
has to
+ // be called before {Prepare} to take effect.
+ bool reduce_memory_footprint_; // Heap::kReduceMemoryFootprintMask
+ bool abort_incremental_marking_; //
Heap::kAbortIncrementalMarkingMask
+ bool finalize_incremental_marking_; //
Heap::kFinalizeIncrementalMarkingMask
MarkingParity marking_parity_;
@@ -790,8 +790,6 @@ class MarkCompactCollector {
// candidates.
bool compacting_;
- bool was_marked_incrementally_;
-
// True if concurrent or parallel sweeping is currently in progress.
bool sweeping_in_progress_;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.