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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3495 __ and_(tmp1, right); | 3495 __ and_(tmp1, right); |
3496 __ JumpIfSmi(tmp1, &miss, Label::kNear); | 3496 __ JumpIfSmi(tmp1, &miss, Label::kNear); |
3497 | 3497 |
3498 // Check that both operands are unique names. This leaves the instance | 3498 // Check that both operands are unique names. This leaves the instance |
3499 // types loaded in tmp1 and tmp2. | 3499 // types loaded in tmp1 and tmp2. |
3500 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); | 3500 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); |
3501 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); | 3501 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); |
3502 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); | 3502 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); |
3503 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); | 3503 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); |
3504 | 3504 |
3505 __ JumpIfNotUniqueName(tmp1, &miss, Label::kNear); | 3505 __ JumpIfNotUniqueNameInstanceType(tmp1, &miss, Label::kNear); |
3506 __ JumpIfNotUniqueName(tmp2, &miss, Label::kNear); | 3506 __ JumpIfNotUniqueNameInstanceType(tmp2, &miss, Label::kNear); |
3507 | 3507 |
3508 // Unique names are compared by identity. | 3508 // Unique names are compared by identity. |
3509 Label done; | 3509 Label done; |
3510 __ cmp(left, right); | 3510 __ cmp(left, right); |
3511 // Make sure eax is non-zero. At this point input operands are | 3511 // Make sure eax is non-zero. At this point input operands are |
3512 // guaranteed to be non-zero. | 3512 // guaranteed to be non-zero. |
3513 DCHECK(right.is(eax)); | 3513 DCHECK(right.is(eax)); |
3514 __ j(not_equal, &done, Label::kNear); | 3514 __ j(not_equal, &done, Label::kNear); |
3515 STATIC_ASSERT(EQUAL == 0); | 3515 STATIC_ASSERT(EQUAL == 0); |
3516 STATIC_ASSERT(kSmiTag == 0); | 3516 STATIC_ASSERT(kSmiTag == 0); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3721 __ cmp(entity_name, Handle<Name>(name)); | 3721 __ cmp(entity_name, Handle<Name>(name)); |
3722 __ j(equal, miss); | 3722 __ j(equal, miss); |
3723 | 3723 |
3724 Label good; | 3724 Label good; |
3725 // Check for the hole and skip. | 3725 // Check for the hole and skip. |
3726 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); | 3726 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); |
3727 __ j(equal, &good, Label::kNear); | 3727 __ j(equal, &good, Label::kNear); |
3728 | 3728 |
3729 // Check if the entry name is not a unique name. | 3729 // Check if the entry name is not a unique name. |
3730 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); | 3730 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
3731 __ JumpIfNotUniqueName(FieldOperand(entity_name, Map::kInstanceTypeOffset), | 3731 __ JumpIfNotUniqueNameInstanceType( |
3732 miss); | 3732 FieldOperand(entity_name, Map::kInstanceTypeOffset), miss); |
3733 __ bind(&good); | 3733 __ bind(&good); |
3734 } | 3734 } |
3735 | 3735 |
3736 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, | 3736 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, |
3737 NEGATIVE_LOOKUP); | 3737 NEGATIVE_LOOKUP); |
3738 __ push(Immediate(Handle<Object>(name))); | 3738 __ push(Immediate(Handle<Object>(name))); |
3739 __ push(Immediate(name->Hash())); | 3739 __ push(Immediate(name->Hash())); |
3740 __ CallStub(&stub); | 3740 __ CallStub(&stub); |
3741 __ test(r0, r0); | 3741 __ test(r0, r0); |
3742 __ j(not_zero, miss); | 3742 __ j(not_zero, miss); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3856 __ cmp(scratch, Operand(esp, 3 * kPointerSize)); | 3856 __ cmp(scratch, Operand(esp, 3 * kPointerSize)); |
3857 __ j(equal, &in_dictionary); | 3857 __ j(equal, &in_dictionary); |
3858 | 3858 |
3859 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { | 3859 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { |
3860 // If we hit a key that is not a unique name during negative | 3860 // If we hit a key that is not a unique name during negative |
3861 // lookup we have to bailout as this key might be equal to the | 3861 // lookup we have to bailout as this key might be equal to the |
3862 // key we are looking for. | 3862 // key we are looking for. |
3863 | 3863 |
3864 // Check if the entry name is not a unique name. | 3864 // Check if the entry name is not a unique name. |
3865 __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); | 3865 __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); |
3866 __ JumpIfNotUniqueName(FieldOperand(scratch, Map::kInstanceTypeOffset), | 3866 __ JumpIfNotUniqueNameInstanceType( |
3867 &maybe_in_dictionary); | 3867 FieldOperand(scratch, Map::kInstanceTypeOffset), |
| 3868 &maybe_in_dictionary); |
3868 } | 3869 } |
3869 } | 3870 } |
3870 | 3871 |
3871 __ bind(&maybe_in_dictionary); | 3872 __ bind(&maybe_in_dictionary); |
3872 // If we are doing negative lookup then probing failure should be | 3873 // If we are doing negative lookup then probing failure should be |
3873 // treated as a lookup success. For positive lookup probing failure | 3874 // treated as a lookup success. For positive lookup probing failure |
3874 // should be treated as lookup failure. | 3875 // should be treated as lookup failure. |
3875 if (mode() == POSITIVE_LOOKUP) { | 3876 if (mode() == POSITIVE_LOOKUP) { |
3876 __ mov(result(), Immediate(0)); | 3877 __ mov(result(), Immediate(0)); |
3877 __ Drop(1); | 3878 __ Drop(1); |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 Operand(ebp, 7 * kPointerSize), | 4700 Operand(ebp, 7 * kPointerSize), |
4700 NULL); | 4701 NULL); |
4701 } | 4702 } |
4702 | 4703 |
4703 | 4704 |
4704 #undef __ | 4705 #undef __ |
4705 | 4706 |
4706 } } // namespace v8::internal | 4707 } } // namespace v8::internal |
4707 | 4708 |
4708 #endif // V8_TARGET_ARCH_IA32 | 4709 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |