Fix a just-introduced bug in polymorphic inlining.

When inlining a polymorphic variant, the inlined function indicates we
should bailout of the entire compilation by setting the stack overflow flag
on the visitor.  We need to check this flag and bailout if a call to
TryInline succeeds and it is not in tail position in a graph builder
function.

R=fschneider@chromium.org

Review URL: http://codereview.chromium.org/6840012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6b12b41f
......@@ -3961,7 +3961,11 @@ void HGraphBuilder::HandlePolymorphicCallNamed(Call* expr,
PrintF("Trying to inline the polymorphic call to %s\n",
*name->ToCString());
}
if (!FLAG_polymorphic_inlining || !TryInline(expr)) {
if (FLAG_polymorphic_inlining && TryInline(expr)) {
// Trying to inline will signal that we should bailout from the
// entire compilation by setting stack overflow on the visitor.
if (HasStackOverflow()) return;
} else {
HCallConstantFunction* call =
new(zone()) HCallConstantFunction(expr->target(), argument_count);
call->set_position(expr->position());
......@@ -4514,9 +4518,7 @@ void HGraphBuilder::VisitCall(Call* expr) {
IsGlobalObject());
environment()->SetExpressionStackAt(receiver_index, global_receiver);
if (TryInline(expr)) {
return;
}
if (TryInline(expr)) return;
call = PreProcessCall(new(zone()) HCallKnownGlobal(expr->target(),
argument_count));
} else {
......
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