Revision: 15728
Author: [email protected]
Date: Wed Jul 17 08:58:59 2013
Log: Better fix for LiteralCompareTypeof
This reverts r15725 and replaces it with the following one-liner
in hydrogen.cc's HandleLiteralCompareTypeof:
- CHECK_ALIVE(VisitForValue(sub_expr));
+ CHECK_ALIVE(VisitForTypeOf(sub_expr));
[email protected]
Review URL: https://codereview.chromium.org/19523005
http://code.google.com/p/v8/source/detail?r=15728
Modified:
/branches/bleeding_edge/src/arm/full-codegen-arm.cc
/branches/bleeding_edge/src/ast.cc
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/x64/full-codegen-x64.cc
=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Wed Jul 17 07:58:00
2013
+++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Wed Jul 17 08:58:59
2013
@@ -4598,7 +4598,7 @@
&if_true, &if_false, &fall_through);
{ AccumulatorValueContext context(this);
- VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression());
+ VisitForTypeofValue(sub_expr);
}
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
=======================================
--- /branches/bleeding_edge/src/ast.cc Wed Jul 17 07:58:00 2013
+++ /branches/bleeding_edge/src/ast.cc Wed Jul 17 08:58:59 2013
@@ -363,7 +363,7 @@
Expression** expr,
Handle<String>* check) {
if (IsTypeof(left) && right->IsStringLiteral() &&
Token::IsEqualityOp(op)) {
- *expr = left;
+ *expr = left->AsUnaryOperation()->expression();
*check = Handle<String>::cast(right->AsLiteral()->value());
return true;
}
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Wed Jul 17 07:58:00 2013
+++ /branches/bleeding_edge/src/hydrogen.cc Wed Jul 17 08:58:59 2013
@@ -8134,9 +8134,8 @@
void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation*
expr,
Expression*
sub_expr,
Handle<String>
check) {
- CHECK_ALIVE(VisitForValue(sub_expr));
- HTypeof* htypeof = HTypeof::cast(Pop());
- HValue* value = htypeof->value();
+ CHECK_ALIVE(VisitForTypeOf(sub_expr));
+ HValue* value = Pop();
HTypeofIsAndBranch* instr = new(zone()) HTypeofIsAndBranch(value, check);
instr->set_position(expr->position());
return ast_context()->ReturnControl(instr, expr->id());
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Wed Jul 17
07:58:00 2013
+++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Wed Jul 17
08:58:59 2013
@@ -4608,7 +4608,7 @@
&if_true, &if_false, &fall_through);
{ AccumulatorValueContext context(this);
- VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression());
+ VisitForTypeofValue(sub_expr);
}
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Jul 17
07:58:00 2013
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Jul 17
08:58:59 2013
@@ -4632,7 +4632,7 @@
&if_true, &if_false, &fall_through);
{ AccumulatorValueContext context(this);
- VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression());
+ VisitForTypeofValue(sub_expr);
}
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Jul 17 07:58:00
2013
+++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Wed Jul 17 08:58:59
2013
@@ -4592,7 +4592,7 @@
&if_true, &if_false, &fall_through);
{ AccumulatorValueContext context(this);
- VisitForTypeofValue(sub_expr->AsUnaryOperation()->expression());
+ VisitForTypeofValue(sub_expr);
}
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.