Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 923aaa92026d7bb27292b5383cd816b14265cff1..f3418344c3a3eea9955d361e2c4da4d1dd0f0e7e 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4834,6 +4834,18 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) { |
} |
+HCompareSymbolEq* HGraphBuilder::BuildSymbolCompare(HValue* left, |
+ HValue* right, |
+ Token::Value op) { |
+ ASSERT(op == Token::EQ || op == Token::EQ_STRICT); |
+ AddInstruction(new(zone()) HCheckNonSmi(left)); |
+ AddInstruction(HCheckInstanceType::NewIsSymbol(left)); |
+ AddInstruction(new(zone()) HCheckNonSmi(right)); |
+ AddInstruction(HCheckInstanceType::NewIsSymbol(right)); |
+ return new(zone()) HCompareSymbolEq(left, right, op); |
+} |
+ |
+ |
HStringCharCodeAt* HGraphBuilder::BuildStringCharCodeAt(HValue* string, |
HValue* index) { |
AddInstruction(new(zone()) HCheckNonSmi(string)); |
@@ -5153,6 +5165,9 @@ void HGraphBuilder::VisitCompareOperation(CompareOperation* expr) { |
return Bailout("Unsupported non-primitive compare"); |
break; |
} |
+ } else if (type_info.IsString() && oracle()->IsSymbolCompare(expr) && |
+ (op == Token::EQ || op == Token::EQ_STRICT)) { |
+ instr = BuildSymbolCompare(left, right, op); |
} else { |
HCompare* compare = new(zone()) HCompare(left, right, op); |
Representation r = ToRepresentation(type_info); |