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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2731 | 2731 |
2732 | 2732 |
2733 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2733 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2734 DCHECK(ToRegister(instr->context()).is(cp)); | 2734 DCHECK(ToRegister(instr->context()).is(cp)); |
2735 DCHECK(ToRegister(instr->global_object()) | 2735 DCHECK(ToRegister(instr->global_object()) |
2736 .is(LoadDescriptor::ReceiverRegister())); | 2736 .is(LoadDescriptor::ReceiverRegister())); |
2737 DCHECK(ToRegister(instr->result()).is(r3)); | 2737 DCHECK(ToRegister(instr->result()).is(r3)); |
2738 | 2738 |
2739 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2739 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2740 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2740 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2741 Handle<Code> ic = | 2741 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
2742 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2742 isolate(), instr->typeof_mode(), PREMONOMORPHIC) |
2743 SLOPPY, PREMONOMORPHIC).code(); | 2743 .code(); |
2744 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2744 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2745 } | 2745 } |
2746 | 2746 |
2747 | 2747 |
2748 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2748 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2749 Register context = ToRegister(instr->context()); | 2749 Register context = ToRegister(instr->context()); |
2750 Register result = ToRegister(instr->result()); | 2750 Register result = ToRegister(instr->result()); |
2751 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); | 2751 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); |
2752 if (instr->hydrogen()->RequiresHoleCheck()) { | 2752 if (instr->hydrogen()->RequiresHoleCheck()) { |
2753 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2753 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 | 2848 |
2849 | 2849 |
2850 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2850 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2851 DCHECK(ToRegister(instr->context()).is(cp)); | 2851 DCHECK(ToRegister(instr->context()).is(cp)); |
2852 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2852 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2853 DCHECK(ToRegister(instr->result()).is(r3)); | 2853 DCHECK(ToRegister(instr->result()).is(r3)); |
2854 | 2854 |
2855 // Name is always in r5. | 2855 // Name is always in r5. |
2856 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2856 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2857 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2857 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2858 Handle<Code> ic = | 2858 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
2859 CodeFactory::LoadICInOptimizedCode( | 2859 isolate(), NOT_INSIDE_TYPEOF, |
2860 isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(), | 2860 instr->hydrogen()->initialization_state()) |
2861 instr->hydrogen()->initialization_state()).code(); | 2861 .code(); |
2862 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2862 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2863 } | 2863 } |
2864 | 2864 |
2865 | 2865 |
2866 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2866 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2867 Register scratch = scratch0(); | 2867 Register scratch = scratch0(); |
2868 Register function = ToRegister(instr->function()); | 2868 Register function = ToRegister(instr->function()); |
2869 Register result = ToRegister(instr->result()); | 2869 Register result = ToRegister(instr->result()); |
2870 | 2870 |
2871 // Get the prototype or initial map from the function. | 2871 // Get the prototype or initial map from the function. |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3215 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3216 DCHECK(ToRegister(instr->context()).is(cp)); | 3216 DCHECK(ToRegister(instr->context()).is(cp)); |
3217 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3217 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3218 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3218 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3219 | 3219 |
3220 if (instr->hydrogen()->HasVectorAndSlot()) { | 3220 if (instr->hydrogen()->HasVectorAndSlot()) { |
3221 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3221 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3222 } | 3222 } |
3223 | 3223 |
3224 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3224 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
3225 isolate(), instr->hydrogen()->language_mode(), | 3225 isolate(), instr->hydrogen()->initialization_state()) |
3226 instr->hydrogen()->initialization_state()).code(); | 3226 .code(); |
3227 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3227 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3228 } | 3228 } |
3229 | 3229 |
3230 | 3230 |
3231 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3231 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3232 Register scratch = scratch0(); | 3232 Register scratch = scratch0(); |
3233 Register result = ToRegister(instr->result()); | 3233 Register result = ToRegister(instr->result()); |
3234 | 3234 |
3235 if (instr->hydrogen()->from_inlined()) { | 3235 if (instr->hydrogen()->from_inlined()) { |
3236 __ subi(result, sp, Operand(2 * kPointerSize)); | 3236 __ subi(result, sp, Operand(2 * kPointerSize)); |
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5780 __ Push(scope_info); | 5780 __ Push(scope_info); |
5781 __ push(ToRegister(instr->function())); | 5781 __ push(ToRegister(instr->function())); |
5782 CallRuntime(Runtime::kPushBlockContext, instr); | 5782 CallRuntime(Runtime::kPushBlockContext, instr); |
5783 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5783 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5784 } | 5784 } |
5785 | 5785 |
5786 | 5786 |
5787 #undef __ | 5787 #undef __ |
5788 } // namespace internal | 5788 } // namespace internal |
5789 } // namespace v8 | 5789 } // namespace v8 |
OLD | NEW |