Commit 1a343b30 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Fix infinite recursion in the compiler introduced in r7212

In most situations tests passed just causing a bailout from the compiler due to stack overflow. On Mac some tests actually did crash and of cause some benchmarks showed regressions due to this.
Review URL: http://codereview.chromium.org/6665064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4a820097
......@@ -4569,7 +4569,7 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
}
ast_context()->ReturnInstruction(instr, expr->id());
} else if (op == Token::TYPEOF) {
VisitForTypeOf(expr);
VisitForTypeOf(expr->expression());
if (HasStackOverflow()) return;
HValue* value = Pop();
ast_context()->ReturnInstruction(new HTypeof(value), expr->id());
......@@ -4955,7 +4955,7 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) {
if ((expr->op() == Token::EQ || expr->op() == Token::EQ_STRICT) &&
left_unary != NULL && left_unary->op() == Token::TYPEOF &&
right_literal != NULL && right_literal->handle()->IsString()) {
VisitForTypeOf(expr);
VisitForTypeOf(left_unary->expression());
if (HasStackOverflow()) return;
HValue* left = Pop();
HInstruction* instr = new HTypeofIs(left,
......
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