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 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3393 __ Assert(equal, kExpectedAllocationSite); | 3393 __ Assert(equal, kExpectedAllocationSite); |
3394 } | 3394 } |
3395 | 3395 |
3396 // Tail call into the stub that handles binary operations with allocation | 3396 // Tail call into the stub that handles binary operations with allocation |
3397 // sites. | 3397 // sites. |
3398 BinaryOpWithAllocationSiteStub stub(isolate(), state()); | 3398 BinaryOpWithAllocationSiteStub stub(isolate(), state()); |
3399 __ TailCallStub(&stub); | 3399 __ TailCallStub(&stub); |
3400 } | 3400 } |
3401 | 3401 |
3402 | 3402 |
| 3403 void CompareICStub::GenerateBooleans(MacroAssembler* masm) { |
| 3404 DCHECK_EQ(CompareICState::BOOLEAN, state()); |
| 3405 Label miss; |
| 3406 Label::Distance const miss_distance = |
| 3407 masm->emit_debug_code() ? Label::kFar : Label::kNear; |
| 3408 |
| 3409 __ JumpIfSmi(edx, &miss, miss_distance); |
| 3410 __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset)); |
| 3411 __ JumpIfSmi(eax, &miss, miss_distance); |
| 3412 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3413 __ JumpIfNotRoot(ecx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
| 3414 __ JumpIfNotRoot(ebx, Heap::kBooleanMapRootIndex, &miss, miss_distance); |
| 3415 if (op() != Token::EQ_STRICT && is_strong(strength())) { |
| 3416 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
| 3417 } else { |
| 3418 if (!Token::IsEqualityOp(op())) { |
| 3419 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); |
| 3420 __ AssertSmi(eax); |
| 3421 __ mov(edx, FieldOperand(edx, Oddball::kToNumberOffset)); |
| 3422 __ AssertSmi(edx); |
| 3423 __ xchg(eax, edx); |
| 3424 } |
| 3425 __ sub(eax, edx); |
| 3426 __ Ret(); |
| 3427 } |
| 3428 |
| 3429 __ bind(&miss); |
| 3430 GenerateMiss(masm); |
| 3431 } |
| 3432 |
| 3433 |
3403 void CompareICStub::GenerateSmis(MacroAssembler* masm) { | 3434 void CompareICStub::GenerateSmis(MacroAssembler* masm) { |
3404 DCHECK(state() == CompareICState::SMI); | 3435 DCHECK(state() == CompareICState::SMI); |
3405 Label miss; | 3436 Label miss; |
3406 __ mov(ecx, edx); | 3437 __ mov(ecx, edx); |
3407 __ or_(ecx, eax); | 3438 __ or_(ecx, eax); |
3408 __ JumpIfNotSmi(ecx, &miss, Label::kNear); | 3439 __ JumpIfNotSmi(ecx, &miss, Label::kNear); |
3409 | 3440 |
3410 if (GetCondition() == equal) { | 3441 if (GetCondition() == equal) { |
3411 // For equality we do not care about the sign of the result. | 3442 // For equality we do not care about the sign of the result. |
3412 __ sub(eax, edx); | 3443 __ sub(eax, edx); |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5778 Operand(ebp, 7 * kPointerSize), NULL); | 5809 Operand(ebp, 7 * kPointerSize), NULL); |
5779 } | 5810 } |
5780 | 5811 |
5781 | 5812 |
5782 #undef __ | 5813 #undef __ |
5783 | 5814 |
5784 } // namespace internal | 5815 } // namespace internal |
5785 } // namespace v8 | 5816 } // namespace v8 |
5786 | 5817 |
5787 #endif // V8_TARGET_ARCH_IA32 | 5818 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |