| 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 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 | 2701 |
| 2702 | 2702 |
| 2703 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2703 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2704 DCHECK(ToRegister(instr->context()).is(cp)); | 2704 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2705 DCHECK(ToRegister(instr->global_object()) | 2705 DCHECK(ToRegister(instr->global_object()) |
| 2706 .is(LoadDescriptor::ReceiverRegister())); | 2706 .is(LoadDescriptor::ReceiverRegister())); |
| 2707 DCHECK(ToRegister(instr->result()).is(v0)); | 2707 DCHECK(ToRegister(instr->result()).is(v0)); |
| 2708 | 2708 |
| 2709 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2709 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
| 2710 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2710 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2711 Handle<Code> ic = | 2711 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 2712 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2712 isolate(), instr->typeof_mode(), PREMONOMORPHIC) |
| 2713 SLOPPY, PREMONOMORPHIC).code(); | 2713 .code(); |
| 2714 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2714 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2715 } | 2715 } |
| 2716 | 2716 |
| 2717 | 2717 |
| 2718 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2718 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2719 Register context = ToRegister(instr->context()); | 2719 Register context = ToRegister(instr->context()); |
| 2720 Register result = ToRegister(instr->result()); | 2720 Register result = ToRegister(instr->result()); |
| 2721 | 2721 |
| 2722 __ ld(result, ContextMemOperand(context, instr->slot_index())); | 2722 __ ld(result, ContextMemOperand(context, instr->slot_index())); |
| 2723 if (instr->hydrogen()->RequiresHoleCheck()) { | 2723 if (instr->hydrogen()->RequiresHoleCheck()) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2817 | 2817 |
| 2818 | 2818 |
| 2819 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2819 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2820 DCHECK(ToRegister(instr->context()).is(cp)); | 2820 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2821 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2821 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 2822 DCHECK(ToRegister(instr->result()).is(v0)); | 2822 DCHECK(ToRegister(instr->result()).is(v0)); |
| 2823 | 2823 |
| 2824 // Name is always in a2. | 2824 // Name is always in a2. |
| 2825 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2825 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
| 2826 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2826 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 2827 Handle<Code> ic = | 2827 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 2828 CodeFactory::LoadICInOptimizedCode( | 2828 isolate(), NOT_INSIDE_TYPEOF, |
| 2829 isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(), | 2829 instr->hydrogen()->initialization_state()) |
| 2830 instr->hydrogen()->initialization_state()).code(); | 2830 .code(); |
| 2831 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2831 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2832 } | 2832 } |
| 2833 | 2833 |
| 2834 | 2834 |
| 2835 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2835 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2836 Register scratch = scratch0(); | 2836 Register scratch = scratch0(); |
| 2837 Register function = ToRegister(instr->function()); | 2837 Register function = ToRegister(instr->function()); |
| 2838 Register result = ToRegister(instr->result()); | 2838 Register result = ToRegister(instr->result()); |
| 2839 | 2839 |
| 2840 // Get the prototype or initial map from the function. | 2840 // Get the prototype or initial map from the function. |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3174 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 3175 DCHECK(ToRegister(instr->context()).is(cp)); | 3175 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3176 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3176 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3177 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3177 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
| 3178 | 3178 |
| 3179 if (instr->hydrogen()->HasVectorAndSlot()) { | 3179 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 3180 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3180 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
| 3181 } | 3181 } |
| 3182 | 3182 |
| 3183 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3183 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
| 3184 isolate(), instr->hydrogen()->language_mode(), | 3184 isolate(), instr->hydrogen()->initialization_state()) |
| 3185 instr->hydrogen()->initialization_state()).code(); | 3185 .code(); |
| 3186 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3186 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3187 } | 3187 } |
| 3188 | 3188 |
| 3189 | 3189 |
| 3190 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3190 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3191 Register scratch = scratch0(); | 3191 Register scratch = scratch0(); |
| 3192 Register temp = scratch1(); | 3192 Register temp = scratch1(); |
| 3193 Register result = ToRegister(instr->result()); | 3193 Register result = ToRegister(instr->result()); |
| 3194 | 3194 |
| 3195 if (instr->hydrogen()->from_inlined()) { | 3195 if (instr->hydrogen()->from_inlined()) { |
| (...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5777 __ Push(at, ToRegister(instr->function())); | 5777 __ Push(at, ToRegister(instr->function())); |
| 5778 CallRuntime(Runtime::kPushBlockContext, instr); | 5778 CallRuntime(Runtime::kPushBlockContext, instr); |
| 5779 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5779 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5780 } | 5780 } |
| 5781 | 5781 |
| 5782 | 5782 |
| 5783 #undef __ | 5783 #undef __ |
| 5784 | 5784 |
| 5785 } // namespace internal | 5785 } // namespace internal |
| 5786 } // namespace v8 | 5786 } // namespace v8 |
| OLD | NEW |