Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 5805ebb8b2e27eb6ddfc0c9d175c44e2759bf2ef..c5ac6e1fc699555db840e17f31cd7ad070b1a862 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -3964,25 +3964,13 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
} |
-bool FullCodeGenerator::TryLiteralCompare(Token::Value op, |
- Expression* left, |
- Expression* right, |
- Label* if_true, |
- Label* if_false, |
- Label* fall_through) { |
- if (op != Token::EQ && op != Token::EQ_STRICT) return false; |
- |
- // Check for the pattern: typeof <expression> == <string literal>. |
- Literal* right_literal = right->AsLiteral(); |
- if (right_literal == NULL) return false; |
- Handle<Object> right_literal_value = right_literal->handle(); |
- if (!right_literal_value->IsString()) return false; |
- UnaryOperation* left_unary = left->AsUnaryOperation(); |
- if (left_unary == NULL || left_unary->op() != Token::TYPEOF) return false; |
- Handle<String> check = Handle<String>::cast(right_literal_value); |
- |
+void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
+ Handle<String> check, |
+ Label* if_true, |
+ Label* if_false, |
+ Label* fall_through) { |
{ AccumulatorValueContext context(this); |
- VisitForTypeofValue(left_unary->expression()); |
+ VisitForTypeofValue(expr); |
} |
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
@@ -4036,8 +4024,20 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op, |
} else { |
if (if_false != fall_through) __ jmp(if_false); |
} |
+} |
+ |
+ |
+void FullCodeGenerator::EmitLiteralCompareUndefined(Expression* expr, |
+ Label* if_true, |
+ Label* if_false, |
+ Label* fall_through) { |
+ { AccumulatorValueContext context(this); |
fschneider
2011/06/21 11:36:08
This expression should not be visited in a typeof-
Steven
2011/06/22 10:00:53
Done.
|
+ VisitForTypeofValue(expr); |
+ } |
+ PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
- return true; |
+ __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); |
+ Split(eq, if_true, if_false, fall_through); |
} |