Commit 1fc43aa8 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[global-handles] Remove parallelization for minor MC

Reworking and adding a node type would require also adding
parallelization support for minor mc. Since this is unused and not
benchmarked right now, just remove it.

Bug: chromium:923361
Change-Id: Iaf67a743d76d2b37ffff9961b510bfd8a1bd15ff
Reviewed-on: https://chromium-review.googlesource.com/c/1425900
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58993}
parent 62938a98
......@@ -715,22 +715,6 @@ void GlobalHandles::IterateNewSpaceStrongAndDependentRoots(RootVisitor* v) {
}
}
void GlobalHandles::IterateNewSpaceStrongAndDependentRootsAndIdentifyUnmodified(
RootVisitor* v, size_t start, size_t end) {
for (size_t i = start; i < end; ++i) {
Node* node = new_space_nodes_[i];
if (node->IsWeak() && !JSObject::IsUnmodifiedApiObject(node->location())) {
node->set_active(true);
}
if (node->IsStrongRetainer() ||
(node->IsWeakRetainer() && !node->is_independent() &&
node->is_active())) {
v->VisitRootPointer(Root::kGlobalHandles, node->label(),
node->location());
}
}
}
void GlobalHandles::IdentifyWeakUnmodifiedObjects(
WeakSlotCallback is_unmodified) {
for (Node* node : new_space_nodes_) {
......@@ -1007,18 +991,6 @@ void GlobalHandles::IterateAllNewSpaceRoots(RootVisitor* v) {
}
}
DISABLE_CFI_PERF
void GlobalHandles::IterateNewSpaceRoots(RootVisitor* v, size_t start,
size_t end) {
for (size_t i = start; i < end; ++i) {
Node* node = new_space_nodes_[i];
if (node->IsRetainer()) {
v->VisitRootPointer(Root::kGlobalHandles, node->label(),
node->location());
}
}
}
DISABLE_CFI_PERF
void GlobalHandles::ApplyPersistentHandleVisitor(
v8::PersistentHandleVisitor* visitor, GlobalHandles::Node* node) {
......
......@@ -102,7 +102,6 @@ class GlobalHandles final {
void IterateAllRoots(RootVisitor* v);
void IterateAllNewSpaceRoots(RootVisitor* v);
void IterateNewSpaceRoots(RootVisitor* v, size_t start, size_t end);
// Iterates over all handles that have embedder-assigned class ID.
void IterateAllRootsWithClassIds(v8::PersistentHandleVisitor* v);
......@@ -132,11 +131,6 @@ class GlobalHandles final {
// Iterates over strong and dependent handles. See the note above.
void IterateNewSpaceStrongAndDependentRoots(RootVisitor* v);
// Iterates over strong and dependent handles. See the note above.
// Also marks unmodified nodes in the same iteration.
void IterateNewSpaceStrongAndDependentRootsAndIdentifyUnmodified(
RootVisitor* v, size_t start, size_t end);
// Marks weak unmodified handles satisfying |is_dead| as pending.
void MarkNewSpaceWeakUnmodifiedObjectsPending(
WeakSlotCallbackWithHeap is_dead);
......@@ -155,7 +149,6 @@ class GlobalHandles final {
// Number of global handles.
size_t handles_count() const { return handles_count_; }
size_t new_space_handles_count() const { return new_space_nodes_.size(); }
size_t GetAndResetGlobalHandleResetCount() {
size_t old = number_of_phantom_handle_resets_;
......
......@@ -3882,13 +3882,11 @@ void Heap::IterateStrongRoots(RootVisitor* v, VisitMode mode) {
isolate_->global_handles()->IterateStrongRoots(v);
break;
case VISIT_ALL_IN_SCAVENGE:
isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
break;
case VISIT_ALL_IN_MINOR_MC_MARK:
// Global handles are processed manually by the minor MC.
isolate_->global_handles()->IterateNewSpaceStrongAndDependentRoots(v);
break;
case VISIT_ALL_IN_MINOR_MC_UPDATE:
// Global handles are processed manually by the minor MC.
isolate_->global_handles()->IterateAllNewSpaceRoots(v);
break;
case VISIT_ALL_IN_SWEEP_NEWSPACE:
case VISIT_ALL:
......
......@@ -3358,26 +3358,6 @@ UpdatingItem* MarkCompactCollector::CreateRememberedSetUpdatingItem(
heap(), non_atomic_marking_state(), chunk, updating_mode);
}
class GlobalHandlesUpdatingItem : public UpdatingItem {
public:
GlobalHandlesUpdatingItem(GlobalHandles* global_handles, size_t start,
size_t end)
: global_handles_(global_handles), start_(start), end_(end) {}
~GlobalHandlesUpdatingItem() override = default;
void Process() override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"GlobalHandlesUpdatingItem::Process");
PointersUpdatingVisitor updating_visitor;
global_handles_->IterateNewSpaceRoots(&updating_visitor, start_, end_);
}
private:
GlobalHandles* global_handles_;
size_t start_;
size_t end_;
};
// Update array buffers on a page that has been evacuated by copying objects.
// Target page exclusivity in old space is guaranteed by the fact that
// evacuation tasks either (a) retrieved a fresh page, or (b) retrieved all
......@@ -3872,19 +3852,6 @@ class YoungGenerationEvacuationVerifier : public EvacuationVerifier {
#endif // VERIFY_HEAP
template <class ParallelItem>
void SeedGlobalHandles(GlobalHandles* global_handles, ItemParallelJob* job) {
// Create batches of global handles.
const size_t kGlobalHandlesBufferSize = 1000;
const size_t new_space_nodes = global_handles->new_space_handles_count();
for (size_t start = 0; start < new_space_nodes;
start += kGlobalHandlesBufferSize) {
size_t end = start + kGlobalHandlesBufferSize;
if (end > new_space_nodes) end = new_space_nodes;
job->AddItem(new ParallelItem(global_handles, start, end));
}
}
bool IsUnmarkedObjectForYoungGeneration(Heap* heap, FullObjectSlot p) {
DCHECK_IMPLIES(Heap::InNewSpace(*p), Heap::InToSpace(*p));
return Heap::InNewSpace(*p) && !heap->minor_mark_compact_collector()
......@@ -4071,8 +4038,6 @@ void MinorMarkCompactCollector::UpdatePointersAfterEvacuation() {
CollectNewSpaceArrayBufferTrackerItems(&updating_job);
// Create batches of global handles.
SeedGlobalHandles<GlobalHandlesUpdatingItem>(isolate()->global_handles(),
&updating_job);
const int to_space_tasks = CollectToSpaceUpdatingItems(&updating_job);
int remembered_set_pages = 0;
remembered_set_pages += CollectRememberedSetUpdatingItems(
......@@ -4369,7 +4334,6 @@ UpdatingItem* MinorMarkCompactCollector::CreateRememberedSetUpdatingItem(
}
class MarkingItem;
class GlobalHandlesMarkingItem;
class PageMarkingItem;
class RootMarkingItem;
class YoungGenerationMarkingTask;
......@@ -4522,51 +4486,6 @@ class PageMarkingItem : public MarkingItem {
int slots_;
};
class GlobalHandlesMarkingItem : public MarkingItem {
public:
GlobalHandlesMarkingItem(GlobalHandles* global_handles, size_t start,
size_t end)
: global_handles_(global_handles), start_(start), end_(end) {}
~GlobalHandlesMarkingItem() override = default;
void Process(YoungGenerationMarkingTask* task) override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"GlobalHandlesMarkingItem::Process");
GlobalHandlesRootMarkingVisitor visitor(task);
global_handles_
->IterateNewSpaceStrongAndDependentRootsAndIdentifyUnmodified(
&visitor, start_, end_);
}
private:
class GlobalHandlesRootMarkingVisitor : public RootVisitor {
public:
explicit GlobalHandlesRootMarkingVisitor(YoungGenerationMarkingTask* task)
: task_(task) {}
void VisitRootPointer(Root root, const char* description,
FullObjectSlot p) override {
DCHECK_EQ(Root::kGlobalHandles, root);
task_->MarkObject(*p);
}
void VisitRootPointers(Root root, const char* description,
FullObjectSlot start, FullObjectSlot end) override {
DCHECK_EQ(Root::kGlobalHandles, root);
for (FullObjectSlot p = start; p < end; ++p) {
task_->MarkObject(*p);
}
}
private:
YoungGenerationMarkingTask* task_;
};
GlobalHandles* global_handles_;
size_t start_;
size_t end_;
};
void MinorMarkCompactCollector::MarkRootSetInParallel(
RootMarkingVisitor* root_visitor) {
std::atomic<int> slots;
......@@ -4577,10 +4496,9 @@ void MinorMarkCompactCollector::MarkRootSetInParallel(
// Seed the root set (roots + old->new set).
{
TRACE_GC(heap()->tracer(), GCTracer::Scope::MINOR_MC_MARK_SEED);
isolate()->global_handles()->IdentifyWeakUnmodifiedObjects(
&JSObject::IsUnmodifiedApiObject);
heap()->IterateRoots(root_visitor, VISIT_ALL_IN_MINOR_MC_MARK);
// Create batches of global handles.
SeedGlobalHandles<GlobalHandlesMarkingItem>(isolate()->global_handles(),
&job);
// Create items for each page.
RememberedSet<OLD_TO_NEW>::IterateMemoryChunks(
heap(), [&job, &slots](MemoryChunk* chunk) {
......
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