| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
| (...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3676 } | 3676 } |
| 3677 | 3677 |
| 3678 | 3678 |
| 3679 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { | 3679 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { |
| 3680 Label miss; | 3680 Label miss; |
| 3681 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); | 3681 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); |
| 3682 Condition either_smi = masm->CheckEitherSmi(rdx, rax); | 3682 Condition either_smi = masm->CheckEitherSmi(rdx, rax); |
| 3683 __ j(either_smi, &miss, Label::kNear); | 3683 __ j(either_smi, &miss, Label::kNear); |
| 3684 | 3684 |
| 3685 __ GetWeakValue(rdi, cell); | 3685 __ GetWeakValue(rdi, cell); |
| 3686 __ movp(rcx, FieldOperand(rax, HeapObject::kMapOffset)); | 3686 __ cmpp(FieldOperand(rdx, HeapObject::kMapOffset), rdi); |
| 3687 __ movp(rbx, FieldOperand(rdx, HeapObject::kMapOffset)); | |
| 3688 __ cmpp(rcx, rdi); | |
| 3689 __ j(not_equal, &miss, Label::kNear); | 3687 __ j(not_equal, &miss, Label::kNear); |
| 3690 __ cmpp(rbx, rdi); | 3688 __ cmpp(FieldOperand(rax, HeapObject::kMapOffset), rdi); |
| 3691 __ j(not_equal, &miss, Label::kNear); | 3689 __ j(not_equal, &miss, Label::kNear); |
| 3692 | 3690 |
| 3693 __ subp(rax, rdx); | 3691 if (Token::IsEqualityOp(op())) { |
| 3694 __ ret(0); | 3692 __ subp(rax, rdx); |
| 3693 __ ret(0); |
| 3694 } else if (is_strong(strength())) { |
| 3695 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
| 3696 } else { |
| 3697 __ PopReturnAddressTo(rcx); |
| 3698 __ Push(rdx); |
| 3699 __ Push(rax); |
| 3700 __ Push(Smi::FromInt(NegativeComparisonResult(GetCondition()))); |
| 3701 __ PushReturnAddressFrom(rcx); |
| 3702 __ TailCallRuntime(Runtime::kCompare, 3, 1); |
| 3703 } |
| 3695 | 3704 |
| 3696 __ bind(&miss); | 3705 __ bind(&miss); |
| 3697 GenerateMiss(masm); | 3706 GenerateMiss(masm); |
| 3698 } | 3707 } |
| 3699 | 3708 |
| 3700 | 3709 |
| 3701 void CompareICStub::GenerateMiss(MacroAssembler* masm) { | 3710 void CompareICStub::GenerateMiss(MacroAssembler* masm) { |
| 3702 { | 3711 { |
| 3703 // Call the runtime system in a fresh internal frame. | 3712 // Call the runtime system in a fresh internal frame. |
| 3704 FrameScope scope(masm, StackFrame::INTERNAL); | 3713 FrameScope scope(masm, StackFrame::INTERNAL); |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5558 kStackSpace, nullptr, return_value_operand, NULL); | 5567 kStackSpace, nullptr, return_value_operand, NULL); |
| 5559 } | 5568 } |
| 5560 | 5569 |
| 5561 | 5570 |
| 5562 #undef __ | 5571 #undef __ |
| 5563 | 5572 |
| 5564 } // namespace internal | 5573 } // namespace internal |
| 5565 } // namespace v8 | 5574 } // namespace v8 |
| 5566 | 5575 |
| 5567 #endif // V8_TARGET_ARCH_X64 | 5576 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |