OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 LocationSummary* summary = new (zone) | 279 LocationSummary* summary = new (zone) |
280 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 280 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
281 summary->set_in(0, Location::RegisterLocation(T0)); // Function. | 281 summary->set_in(0, Location::RegisterLocation(T0)); // Function. |
282 summary->set_out(0, Location::RegisterLocation(V0)); | 282 summary->set_out(0, Location::RegisterLocation(V0)); |
283 return summary; | 283 return summary; |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 287 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
288 // Load arguments descriptor in S4. | 288 // Load arguments descriptor in S4. |
289 int argument_count = ArgumentCount(); | 289 const intptr_t argument_count = ArgumentCount(); // Includes type args. |
290 const Array& arguments_descriptor = Array::ZoneHandle( | 290 const Array& arguments_descriptor = GetArgumentsDescriptor(Z); |
291 ArgumentsDescriptor::New(argument_count, argument_names())); | |
292 __ LoadObject(S4, arguments_descriptor); | 291 __ LoadObject(S4, arguments_descriptor); |
293 | 292 |
294 // Load closure function code in T2. | 293 // Load closure function code in T2. |
295 // S4: arguments descriptor array. | 294 // S4: arguments descriptor array. |
296 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 295 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
297 ASSERT(locs()->in(0).reg() == T0); | 296 ASSERT(locs()->in(0).reg() == T0); |
298 __ LoadImmediate(S5, 0); | 297 __ LoadImmediate(S5, 0); |
299 __ lw(T2, FieldAddress(T0, Function::entry_point_offset())); | 298 __ lw(T2, FieldAddress(T0, Function::entry_point_offset())); |
300 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); | 299 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
301 __ jalr(T2); | 300 __ jalr(T2); |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 1127 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
1129 summary->set_in(0, Location::RegisterLocation(A0)); | 1128 summary->set_in(0, Location::RegisterLocation(A0)); |
1130 summary->set_out(0, Location::RegisterLocation(V0)); | 1129 summary->set_out(0, Location::RegisterLocation(V0)); |
1131 return summary; | 1130 return summary; |
1132 } | 1131 } |
1133 | 1132 |
1134 | 1133 |
1135 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1134 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1136 Register array = locs()->in(0).reg(); | 1135 Register array = locs()->in(0).reg(); |
1137 __ Push(array); | 1136 __ Push(array); |
| 1137 const int kTypeArgsLen = 0; |
1138 const int kNumberOfArguments = 1; | 1138 const int kNumberOfArguments = 1; |
1139 const Array& kNoArgumentNames = Object::null_array(); | 1139 const Array& kNoArgumentNames = Object::null_array(); |
| 1140 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames); |
1140 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), | 1141 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), |
1141 kNumberOfArguments, kNoArgumentNames, locs(), | 1142 args_info, locs(), ICData::Handle()); |
1142 ICData::Handle()); | |
1143 ASSERT(locs()->out(0).reg() == V0); | 1143 ASSERT(locs()->out(0).reg() == V0); |
1144 } | 1144 } |
1145 | 1145 |
1146 | 1146 |
1147 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, | 1147 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, |
1148 bool opt) const { | 1148 bool opt) const { |
1149 const intptr_t kNumInputs = 1; | 1149 const intptr_t kNumInputs = 1; |
1150 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), | 1150 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), |
1151 LocationSummary::kNoCall); | 1151 LocationSummary::kNoCall); |
1152 } | 1152 } |
(...skipping 3521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4674 __ subu(CMPRES1, result, TMP); | 4674 __ subu(CMPRES1, result, TMP); |
4675 __ bltz(CMPRES1, &do_call); | 4675 __ bltz(CMPRES1, &do_call); |
4676 __ SmiTag(result); | 4676 __ SmiTag(result); |
4677 __ b(&done); | 4677 __ b(&done); |
4678 __ Bind(&do_call); | 4678 __ Bind(&do_call); |
4679 __ Push(value_obj); | 4679 __ Push(value_obj); |
4680 ASSERT(instance_call()->HasICData()); | 4680 ASSERT(instance_call()->HasICData()); |
4681 const ICData& ic_data = *instance_call()->ic_data(); | 4681 const ICData& ic_data = *instance_call()->ic_data(); |
4682 ASSERT(ic_data.NumberOfChecksIs(1)); | 4682 ASSERT(ic_data.NumberOfChecksIs(1)); |
4683 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); | 4683 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); |
4684 | 4684 const int kTypeArgsLen = 0; |
4685 const intptr_t kNumberOfArguments = 1; | 4685 const int kNumberOfArguments = 1; |
| 4686 const Array& kNoArgumentNames = Object::null_array(); |
| 4687 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames); |
4686 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, | 4688 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, |
4687 kNumberOfArguments, | 4689 args_info, locs(), ICData::Handle()); |
4688 Object::null_array(), // No argument names. | |
4689 locs(), ICData::Handle()); | |
4690 __ Bind(&done); | 4690 __ Bind(&done); |
4691 } | 4691 } |
4692 | 4692 |
4693 | 4693 |
4694 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, | 4694 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, |
4695 bool opt) const { | 4695 bool opt) const { |
4696 const intptr_t kNumInputs = 1; | 4696 const intptr_t kNumInputs = 1; |
4697 const intptr_t kNumTemps = 0; | 4697 const intptr_t kNumTemps = 0; |
4698 LocationSummary* result = new (zone) | 4698 LocationSummary* result = new (zone) |
4699 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4699 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6108 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6108 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
6109 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6109 kGrowRegExpStackRuntimeEntry, 1, locs()); |
6110 __ lw(result, Address(SP, 1 * kWordSize)); | 6110 __ lw(result, Address(SP, 1 * kWordSize)); |
6111 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 6111 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
6112 } | 6112 } |
6113 | 6113 |
6114 | 6114 |
6115 } // namespace dart | 6115 } // namespace dart |
6116 | 6116 |
6117 #endif // defined TARGET_ARCH_MIPS | 6117 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |