Commit fc0c8f84 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compiler] In ast-numbering add literal to eager_literals before recursing.

Add the function literal to eager_literals before recursing into the literal.
This ensures that the order of eager_literals reflects the order in which
the functions will be called, which in-turn ensures it is compiled first
by the compiler-dispatcher.

BUG=v8:5203

Change-Id: I0e334a7d1ee93cf67936adbadd2883e40acb1cc5
Reviewed-on: https://chromium-review.googlesource.com/441825Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43192}
parent 95d6ec82
......@@ -636,16 +636,17 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
IncrementNodeCount();
node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
if (node->ShouldEagerCompile()) {
if (eager_literals_) {
eager_literals_->Add(new (zone())
ThreadedListZoneEntry<FunctionLiteral*>(node));
}
// If the function literal is being eagerly compiled, recurse into the
// declarations and body of the function literal.
if (!AstNumbering::Renumber(stack_limit_, zone_, node, eager_literals_)) {
SetStackOverflow();
return;
}
if (eager_literals_) {
eager_literals_->Add(new (zone())
ThreadedListZoneEntry<FunctionLiteral*>(node));
}
}
ReserveFeedbackSlots(node);
}
......
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