| 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 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2692 | 2692 |
| 2693 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2693 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2694 DCHECK(ToRegister(instr->context()).is(cp)); | 2694 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2695 DCHECK(ToRegister(instr->global_object()) | 2695 DCHECK(ToRegister(instr->global_object()) |
| 2696 .is(LoadDescriptor::ReceiverRegister())); | 2696 .is(LoadDescriptor::ReceiverRegister())); |
| 2697 DCHECK(ToRegister(instr->result()).is(r3)); | 2697 DCHECK(ToRegister(instr->result()).is(r3)); |
| 2698 | 2698 |
| 2699 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2699 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
| 2700 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2700 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2701 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2701 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 2702 isolate(), instr->typeof_mode(), PREMONOMORPHIC) | 2702 isolate(), instr->typeof_mode()).code(); |
| 2703 .code(); | |
| 2704 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2703 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2705 } | 2704 } |
| 2706 | 2705 |
| 2707 | 2706 |
| 2708 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2707 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2709 Register context = ToRegister(instr->context()); | 2708 Register context = ToRegister(instr->context()); |
| 2710 Register result = ToRegister(instr->result()); | 2709 Register result = ToRegister(instr->result()); |
| 2711 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); | 2710 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); |
| 2712 if (instr->hydrogen()->RequiresHoleCheck()) { | 2711 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2713 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2712 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2808 | 2807 |
| 2809 | 2808 |
| 2810 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2809 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2811 DCHECK(ToRegister(instr->context()).is(cp)); | 2810 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2812 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2811 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 2813 DCHECK(ToRegister(instr->result()).is(r3)); | 2812 DCHECK(ToRegister(instr->result()).is(r3)); |
| 2814 | 2813 |
| 2815 // Name is always in r5. | 2814 // Name is always in r5. |
| 2816 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2815 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
| 2817 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2816 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 2818 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2817 Handle<Code> ic = |
| 2819 isolate(), NOT_INSIDE_TYPEOF, | 2818 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code(); |
| 2820 instr->hydrogen()->initialization_state()) | |
| 2821 .code(); | |
| 2822 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2819 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2823 } | 2820 } |
| 2824 | 2821 |
| 2825 | 2822 |
| 2826 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2823 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2827 Register scratch = scratch0(); | 2824 Register scratch = scratch0(); |
| 2828 Register function = ToRegister(instr->function()); | 2825 Register function = ToRegister(instr->function()); |
| 2829 Register result = ToRegister(instr->result()); | 2826 Register result = ToRegister(instr->result()); |
| 2830 | 2827 |
| 2831 // Get the prototype or initial map from the function. | 2828 // Get the prototype or initial map from the function. |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3169 } | 3166 } |
| 3170 | 3167 |
| 3171 return MemOperand(base, scratch); | 3168 return MemOperand(base, scratch); |
| 3172 } | 3169 } |
| 3173 | 3170 |
| 3174 | 3171 |
| 3175 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3172 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 3176 DCHECK(ToRegister(instr->context()).is(cp)); | 3173 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3177 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3174 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3178 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3175 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
| 3176 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
| 3179 | 3177 |
| 3180 if (instr->hydrogen()->HasVectorAndSlot()) { | 3178 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); |
| 3181 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
| 3182 } | |
| 3183 | |
| 3184 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | |
| 3185 isolate(), instr->hydrogen()->initialization_state()) | |
| 3186 .code(); | |
| 3187 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3179 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3188 } | 3180 } |
| 3189 | 3181 |
| 3190 | 3182 |
| 3191 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3183 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3192 Register scratch = scratch0(); | 3184 Register scratch = scratch0(); |
| 3193 Register result = ToRegister(instr->result()); | 3185 Register result = ToRegister(instr->result()); |
| 3194 | 3186 |
| 3195 if (instr->hydrogen()->from_inlined()) { | 3187 if (instr->hydrogen()->from_inlined()) { |
| 3196 __ subi(result, sp, Operand(2 * kPointerSize)); | 3188 __ subi(result, sp, Operand(2 * kPointerSize)); |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4090 hinstr->PointersToHereCheckForValue()); | 4082 hinstr->PointersToHereCheckForValue()); |
| 4091 } | 4083 } |
| 4092 } | 4084 } |
| 4093 | 4085 |
| 4094 | 4086 |
| 4095 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4087 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4096 DCHECK(ToRegister(instr->context()).is(cp)); | 4088 DCHECK(ToRegister(instr->context()).is(cp)); |
| 4097 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4089 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
| 4098 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4090 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
| 4099 | 4091 |
| 4100 if (instr->hydrogen()->HasVectorAndSlot()) { | 4092 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
| 4101 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); | |
| 4102 } | |
| 4103 | 4093 |
| 4104 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4094 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
| 4105 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 4095 Handle<Code> ic = |
| 4106 isolate(), instr->language_mode(), | 4096 CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode()) |
| 4107 instr->hydrogen()->initialization_state()).code(); | 4097 .code(); |
| 4108 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4098 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4109 } | 4099 } |
| 4110 | 4100 |
| 4111 | 4101 |
| 4112 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4102 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 4113 Representation representation = instr->hydrogen()->length()->representation(); | 4103 Representation representation = instr->hydrogen()->length()->representation(); |
| 4114 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); | 4104 DCHECK(representation.Equals(instr->hydrogen()->index()->representation())); |
| 4115 DCHECK(representation.IsSmiOrInteger32()); | 4105 DCHECK(representation.IsSmiOrInteger32()); |
| 4116 | 4106 |
| 4117 Condition cc = instr->hydrogen()->allow_equality() ? lt : le; | 4107 Condition cc = instr->hydrogen()->allow_equality() ? lt : le; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4352 } | 4342 } |
| 4353 } | 4343 } |
| 4354 | 4344 |
| 4355 | 4345 |
| 4356 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4346 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 4357 DCHECK(ToRegister(instr->context()).is(cp)); | 4347 DCHECK(ToRegister(instr->context()).is(cp)); |
| 4358 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4348 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
| 4359 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 4349 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
| 4360 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4350 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
| 4361 | 4351 |
| 4362 if (instr->hydrogen()->HasVectorAndSlot()) { | 4352 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
| 4363 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
| 4364 } | |
| 4365 | 4353 |
| 4366 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 4354 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
| 4367 isolate(), instr->language_mode(), | 4355 isolate(), instr->language_mode()) |
| 4368 instr->hydrogen()->initialization_state()).code(); | 4356 .code(); |
| 4369 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4357 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4370 } | 4358 } |
| 4371 | 4359 |
| 4372 | 4360 |
| 4373 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4361 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
| 4374 class DeferredMaybeGrowElements final : public LDeferredCode { | 4362 class DeferredMaybeGrowElements final : public LDeferredCode { |
| 4375 public: | 4363 public: |
| 4376 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4364 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
| 4377 : LDeferredCode(codegen), instr_(instr) {} | 4365 : LDeferredCode(codegen), instr_(instr) {} |
| 4378 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4366 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5824 __ LoadP(result, | 5812 __ LoadP(result, |
| 5825 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5813 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5826 __ bind(deferred->exit()); | 5814 __ bind(deferred->exit()); |
| 5827 __ bind(&done); | 5815 __ bind(&done); |
| 5828 } | 5816 } |
| 5829 | 5817 |
| 5830 #undef __ | 5818 #undef __ |
| 5831 | 5819 |
| 5832 } // namespace internal | 5820 } // namespace internal |
| 5833 } // namespace v8 | 5821 } // namespace v8 |
| OLD | NEW |