Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index 88d8a84536c3c08fc3d4d1ea501b9fb00f7968ed..c2ee45ec1e5d6843f40254844b1f82d3994582c1 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -2490,9 +2490,13 @@ CompareIC::State CompareIC::TargetState(State state, |
return HEAP_NUMBERS; |
} |
} |
- if (!Token::IsEqualityOp(op_)) return GENERIC; |
- if (x->IsSymbol() && y->IsSymbol()) return SYMBOLS; |
+ if (x->IsSymbol() && y->IsSymbol()) { |
+ // We compare symbols as strings if we need to determine |
+ // the order in a non-equality compare. |
+ return Token::IsEqualityOp(op_) ? SYMBOLS : STRINGS; |
+ } |
if (x->IsString() && y->IsString()) return STRINGS; |
+ if (!Token::IsEqualityOp(op_)) return GENERIC; |
if (x->IsJSObject() && y->IsJSObject()) { |
if (Handle<JSObject>::cast(x)->map() == |
Handle<JSObject>::cast(y)->map() && |