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 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2856 | 2856 |
2857 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2857 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2858 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2858 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2859 Handle<Code> ic = | 2859 Handle<Code> ic = |
2860 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2860 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
2861 SLOPPY, PREMONOMORPHIC).code(); | 2861 SLOPPY, PREMONOMORPHIC).code(); |
2862 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2862 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2863 } | 2863 } |
2864 | 2864 |
2865 | 2865 |
2866 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | |
2867 DCHECK(ToRegister(instr->context()).is(cp)); | |
2868 DCHECK(ToRegister(instr->result()).is(v0)); | |
2869 | |
2870 int const slot = instr->slot_index(); | |
2871 int const depth = instr->depth(); | |
2872 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | |
2873 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
2874 Handle<Code> stub = | |
2875 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | |
2876 CallCode(stub, RelocInfo::CODE_TARGET, instr); | |
2877 } else { | |
2878 __ Push(Smi::FromInt(slot)); | |
2879 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
2880 } | |
2881 } | |
2882 | |
2883 | |
2884 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2866 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2885 Register context = ToRegister(instr->context()); | 2867 Register context = ToRegister(instr->context()); |
2886 Register result = ToRegister(instr->result()); | 2868 Register result = ToRegister(instr->result()); |
2887 | 2869 |
2888 __ ld(result, ContextOperand(context, instr->slot_index())); | 2870 __ ld(result, ContextOperand(context, instr->slot_index())); |
2889 if (instr->hydrogen()->RequiresHoleCheck()) { | 2871 if (instr->hydrogen()->RequiresHoleCheck()) { |
2890 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2872 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2891 | 2873 |
2892 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2874 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2893 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); | 2875 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4237 } | 4219 } |
4238 | 4220 |
4239 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4221 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4240 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 4222 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
4241 isolate(), instr->language_mode(), | 4223 isolate(), instr->language_mode(), |
4242 instr->hydrogen()->initialization_state()).code(); | 4224 instr->hydrogen()->initialization_state()).code(); |
4243 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4225 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4244 } | 4226 } |
4245 | 4227 |
4246 | 4228 |
4247 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | |
4248 DCHECK(ToRegister(instr->context()).is(cp)); | |
4249 DCHECK(ToRegister(instr->value()) | |
4250 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | |
4251 | |
4252 int const slot = instr->slot_index(); | |
4253 int const depth = instr->depth(); | |
4254 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | |
4255 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
4256 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | |
4257 isolate(), depth, instr->language_mode()) | |
4258 .code(); | |
4259 CallCode(stub, RelocInfo::CODE_TARGET, instr); | |
4260 } else { | |
4261 __ Push(Smi::FromInt(slot)); | |
4262 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | |
4263 __ CallRuntime(is_strict(language_mode()) | |
4264 ? Runtime::kStoreGlobalViaContext_Strict | |
4265 : Runtime::kStoreGlobalViaContext_Sloppy, | |
4266 2); | |
4267 } | |
4268 } | |
4269 | |
4270 | |
4271 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4229 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4272 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4230 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4273 Operand operand((int64_t)0); | 4231 Operand operand((int64_t)0); |
4274 Register reg; | 4232 Register reg; |
4275 if (instr->index()->IsConstantOperand()) { | 4233 if (instr->index()->IsConstantOperand()) { |
4276 operand = ToOperand(instr->index()); | 4234 operand = ToOperand(instr->index()); |
4277 reg = ToRegister(instr->length()); | 4235 reg = ToRegister(instr->length()); |
4278 cc = CommuteCondition(cc); | 4236 cc = CommuteCondition(cc); |
4279 } else { | 4237 } else { |
4280 reg = ToRegister(instr->index()); | 4238 reg = ToRegister(instr->index()); |
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6076 __ Push(at, ToRegister(instr->function())); | 6034 __ Push(at, ToRegister(instr->function())); |
6077 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6035 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6078 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6036 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6079 } | 6037 } |
6080 | 6038 |
6081 | 6039 |
6082 #undef __ | 6040 #undef __ |
6083 | 6041 |
6084 } // namespace internal | 6042 } // namespace internal |
6085 } // namespace v8 | 6043 } // namespace v8 |
OLD | NEW |