diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc index bf39b7f84e..a7eaae1035 100644 --- a/src/crankshaft/x87/lithium-codegen-x87.cc +++ b/src/crankshaft/x87/lithium-codegen-x87.cc @@ -2452,17 +2452,10 @@ void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { DCHECK(ToRegister(instr->left()).is(edx)); DCHECK(ToRegister(instr->right()).is(eax)); - if (Token::IsOrderedRelationalCompareOp(instr->op())) { - Handle code = CodeFactory::StringCompare(isolate()).code(); - CallCode(code, RelocInfo::CODE_TARGET, instr); - __ test(eax, eax); - } else { - Handle code = CodeFactory::StringEqual(isolate()).code(); - CallCode(code, RelocInfo::CODE_TARGET, instr); - __ CompareRoot(eax, Heap::kTrueValueRootIndex); - } - - EmitBranch(instr, ComputeCompareCondition(instr->op())); + Handle code = CodeFactory::StringCompare(isolate(), instr->op()).code(); + CallCode(code, RelocInfo::CODE_TARGET, instr); + __ CompareRoot(eax, Heap::kTrueValueRootIndex); + EmitBranch(instr, equal); } diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index e6f50f1cca..fd2c8924bc 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -2587,44 +2587,6 @@ void StringHelper::GenerateOneByteCharsCompareLoop( } -void StringCompareStub::Generate(MacroAssembler* masm) { - // ----------- S t a t e ------------- - // -- edx : left string - // -- eax : right string - // -- esp[0] : return address - // ----------------------------------- - __ AssertString(edx); - __ AssertString(eax); - - Label not_same; - __ cmp(edx, eax); - __ j(not_equal, ¬_same, Label::kNear); - __ Move(eax, Immediate(Smi::FromInt(EQUAL))); - __ IncrementCounter(isolate()->counters()->string_compare_native(), 1); - __ Ret(); - - __ bind(¬_same); - - // Check that both objects are sequential one-byte strings. - Label runtime; - __ JumpIfNotBothSequentialOneByteStrings(edx, eax, ecx, ebx, &runtime); - - // Compare flat one-byte strings. - __ IncrementCounter(isolate()->counters()->string_compare_native(), 1); - StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx, - edi); - - // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) - // tagged as a small integer. - __ bind(&runtime); - __ PopReturnAddressTo(ecx); - __ Push(edx); - __ Push(eax); - __ PushReturnAddressFrom(ecx); - __ TailCallRuntime(Runtime::kStringCompare); -} - - void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { // ----------- S t a t e ------------- // -- edx : left