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
parent d75b34db
......@@ -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);
......
......@@ -363,7 +363,7 @@ static bool MatchLiteralCompareTypeof(Expression* left,
Expression** expr,
Handle<String>* check) {
if (IsTypeof(left) && right->IsStringLiteral() && Token::IsEqualityOp(op)) {
*expr = left->AsUnaryOperation()->expression();
*expr = left;
*check = Handle<String>::cast(right->AsLiteral()->value());
return true;
}
......
......@@ -8135,7 +8135,8 @@ void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr,
Expression* sub_expr,
Handle<String> 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());
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
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