From f5cae51e20b7cbd4b5a76b38c7e79d9c1e1bef3d Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Wed, 17 Jul 2013 14:58:00 +0000 Subject: [PATCH] Fix LiteralCompareTypeof breakage introduced in r15723 R=danno@chromium.org Review URL: https://codereview.chromium.org/19556003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/full-codegen-arm.cc | 2 +- src/ast.cc | 2 +- src/hydrogen.cc | 3 ++- src/ia32/full-codegen-ia32.cc | 2 +- src/mips/full-codegen-mips.cc | 2 +- src/x64/full-codegen-x64.cc | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 9040a75..0638720 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -4598,7 +4598,7 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, &if_true, &if_false, &fall_through); { AccumulatorValueContext context(this); - VisitForTypeofValue(sub_expr); + VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression()); } PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); diff --git a/src/ast.cc b/src/ast.cc index f34c7bb..779391f 100644 --- a/src/ast.cc +++ b/src/ast.cc @@ -363,7 +363,7 @@ static bool MatchLiteralCompareTypeof(Expression* left, Expression** expr, Handle* check) { if (IsTypeof(left) && right->IsStringLiteral() && Token::IsEqualityOp(op)) { - *expr = left->AsUnaryOperation()->expression(); + *expr = left; *check = Handle::cast(right->AsLiteral()->value()); return true; } diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 154027f..3a15984 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -8135,7 +8135,8 @@ void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr, Expression* sub_expr, Handle check) { CHECK_ALIVE(VisitForValue(sub_expr)); - HValue* value = Pop(); + HTypeof* htypeof = HTypeof::cast(Pop()); + HValue* value = htypeof->value(); HTypeofIsAndBranch* instr = new(zone()) HTypeofIsAndBranch(value, check); instr->set_position(expr->position()); return ast_context()->ReturnControl(instr, expr->id()); diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 5b14afb..fcfefaa 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -4608,7 +4608,7 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, &if_true, &if_false, &fall_through); { AccumulatorValueContext context(this); - VisitForTypeofValue(sub_expr); + VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression()); } PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 43325df..f4d02d2 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -4632,7 +4632,7 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, &if_true, &if_false, &fall_through); { AccumulatorValueContext context(this); - VisitForTypeofValue(sub_expr); + VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression()); } PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 66bc38b..47e8c46 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -4592,7 +4592,7 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, &if_true, &if_false, &fall_through); { AccumulatorValueContext context(this); - VisitForTypeofValue(sub_expr); + VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression()); } PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); -- 2.7.4