Commit 373d42a2 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compiler] Push all roots first in ScheduleEarlyVisitor

Rather than pushing each root seperately, then emptying the
queue and pushing the next, instead push all roots together then
work through the queue. This reduces the number of node visits
by around 6x compared to pushing roots seperately.

BUG=v8:9684

Change-Id: I481fc177731f9d2b12e00c2a6d1be06a93429ff2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2854298
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74240}
parent 486925b4
......@@ -1302,11 +1302,12 @@ class ScheduleEarlyNodeVisitor {
void Run(NodeVector* roots) {
for (Node* const root : *roots) {
queue_.push(root);
while (!queue_.empty()) {
scheduler_->tick_counter_->TickAndMaybeEnterSafepoint();
VisitNode(queue_.front());
queue_.pop();
}
}
while (!queue_.empty()) {
scheduler_->tick_counter_->TickAndMaybeEnterSafepoint();
VisitNode(queue_.front());
queue_.pop();
}
}
......
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