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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 3135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3146 __ and_(tmp1, right); | 3146 __ and_(tmp1, right); |
3147 __ JumpIfSmi(tmp1, &miss, Label::kNear); | 3147 __ JumpIfSmi(tmp1, &miss, Label::kNear); |
3148 | 3148 |
3149 // Check that both operands are unique names. This leaves the instance | 3149 // Check that both operands are unique names. This leaves the instance |
3150 // types loaded in tmp1 and tmp2. | 3150 // types loaded in tmp1 and tmp2. |
3151 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); | 3151 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); |
3152 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); | 3152 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); |
3153 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); | 3153 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); |
3154 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); | 3154 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); |
3155 | 3155 |
3156 __ JumpIfNotUniqueName(tmp1, &miss, Label::kNear); | 3156 __ JumpIfNotUniqueNameInstanceType(tmp1, &miss, Label::kNear); |
3157 __ JumpIfNotUniqueName(tmp2, &miss, Label::kNear); | 3157 __ JumpIfNotUniqueNameInstanceType(tmp2, &miss, Label::kNear); |
3158 | 3158 |
3159 // Unique names are compared by identity. | 3159 // Unique names are compared by identity. |
3160 Label done; | 3160 Label done; |
3161 __ cmp(left, right); | 3161 __ cmp(left, right); |
3162 // Make sure eax is non-zero. At this point input operands are | 3162 // Make sure eax is non-zero. At this point input operands are |
3163 // guaranteed to be non-zero. | 3163 // guaranteed to be non-zero. |
3164 DCHECK(right.is(eax)); | 3164 DCHECK(right.is(eax)); |
3165 __ j(not_equal, &done, Label::kNear); | 3165 __ j(not_equal, &done, Label::kNear); |
3166 STATIC_ASSERT(EQUAL == 0); | 3166 STATIC_ASSERT(EQUAL == 0); |
3167 STATIC_ASSERT(kSmiTag == 0); | 3167 STATIC_ASSERT(kSmiTag == 0); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3372 __ cmp(entity_name, Handle<Name>(name)); | 3372 __ cmp(entity_name, Handle<Name>(name)); |
3373 __ j(equal, miss); | 3373 __ j(equal, miss); |
3374 | 3374 |
3375 Label good; | 3375 Label good; |
3376 // Check for the hole and skip. | 3376 // Check for the hole and skip. |
3377 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); | 3377 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); |
3378 __ j(equal, &good, Label::kNear); | 3378 __ j(equal, &good, Label::kNear); |
3379 | 3379 |
3380 // Check if the entry name is not a unique name. | 3380 // Check if the entry name is not a unique name. |
3381 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); | 3381 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
3382 __ JumpIfNotUniqueName(FieldOperand(entity_name, Map::kInstanceTypeOffset), | 3382 __ JumpIfNotUniqueNameInstanceType( |
3383 miss); | 3383 FieldOperand(entity_name, Map::kInstanceTypeOffset), miss); |
3384 __ bind(&good); | 3384 __ bind(&good); |
3385 } | 3385 } |
3386 | 3386 |
3387 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, | 3387 NameDictionaryLookupStub stub(masm->isolate(), properties, r0, r0, |
3388 NEGATIVE_LOOKUP); | 3388 NEGATIVE_LOOKUP); |
3389 __ push(Immediate(Handle<Object>(name))); | 3389 __ push(Immediate(Handle<Object>(name))); |
3390 __ push(Immediate(name->Hash())); | 3390 __ push(Immediate(name->Hash())); |
3391 __ CallStub(&stub); | 3391 __ CallStub(&stub); |
3392 __ test(r0, r0); | 3392 __ test(r0, r0); |
3393 __ j(not_zero, miss); | 3393 __ j(not_zero, miss); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 __ cmp(scratch, Operand(esp, 3 * kPointerSize)); | 3507 __ cmp(scratch, Operand(esp, 3 * kPointerSize)); |
3508 __ j(equal, &in_dictionary); | 3508 __ j(equal, &in_dictionary); |
3509 | 3509 |
3510 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { | 3510 if (i != kTotalProbes - 1 && mode() == NEGATIVE_LOOKUP) { |
3511 // If we hit a key that is not a unique name during negative | 3511 // If we hit a key that is not a unique name during negative |
3512 // lookup we have to bailout as this key might be equal to the | 3512 // lookup we have to bailout as this key might be equal to the |
3513 // key we are looking for. | 3513 // key we are looking for. |
3514 | 3514 |
3515 // Check if the entry name is not a unique name. | 3515 // Check if the entry name is not a unique name. |
3516 __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); | 3516 __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); |
3517 __ JumpIfNotUniqueName(FieldOperand(scratch, Map::kInstanceTypeOffset), | 3517 __ JumpIfNotUniqueNameInstanceType( |
3518 &maybe_in_dictionary); | 3518 FieldOperand(scratch, Map::kInstanceTypeOffset), |
| 3519 &maybe_in_dictionary); |
3519 } | 3520 } |
3520 } | 3521 } |
3521 | 3522 |
3522 __ bind(&maybe_in_dictionary); | 3523 __ bind(&maybe_in_dictionary); |
3523 // If we are doing negative lookup then probing failure should be | 3524 // If we are doing negative lookup then probing failure should be |
3524 // treated as a lookup success. For positive lookup probing failure | 3525 // treated as a lookup success. For positive lookup probing failure |
3525 // should be treated as lookup failure. | 3526 // should be treated as lookup failure. |
3526 if (mode() == POSITIVE_LOOKUP) { | 3527 if (mode() == POSITIVE_LOOKUP) { |
3527 __ mov(result(), Immediate(0)); | 3528 __ mov(result(), Immediate(0)); |
3528 __ Drop(1); | 3529 __ Drop(1); |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4347 Operand(ebp, 7 * kPointerSize), | 4348 Operand(ebp, 7 * kPointerSize), |
4348 NULL); | 4349 NULL); |
4349 } | 4350 } |
4350 | 4351 |
4351 | 4352 |
4352 #undef __ | 4353 #undef __ |
4353 | 4354 |
4354 } } // namespace v8::internal | 4355 } } // namespace v8::internal |
4355 | 4356 |
4356 #endif // V8_TARGET_ARCH_X87 | 4357 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |