Reviewers: fschneider,
Description:
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.
[email protected]
Please review this at http://codereview.chromium.org/6840012/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen.cc
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
bf69cc11ade05b3d75360afdf8148aeb4476a5e2..9007d0903b5b7d92f262ac3c6e70c22000247745
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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 {
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev