OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 // will be ruled out below. | 2707 // will be ruled out below. |
2708 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { | 2708 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { |
2709 __ TestIfSmi(object, r0); | 2709 __ TestIfSmi(object, r0); |
2710 EmitFalseBranch(instr, eq, cr0); | 2710 EmitFalseBranch(instr, eq, cr0); |
2711 } | 2711 } |
2712 | 2712 |
2713 // Loop through the {object}s prototype chain looking for the {prototype}. | 2713 // Loop through the {object}s prototype chain looking for the {prototype}. |
2714 __ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2714 __ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); |
2715 Label loop; | 2715 Label loop; |
2716 __ bind(&loop); | 2716 __ bind(&loop); |
| 2717 |
| 2718 // Deoptimize if the object needs to be access checked. |
| 2719 __ lbz(object_instance_type, |
| 2720 FieldMemOperand(object_map, Map::kBitFieldOffset)); |
| 2721 __ TestBit(object_instance_type, Map::kIsAccessCheckNeeded, r0); |
| 2722 DeoptimizeIf(ne, instr, Deoptimizer::kAccessCheck, cr0); |
| 2723 // Deoptimize for proxies. |
2717 __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE); | 2724 __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE); |
2718 DeoptimizeIf(eq, instr, Deoptimizer::kProxy); | 2725 DeoptimizeIf(eq, instr, Deoptimizer::kProxy); |
2719 __ LoadP(object_prototype, | 2726 __ LoadP(object_prototype, |
2720 FieldMemOperand(object_map, Map::kPrototypeOffset)); | 2727 FieldMemOperand(object_map, Map::kPrototypeOffset)); |
2721 __ cmp(object_prototype, prototype); | 2728 __ cmp(object_prototype, prototype); |
2722 EmitTrueBranch(instr, eq); | 2729 EmitTrueBranch(instr, eq); |
2723 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); | 2730 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); |
2724 EmitFalseBranch(instr, eq); | 2731 EmitFalseBranch(instr, eq); |
2725 __ LoadP(object_map, | 2732 __ LoadP(object_map, |
2726 FieldMemOperand(object_prototype, HeapObject::kMapOffset)); | 2733 FieldMemOperand(object_prototype, HeapObject::kMapOffset)); |
(...skipping 3184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5911 __ Push(scope_info); | 5918 __ Push(scope_info); |
5912 __ push(ToRegister(instr->function())); | 5919 __ push(ToRegister(instr->function())); |
5913 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5920 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5914 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5921 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5915 } | 5922 } |
5916 | 5923 |
5917 | 5924 |
5918 #undef __ | 5925 #undef __ |
5919 } // namespace internal | 5926 } // namespace internal |
5920 } // namespace v8 | 5927 } // namespace v8 |
OLD | NEW |