Commit b34e5b42 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Don't iterate the stack when starting or incrementally finalizing incremental marking.

Change-Id: I6eb3c9c6ff25a58b2c7d0d233926514606e7ff5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1995395
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65807}
parent e209e348
......@@ -790,6 +790,7 @@ enum VisitMode {
VISIT_ALL_IN_SCAVENGE,
VISIT_ALL_IN_SWEEP_NEWSPACE,
VISIT_ONLY_STRONG,
VISIT_ONLY_STRONG_IGNORE_STACK,
VISIT_FOR_SERIALIZATION,
};
......
......@@ -17,6 +17,7 @@
#include "src/builtins/accessors.h"
#include "src/codegen/assembler-inl.h"
#include "src/codegen/compilation-cache.h"
#include "src/common/globals.h"
#include "src/debug/debug.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/execution/microtask-queue.h"
......@@ -4361,8 +4362,10 @@ void Heap::IterateStrongRoots(RootVisitor* v, VisitMode mode) {
isolate_->bootstrapper()->Iterate(v);
v->Synchronize(VisitorSynchronization::kBootstrapper);
isolate_->Iterate(v);
v->Synchronize(VisitorSynchronization::kTop);
if (mode != VISIT_ONLY_STRONG_IGNORE_STACK) {
isolate_->Iterate(v);
v->Synchronize(VisitorSynchronization::kTop);
}
Relocatable::Iterate(isolate_, v);
v->Synchronize(VisitorSynchronization::kRelocatable);
isolate_->debug()->Iterate(v);
......@@ -4393,6 +4396,7 @@ void Heap::IterateStrongRoots(RootVisitor* v, VisitMode mode) {
// global handles need to be added manually.
break;
case VISIT_ONLY_STRONG:
case VISIT_ONLY_STRONG_IGNORE_STACK:
isolate_->global_handles()->IterateStrongRoots(v);
break;
case VISIT_ALL_IN_SCAVENGE:
......
......@@ -336,9 +336,7 @@ void IncrementalMarking::StartMarking() {
StartBlackAllocation();
// Mark strong roots grey.
IncrementalMarkingRootMarkingVisitor visitor(this);
heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG);
MarkRoots();
if (FLAG_concurrent_marking && !heap_->IsTearingDown()) {
heap_->concurrent_marking()->ScheduleTasks();
......@@ -413,7 +411,7 @@ void IncrementalMarking::MarkRoots() {
DCHECK(IsMarking());
IncrementalMarkingRootMarkingVisitor visitor(this);
heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG);
heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG_IGNORE_STACK);
}
bool IncrementalMarking::ShouldRetainMap(Map map, int age) {
......
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