Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 3cb99eb0751e155c66323607fa76b0da2475651a..7da07796268d70bde8ac231f163a98cb63c246f7 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -3744,15 +3744,24 @@ void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { |
__ JumpIfSmi(ecx, &miss, Label::kNear); |
__ GetWeakValue(edi, cell); |
- __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); |
- __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
- __ cmp(ecx, edi); |
+ __ cmp(edi, FieldOperand(eax, HeapObject::kMapOffset)); |
__ j(not_equal, &miss, Label::kNear); |
- __ cmp(ebx, edi); |
+ __ cmp(edi, FieldOperand(edx, HeapObject::kMapOffset)); |
__ j(not_equal, &miss, Label::kNear); |
- __ sub(eax, edx); |
- __ ret(0); |
+ if (Token::IsEqualityOp(op())) { |
+ __ sub(eax, edx); |
+ __ ret(0); |
+ } else if (is_strong(strength())) { |
+ __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
+ } else { |
+ __ PopReturnAddressTo(ecx); |
+ __ Push(edx); |
+ __ Push(eax); |
+ __ Push(Immediate(Smi::FromInt(NegativeComparisonResult(GetCondition())))); |
+ __ PushReturnAddressFrom(ecx); |
+ __ TailCallRuntime(Runtime::kCompare, 3, 1); |
+ } |
__ bind(&miss); |
GenerateMiss(masm); |