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/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2533 // will be ruled out below. | 2533 // will be ruled out below. |
2534 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { | 2534 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { |
2535 __ test(object, Immediate(kSmiTagMask)); | 2535 __ test(object, Immediate(kSmiTagMask)); |
2536 EmitFalseBranch(instr, zero); | 2536 EmitFalseBranch(instr, zero); |
2537 } | 2537 } |
2538 | 2538 |
2539 // Loop through the {object}s prototype chain looking for the {prototype}. | 2539 // Loop through the {object}s prototype chain looking for the {prototype}. |
2540 __ mov(object_map, FieldOperand(object, HeapObject::kMapOffset)); | 2540 __ mov(object_map, FieldOperand(object, HeapObject::kMapOffset)); |
2541 Label loop; | 2541 Label loop; |
2542 __ bind(&loop); | 2542 __ bind(&loop); |
| 2543 |
| 2544 // Deoptimize if the object needs to be access checked. |
| 2545 __ test_b(FieldOperand(object_map, Map::kBitFieldOffset), |
| 2546 1 << Map::kIsAccessCheckNeeded); |
| 2547 DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck); |
| 2548 // Deoptimize for proxies. |
2543 __ CmpInstanceType(object_map, JS_PROXY_TYPE); | 2549 __ CmpInstanceType(object_map, JS_PROXY_TYPE); |
2544 DeoptimizeIf(equal, instr, Deoptimizer::kProxy); | 2550 DeoptimizeIf(equal, instr, Deoptimizer::kProxy); |
| 2551 |
2545 __ mov(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset)); | 2552 __ mov(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset)); |
2546 __ cmp(object_prototype, prototype); | 2553 __ cmp(object_prototype, prototype); |
2547 EmitTrueBranch(instr, equal); | 2554 EmitTrueBranch(instr, equal); |
2548 __ cmp(object_prototype, factory()->null_value()); | 2555 __ cmp(object_prototype, factory()->null_value()); |
2549 EmitFalseBranch(instr, equal); | 2556 EmitFalseBranch(instr, equal); |
2550 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); | 2557 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); |
2551 __ jmp(&loop); | 2558 __ jmp(&loop); |
2552 } | 2559 } |
2553 | 2560 |
2554 | 2561 |
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5507 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5514 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5508 } | 5515 } |
5509 | 5516 |
5510 | 5517 |
5511 #undef __ | 5518 #undef __ |
5512 | 5519 |
5513 } // namespace internal | 5520 } // namespace internal |
5514 } // namespace v8 | 5521 } // namespace v8 |
5515 | 5522 |
5516 #endif // V8_TARGET_ARCH_IA32 | 5523 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |