Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 59d3d6a58207465da8755270ba65f71269c460b2..af120df1edbaca14495c745fac4eff05109a69dc 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -3356,6 +3356,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(rdx, &miss, miss_distance); |
+ __ movp(rcx, FieldOperand(rdx, HeapObject::kMapOffset)); |
+ __ JumpIfSmi(rax, &miss, miss_distance); |
+ __ movp(rbx, FieldOperand(rax, HeapObject::kMapOffset)); |
+ __ JumpIfNotRoot(rcx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
+ __ JumpIfNotRoot(rbx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
+ if (op() != Token::EQ_STRICT && is_strong(strength())) { |
+ __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
+ } else { |
+ if (!Token::IsEqualityOp(op())) { |
+ __ movp(rax, FieldOperand(rax, Oddball::kToNumberOffset)); |
+ __ AssertSmi(rax); |
+ __ movp(rdx, FieldOperand(rdx, Oddball::kToNumberOffset)); |
+ __ AssertSmi(rdx); |
+ __ xchgp(rax, rdx); |
+ } |
+ __ subp(rax, rdx); |
+ __ Ret(); |
+ } |
+ |
+ __ bind(&miss); |
+ GenerateMiss(masm); |
+} |
+ |
+ |
void CompareICStub::GenerateSmis(MacroAssembler* masm) { |
DCHECK(state() == CompareICState::SMI); |
Label miss; |