| 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 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3419 | 3419 |
| 3420 | 3420 |
| 3421 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { | 3421 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { |
| 3422 Label miss; | 3422 Label miss; |
| 3423 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); | 3423 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); |
| 3424 __ mov(ecx, edx); | 3424 __ mov(ecx, edx); |
| 3425 __ and_(ecx, eax); | 3425 __ and_(ecx, eax); |
| 3426 __ JumpIfSmi(ecx, &miss, Label::kNear); | 3426 __ JumpIfSmi(ecx, &miss, Label::kNear); |
| 3427 | 3427 |
| 3428 __ GetWeakValue(edi, cell); | 3428 __ GetWeakValue(edi, cell); |
| 3429 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); | 3429 __ cmp(edi, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3430 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | |
| 3431 __ cmp(ecx, edi); | |
| 3432 __ j(not_equal, &miss, Label::kNear); | 3430 __ j(not_equal, &miss, Label::kNear); |
| 3433 __ cmp(ebx, edi); | 3431 __ cmp(edi, FieldOperand(edx, HeapObject::kMapOffset)); |
| 3434 __ j(not_equal, &miss, Label::kNear); | 3432 __ j(not_equal, &miss, Label::kNear); |
| 3435 | 3433 |
| 3436 __ sub(eax, edx); | 3434 if (Token::IsEqualityOp(op())) { |
| 3437 __ ret(0); | 3435 __ sub(eax, edx); |
| 3436 __ ret(0); |
| 3437 } else if (is_strong(strength())) { |
| 3438 __ TailCallRuntime(Runtime::kThrowStrongModeImplicitConversion, 0, 1); |
| 3439 } else { |
| 3440 __ PopReturnAddressTo(ecx); |
| 3441 __ Push(edx); |
| 3442 __ Push(eax); |
| 3443 __ Push(Immediate(Smi::FromInt(NegativeComparisonResult(GetCondition())))); |
| 3444 __ PushReturnAddressFrom(ecx); |
| 3445 __ TailCallRuntime(Runtime::kCompare, 3, 1); |
| 3446 } |
| 3438 | 3447 |
| 3439 __ bind(&miss); | 3448 __ bind(&miss); |
| 3440 GenerateMiss(masm); | 3449 GenerateMiss(masm); |
| 3441 } | 3450 } |
| 3442 | 3451 |
| 3443 | 3452 |
| 3444 void CompareICStub::GenerateMiss(MacroAssembler* masm) { | 3453 void CompareICStub::GenerateMiss(MacroAssembler* masm) { |
| 3445 { | 3454 { |
| 3446 // Call the runtime system in a fresh internal frame. | 3455 // Call the runtime system in a fresh internal frame. |
| 3447 FrameScope scope(masm, StackFrame::INTERNAL); | 3456 FrameScope scope(masm, StackFrame::INTERNAL); |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5476 Operand(ebp, 7 * kPointerSize), NULL); | 5485 Operand(ebp, 7 * kPointerSize), NULL); |
| 5477 } | 5486 } |
| 5478 | 5487 |
| 5479 | 5488 |
| 5480 #undef __ | 5489 #undef __ |
| 5481 | 5490 |
| 5482 } // namespace internal | 5491 } // namespace internal |
| 5483 } // namespace v8 | 5492 } // namespace v8 |
| 5484 | 5493 |
| 5485 #endif // V8_TARGET_ARCH_X87 | 5494 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |