From 1a343b300408170aa6e5141fdef9a9c14c675756 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Thu, 17 Mar 2011 09:55:57 +0000 Subject: [PATCH] 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 --- src/hydrogen.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index d0b86a5..00eed04 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -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, -- 2.7.4