OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3737 | 3737 |
3738 | 3738 |
3739 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { | 3739 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { |
3740 Label miss; | 3740 Label miss; |
3741 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); | 3741 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); |
3742 __ mov(ecx, edx); | 3742 __ mov(ecx, edx); |
3743 __ and_(ecx, eax); | 3743 __ and_(ecx, eax); |
3744 __ JumpIfSmi(ecx, &miss, Label::kNear); | 3744 __ JumpIfSmi(ecx, &miss, Label::kNear); |
3745 | 3745 |
3746 __ GetWeakValue(edi, cell); | 3746 __ GetWeakValue(edi, cell); |
3747 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); | 3747 __ cmp(edi, FieldOperand(eax, HeapObject::kMapOffset)); |
3748 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | |
3749 __ cmp(ecx, edi); | |
3750 __ j(not_equal, &miss, Label::kNear); | 3748 __ j(not_equal, &miss, Label::kNear); |
3751 __ cmp(ebx, edi); | 3749 __ cmp(edi, FieldOperand(edx, HeapObject::kMapOffset)); |
3752 __ j(not_equal, &miss, Label::kNear); | 3750 __ j(not_equal, &miss, Label::kNear); |
3753 | 3751 |
3754 __ sub(eax, edx); | 3752 if (Token::IsEqualityOp(op())) { |
3755 __ ret(0); | 3753 __ sub(eax, edx); |
| 3754 __ ret(0); |
| 3755 } else if (is_strong(strength())) { |
| 3756 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
| 3757 } else { |
| 3758 __ PopReturnAddressTo(ecx); |
| 3759 __ Push(edx); |
| 3760 __ Push(eax); |
| 3761 __ Push(Immediate(Smi::FromInt(NegativeComparisonResult(GetCondition())))); |
| 3762 __ PushReturnAddressFrom(ecx); |
| 3763 __ TailCallRuntime(Runtime::kCompare, 3, 1); |
| 3764 } |
3756 | 3765 |
3757 __ bind(&miss); | 3766 __ bind(&miss); |
3758 GenerateMiss(masm); | 3767 GenerateMiss(masm); |
3759 } | 3768 } |
3760 | 3769 |
3761 | 3770 |
3762 void CompareICStub::GenerateMiss(MacroAssembler* masm) { | 3771 void CompareICStub::GenerateMiss(MacroAssembler* masm) { |
3763 { | 3772 { |
3764 // Call the runtime system in a fresh internal frame. | 3773 // Call the runtime system in a fresh internal frame. |
3765 FrameScope scope(masm, StackFrame::INTERNAL); | 3774 FrameScope scope(masm, StackFrame::INTERNAL); |
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5796 Operand(ebp, 7 * kPointerSize), NULL); | 5805 Operand(ebp, 7 * kPointerSize), NULL); |
5797 } | 5806 } |
5798 | 5807 |
5799 | 5808 |
5800 #undef __ | 5809 #undef __ |
5801 | 5810 |
5802 } // namespace internal | 5811 } // namespace internal |
5803 } // namespace v8 | 5812 } // namespace v8 |
5804 | 5813 |
5805 #endif // V8_TARGET_ARCH_IA32 | 5814 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |