| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3447 Condition cond = masm->CheckEitherSmi(left, right, tmp1); | 3447 Condition cond = masm->CheckEitherSmi(left, right, tmp1); |
| 3448 __ j(cond, &miss, Label::kNear); | 3448 __ j(cond, &miss, Label::kNear); |
| 3449 | 3449 |
| 3450 // Check that both operands are unique names. This leaves the instance | 3450 // Check that both operands are unique names. This leaves the instance |
| 3451 // types loaded in tmp1 and tmp2. | 3451 // types loaded in tmp1 and tmp2. |
| 3452 __ movp(tmp1, FieldOperand(left, HeapObject::kMapOffset)); | 3452 __ movp(tmp1, FieldOperand(left, HeapObject::kMapOffset)); |
| 3453 __ movp(tmp2, FieldOperand(right, HeapObject::kMapOffset)); | 3453 __ movp(tmp2, FieldOperand(right, HeapObject::kMapOffset)); |
| 3454 __ movzxbp(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); | 3454 __ movzxbp(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); |
| 3455 __ movzxbp(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); | 3455 __ movzxbp(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); |
| 3456 | 3456 |
| 3457 __ JumpIfNotUniqueName(tmp1, &miss, Label::kNear); | 3457 __ JumpIfNotUniqueNameInstanceType(tmp1, &miss, Label::kNear); |
| 3458 __ JumpIfNotUniqueName(tmp2, &miss, Label::kNear); | 3458 __ JumpIfNotUniqueNameInstanceType(tmp2, &miss, Label::kNear); |
| 3459 | 3459 |
| 3460 // Unique names are compared by identity. | 3460 // Unique names are compared by identity. |
| 3461 Label done; | 3461 Label done; |
| 3462 __ cmpp(left, right); | 3462 __ cmpp(left, right); |
| 3463 // Make sure rax is non-zero. At this point input operands are | 3463 // Make sure rax is non-zero. At this point input operands are |
| 3464 // guaranteed to be non-zero. | 3464 // guaranteed to be non-zero. |
| 3465 DCHECK(right.is(rax)); | 3465 DCHECK(right.is(rax)); |
| 3466 __ j(not_equal, &done, Label::kNear); | 3466 __ j(not_equal, &done, Label::kNear); |
| 3467 STATIC_ASSERT(EQUAL == 0); | 3467 STATIC_ASSERT(EQUAL == 0); |
| 3468 STATIC_ASSERT(kSmiTag == 0); | 3468 STATIC_ASSERT(kSmiTag == 0); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3667 __ Cmp(entity_name, Handle<Name>(name)); | 3667 __ Cmp(entity_name, Handle<Name>(name)); |
| 3668 __ j(equal, miss); | 3668 __ j(equal, miss); |
| 3669 | 3669 |
| 3670 Label good; | 3670 Label good; |
| 3671 // Check for the hole and skip. | 3671 // Check for the hole and skip. |
| 3672 __ CompareRoot(entity_name, Heap::kTheHoleValueRootIndex); | 3672 __ CompareRoot(entity_name, Heap::kTheHoleValueRootIndex); |
| 3673 __ j(equal, &good, Label::kNear); | 3673 __ j(equal, &good, Label::kNear); |
| 3674 | 3674 |
| 3675 // Check if the entry name is not a unique name. | 3675 // Check if the entry name is not a unique name. |
| 3676 __ movp(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); | 3676 __ movp(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
| 3677 __ JumpIfNotUniqueName(FieldOperand(entity_name, Map::kInstanceTypeOffset), | 3677 __ JumpIfNotUniqueNameInstanceType( |
| 3678 miss); | 3678 FieldOperand(entity_name, Map::kInstanceTypeOffset), miss); |
| 3679 __ bind(&good); | 3679 __ bind(&good); |
| 3680 } | 3680 } |
| 3681 | 3681 |
| 3682 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, | 3682 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, |
| 3683 NEGATIVE_LOOKUP); | 3683 NEGATIVE_LOOKUP); |
| 3684 __ Push(Handle<Object>(name)); | 3684 __ Push(Handle<Object>(name)); |
| 3685 __ Push(Immediate(name->Hash())); | 3685 __ Push(Immediate(name->Hash())); |
| 3686 __ CallStub(&stub); | 3686 __ CallStub(&stub); |
| 3687 __ testp(r0, r0); | 3687 __ testp(r0, r0); |
| 3688 __ j(not_zero, miss); | 3688 __ j(not_zero, miss); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3797 __ cmpp(scratch, args.GetArgumentOperand(0)); | 3797 __ cmpp(scratch, args.GetArgumentOperand(0)); |
| 3798 __ j(equal, &in_dictionary); | 3798 __ j(equal, &in_dictionary); |
| 3799 | 3799 |
| 3800 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { | 3800 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { |
| 3801 // If we hit a key that is not a unique name during negative | 3801 // If we hit a key that is not a unique name during negative |
| 3802 // lookup we have to bailout as this key might be equal to the | 3802 // lookup we have to bailout as this key might be equal to the |
| 3803 // key we are looking for. | 3803 // key we are looking for. |
| 3804 | 3804 |
| 3805 // Check if the entry name is not a unique name. | 3805 // Check if the entry name is not a unique name. |
| 3806 __ movp(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); | 3806 __ movp(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); |
| 3807 __ JumpIfNotUniqueName(FieldOperand(scratch, Map::kInstanceTypeOffset), | 3807 __ JumpIfNotUniqueNameInstanceType( |
| 3808 &maybe_in_dictionary); | 3808 FieldOperand(scratch, Map::kInstanceTypeOffset), |
| 3809 &maybe_in_dictionary); |
| 3809 } | 3810 } |
| 3810 } | 3811 } |
| 3811 | 3812 |
| 3812 __ bind(&maybe_in_dictionary); | 3813 __ bind(&maybe_in_dictionary); |
| 3813 // If we are doing negative lookup then probing failure should be | 3814 // If we are doing negative lookup then probing failure should be |
| 3814 // treated as a lookup success. For positive lookup probing failure | 3815 // treated as a lookup success. For positive lookup probing failure |
| 3815 // should be treated as lookup failure. | 3816 // should be treated as lookup failure. |
| 3816 if (mode() == POSITIVE_LOOKUP) { | 3817 if (mode() == POSITIVE_LOOKUP) { |
| 3817 __ movp(scratch, Immediate(0)); | 3818 __ movp(scratch, Immediate(0)); |
| 3818 __ Drop(1); | 3819 __ Drop(1); |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4666 return_value_operand, | 4667 return_value_operand, |
| 4667 NULL); | 4668 NULL); |
| 4668 } | 4669 } |
| 4669 | 4670 |
| 4670 | 4671 |
| 4671 #undef __ | 4672 #undef __ |
| 4672 | 4673 |
| 4673 } } // namespace v8::internal | 4674 } } // namespace v8::internal |
| 4674 | 4675 |
| 4675 #endif // V8_TARGET_ARCH_X64 | 4676 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |