Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 57ea17313b2533e9cda72621789279b39aba428f..a6326f09841cae0e4361190619166438bc16038b 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8292,6 +8292,35 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { |
New<HCompareObjectEqAndBranch>(left, right); |
result->set_position(expr->position()); |
return ast_context()->ReturnControl(result, expr->id()); |
+ } else if (combined_type->Is(Type::String())) { |
+ BuildCheckHeapObject(left); |
+ AddInstruction(HCheckInstanceType::NewIsString(left, zone())); |
+ BuildCheckHeapObject(right); |
+ AddInstruction(HCheckInstanceType::NewIsString(right, zone())); |
+ HStringCompareAndBranch* result = |
+ New<HStringCompareAndBranch>(left, right, op); |
+ result->set_position(expr->position()); |
+ return ast_context()->ReturnControl(result, expr->id()); |
+ } else if (combined_type->NumClasses() == 1 && |
Hannes Payer (out of office)
2013/10/02 13:33:19
fits in one line
|
+ Token::IsEqualityOp(op)) { |
+ BuildCheckHeapObject(left); |
+ BuildCheckMap(left, combined_type->Classes().Current()); |
+ BuildCheckHeapObject(right); |
+ BuildCheckMap(right, combined_type->Classes().Current()); |
+ HCompareObjectEqAndBranch* result = |
+ New<HCompareObjectEqAndBranch>(left, right); |
+ result->set_position(expr->position()); |
+ return ast_context()->ReturnInstruction(result, expr->id()); |
+ } else if (combined_type->Is(Type::Receiver()) && |
Hannes Payer (out of office)
2013/10/02 13:33:19
fits in one line
|
+ Token::IsEqualityOp(op)) { |
+ BuildCheckHeapObject(left); |
+ AddInstruction(HCheckInstanceType::NewIsSpecObject(left, zone())); |
+ BuildCheckHeapObject(right); |
+ AddInstruction(HCheckInstanceType::NewIsSpecObject(right, zone())); |
+ HCompareObjectEqAndBranch* result = |
+ New<HCompareObjectEqAndBranch>(left, right); |
+ result->set_position(expr->position()); |
+ return ast_context()->ReturnInstruction(result, expr->id()); |
} else { |
if (combined_rep.IsTagged() || combined_rep.IsNone()) { |
HCompareGeneric* result = |