| 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 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 DCHECK(ToRegister(instr->result()).is(r3)); | 2749 DCHECK(ToRegister(instr->result()).is(r3)); |
| 2750 InstanceOfStub stub(isolate()); | 2750 InstanceOfStub stub(isolate()); |
| 2751 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 2751 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 2752 } | 2752 } |
| 2753 | 2753 |
| 2754 | 2754 |
| 2755 void LCodeGen::DoHasInPrototypeChainAndBranch( | 2755 void LCodeGen::DoHasInPrototypeChainAndBranch( |
| 2756 LHasInPrototypeChainAndBranch* instr) { | 2756 LHasInPrototypeChainAndBranch* instr) { |
| 2757 Register const object = ToRegister(instr->object()); | 2757 Register const object = ToRegister(instr->object()); |
| 2758 Register const object_map = scratch0(); | 2758 Register const object_map = scratch0(); |
| 2759 Register const object_instance_type = ip; |
| 2759 Register const object_prototype = object_map; | 2760 Register const object_prototype = object_map; |
| 2760 Register const prototype = ToRegister(instr->prototype()); | 2761 Register const prototype = ToRegister(instr->prototype()); |
| 2761 | 2762 |
| 2762 // The {object} must be a spec object. It's sufficient to know that {object} | 2763 // The {object} must be a spec object. It's sufficient to know that {object} |
| 2763 // is not a smi, since all other non-spec objects have {null} prototypes and | 2764 // is not a smi, since all other non-spec objects have {null} prototypes and |
| 2764 // will be ruled out below. | 2765 // will be ruled out below. |
| 2765 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { | 2766 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { |
| 2766 __ TestIfSmi(object, r0); | 2767 __ TestIfSmi(object, r0); |
| 2767 EmitFalseBranch(instr, eq, cr0); | 2768 EmitFalseBranch(instr, eq, cr0); |
| 2768 } | 2769 } |
| 2769 | 2770 |
| 2770 // Loop through the {object}s prototype chain looking for the {prototype}. | 2771 // Loop through the {object}s prototype chain looking for the {prototype}. |
| 2771 __ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2772 __ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2772 Label loop; | 2773 Label loop; |
| 2773 __ bind(&loop); | 2774 __ bind(&loop); |
| 2775 __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE); |
| 2776 DeoptimizeIf(eq, instr, Deoptimizer::kProxy); |
| 2774 __ LoadP(object_prototype, | 2777 __ LoadP(object_prototype, |
| 2775 FieldMemOperand(object_map, Map::kPrototypeOffset)); | 2778 FieldMemOperand(object_map, Map::kPrototypeOffset)); |
| 2776 __ cmp(object_prototype, prototype); | 2779 __ cmp(object_prototype, prototype); |
| 2777 EmitTrueBranch(instr, eq); | 2780 EmitTrueBranch(instr, eq); |
| 2778 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); | 2781 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); |
| 2779 EmitFalseBranch(instr, eq); | 2782 EmitFalseBranch(instr, eq); |
| 2780 __ LoadP(object_map, | 2783 __ LoadP(object_map, |
| 2781 FieldMemOperand(object_prototype, HeapObject::kMapOffset)); | 2784 FieldMemOperand(object_prototype, HeapObject::kMapOffset)); |
| 2782 __ b(&loop); | 2785 __ b(&loop); |
| 2783 } | 2786 } |
| (...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5966 __ Push(scope_info); | 5969 __ Push(scope_info); |
| 5967 __ push(ToRegister(instr->function())); | 5970 __ push(ToRegister(instr->function())); |
| 5968 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5971 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5969 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5972 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5970 } | 5973 } |
| 5971 | 5974 |
| 5972 | 5975 |
| 5973 #undef __ | 5976 #undef __ |
| 5974 } // namespace internal | 5977 } // namespace internal |
| 5975 } // namespace v8 | 5978 } // namespace v8 |
| OLD | NEW |