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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3130 __ Assert(equal, kExpectedAllocationSite); | 3130 __ Assert(equal, kExpectedAllocationSite); |
3131 } | 3131 } |
3132 | 3132 |
3133 // Tail call into the stub that handles binary operations with allocation | 3133 // Tail call into the stub that handles binary operations with allocation |
3134 // sites. | 3134 // sites. |
3135 BinaryOpWithAllocationSiteStub stub(isolate(), state()); | 3135 BinaryOpWithAllocationSiteStub stub(isolate(), state()); |
3136 __ TailCallStub(&stub); | 3136 __ TailCallStub(&stub); |
3137 } | 3137 } |
3138 | 3138 |
3139 | 3139 |
| 3140 void CompareICStub::GenerateBooleans(MacroAssembler* masm) { |
| 3141 DCHECK_EQ(CompareICState::BOOLEAN, state()); |
| 3142 Label miss; |
| 3143 Label::Distance const miss_distance = |
| 3144 masm->emit_debug_code() ? Label::kFar : Label::kNear; |
| 3145 |
| 3146 __ JumpIfSmi(edx, &miss, miss_distance); |
| 3147 __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset)); |
| 3148 __ JumpIfSmi(eax, &miss, miss_distance); |
| 3149 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3150 __ JumpIfNotRoot(ecx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
| 3151 __ JumpIfNotRoot(ebx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
| 3152 if (op() != Token::EQ_STRICT && is_strong(strength())) { |
| 3153 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
| 3154 } else { |
| 3155 if (!Token::IsEqualityOp(op())) { |
| 3156 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); |
| 3157 __ AssertSmi(eax); |
| 3158 __ mov(edx, FieldOperand(edx, Oddball::kToNumberOffset)); |
| 3159 __ AssertSmi(edx); |
| 3160 __ xchg(eax, edx); |
| 3161 } |
| 3162 __ sub(eax, edx); |
| 3163 __ Ret(); |
| 3164 } |
| 3165 |
| 3166 __ bind(&miss); |
| 3167 GenerateMiss(masm); |
| 3168 } |
| 3169 |
| 3170 |
3140 void CompareICStub::GenerateSmis(MacroAssembler* masm) { | 3171 void CompareICStub::GenerateSmis(MacroAssembler* masm) { |
3141 DCHECK(state() == CompareICState::SMI); | 3172 DCHECK(state() == CompareICState::SMI); |
3142 Label miss; | 3173 Label miss; |
3143 __ mov(ecx, edx); | 3174 __ mov(ecx, edx); |
3144 __ or_(ecx, eax); | 3175 __ or_(ecx, eax); |
3145 __ JumpIfNotSmi(ecx, &miss, Label::kNear); | 3176 __ JumpIfNotSmi(ecx, &miss, Label::kNear); |
3146 | 3177 |
3147 if (GetCondition() == equal) { | 3178 if (GetCondition() == equal) { |
3148 // For equality we do not care about the sign of the result. | 3179 // For equality we do not care about the sign of the result. |
3149 __ sub(eax, edx); | 3180 __ sub(eax, edx); |
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 Operand(ebp, 7 * kPointerSize), NULL); | 5507 Operand(ebp, 7 * kPointerSize), NULL); |
5477 } | 5508 } |
5478 | 5509 |
5479 | 5510 |
5480 #undef __ | 5511 #undef __ |
5481 | 5512 |
5482 } // namespace internal | 5513 } // namespace internal |
5483 } // namespace v8 | 5514 } // namespace v8 |
5484 | 5515 |
5485 #endif // V8_TARGET_ARCH_X87 | 5516 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |