Commit 3bebee41 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Increment MarkCompact epoch right after marking.

Bug: v8:9093
Change-Id: I69aa3edddf5ea52e1cca185fa03f51122cdf02c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617937
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61668}
parent 990084ba
...@@ -853,8 +853,6 @@ void MarkCompactCollector::VerifyMarking() { ...@@ -853,8 +853,6 @@ void MarkCompactCollector::VerifyMarking() {
void MarkCompactCollector::Finish() { void MarkCompactCollector::Finish() {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_FINISH); TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_FINISH);
epoch_++;
#ifdef DEBUG #ifdef DEBUG
heap()->VerifyCountersBeforeConcurrentSweeping(); heap()->VerifyCountersBeforeConcurrentSweeping();
#endif #endif
...@@ -1924,6 +1922,8 @@ void MarkCompactCollector::MarkLiveObjects() { ...@@ -1924,6 +1922,8 @@ void MarkCompactCollector::MarkLiveObjects() {
if (was_marked_incrementally_) { if (was_marked_incrementally_) {
heap()->incremental_marking()->Deactivate(); heap()->incremental_marking()->Deactivate();
} }
epoch_++;
} }
void MarkCompactCollector::ClearNonLiveReferences() { void MarkCompactCollector::ClearNonLiveReferences() {
......
...@@ -909,9 +909,11 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -909,9 +909,11 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
MarkingState marking_state_; MarkingState marking_state_;
NonAtomicMarkingState non_atomic_marking_state_; NonAtomicMarkingState non_atomic_marking_state_;
// Counts the number of mark-compact collections. This is used for marking // Counts the number of major mark-compact collections. The counter is
// descriptor arrays. See NumberOfMarkedDescriptors. Only lower two bits are // incremented right after marking. This is used for:
// used, so it is okay if this counter overflows and wraps around. // - marking descriptor arrays. See NumberOfMarkedDescriptors. Only the lower
// two bits are used, so it is okay if this counter overflows and wraps
// around.
unsigned epoch_ = 0; unsigned epoch_ = 0;
friend class FullEvacuator; friend class FullEvacuator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment