Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index d1efe5083a61fb5e62a62d71115c639248b02902..71fcc8d0c3b7ef71bab256ba11b3f2cda0fde70e 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -3400,6 +3400,37 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
} |
+void CompareICStub::GenerateBooleans(MacroAssembler* masm) { |
+ DCHECK_EQ(CompareICState::BOOLEAN, state()); |
+ Label miss; |
+ Label::Distance const miss_distance = |
+ masm->emit_debug_code() ? Label::kFar : Label::kNear; |
+ |
+ __ JumpIfSmi(edx, &miss, miss_distance); |
+ __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset)); |
+ __ JumpIfSmi(eax, &miss, miss_distance); |
+ __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
+ __ JumpIfNotRoot(ecx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
+ __ JumpIfNotRoot(ebx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
+ if (op() != Token::EQ_STRICT && is_strong(strength())) { |
+ __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
+ } else { |
+ if (!Token::IsEqualityOp(op())) { |
+ __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); |
+ __ AssertSmi(eax); |
+ __ mov(edx, FieldOperand(edx, Oddball::kToNumberOffset)); |
+ __ AssertSmi(edx); |
+ __ xchg(eax, edx); |
+ } |
+ __ sub(eax, edx); |
+ __ Ret(); |
+ } |
+ |
+ __ bind(&miss); |
+ GenerateMiss(masm); |
+} |
+ |
+ |
void CompareICStub::GenerateSmis(MacroAssembler* masm) { |
DCHECK(state() == CompareICState::SMI); |
Label miss; |