Index: src/crankshaft/x64/lithium-codegen-x64.cc |
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc |
index 35855179df2f4e169301006916848f0ce8749069..f8dd6662d315a27e1e2c2fecd00e9663627bd7b5 100644 |
--- a/src/crankshaft/x64/lithium-codegen-x64.cc |
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc |
@@ -2318,9 +2318,15 @@ void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
DCHECK(ToRegister(instr->left()).is(rdx)); |
DCHECK(ToRegister(instr->right()).is(rax)); |
- Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); |
- CallCode(code, RelocInfo::CODE_TARGET, instr); |
- __ testp(rax, rax); |
+ if (Token::IsOrderedRelationalCompareOp(instr->op())) { |
+ Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); |
+ CallCode(code, RelocInfo::CODE_TARGET, instr); |
+ __ testp(rax, rax); |
+ } else { |
+ Handle<Code> code = CodeFactory::StringEqual(isolate()).code(); |
+ CallCode(code, RelocInfo::CODE_TARGET, instr); |
+ __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
+ } |
EmitBranch(instr, TokenToCondition(instr->op(), false)); |
} |