Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ta_len = type_args_len();
290 const Array& arguments_descriptor = Array::ZoneHandle( 290 const intptr_t argument_count = ArgumentCount(); // Includes type args.
291 ArgumentsDescriptor::New(argument_count, argument_names())); 291 const Array& arguments_descriptor =
292 Array::ZoneHandle(ArgumentsDescriptor::New(
293 ta_len, argument_count - (ta_len > 0 ? 1 : 0), argument_names()));
292 __ LoadObject(S4, arguments_descriptor); 294 __ LoadObject(S4, arguments_descriptor);
293 295
294 // Load closure function code in T2. 296 // Load closure function code in T2.
295 // S4: arguments descriptor array. 297 // S4: arguments descriptor array.
296 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). 298 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
297 ASSERT(locs()->in(0).reg() == T0); 299 ASSERT(locs()->in(0).reg() == T0);
298 __ LoadImmediate(S5, 0); 300 __ LoadImmediate(S5, 0);
299 __ lw(T2, FieldAddress(T0, Function::entry_point_offset())); 301 __ lw(T2, FieldAddress(T0, Function::entry_point_offset()));
300 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); 302 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
301 __ jalr(T2); 303 __ jalr(T2);
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); 1130 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
1129 summary->set_in(0, Location::RegisterLocation(A0)); 1131 summary->set_in(0, Location::RegisterLocation(A0));
1130 summary->set_out(0, Location::RegisterLocation(V0)); 1132 summary->set_out(0, Location::RegisterLocation(V0));
1131 return summary; 1133 return summary;
1132 } 1134 }
1133 1135
1134 1136
1135 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1137 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1136 Register array = locs()->in(0).reg(); 1138 Register array = locs()->in(0).reg();
1137 __ Push(array); 1139 __ Push(array);
1138 const int kNumberOfArguments = 1; 1140 const intptr_t kTypeArgsLen = 0;
1141 const intptr_t kNumberOfArguments = 1;
1139 const Array& kNoArgumentNames = Object::null_array(); 1142 const Array& kNoArgumentNames = Object::null_array();
1140 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), 1143 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
1141 kNumberOfArguments, kNoArgumentNames, locs(), 1144 kTypeArgsLen, kNumberOfArguments,
1142 ICData::Handle()); 1145 kNoArgumentNames, locs(), ICData::Handle());
1143 ASSERT(locs()->out(0).reg() == V0); 1146 ASSERT(locs()->out(0).reg() == V0);
1144 } 1147 }
1145 1148
1146 1149
1147 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, 1150 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
1148 bool opt) const { 1151 bool opt) const {
1149 const intptr_t kNumInputs = 1; 1152 const intptr_t kNumInputs = 1;
1150 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), 1153 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
1151 LocationSummary::kNoCall); 1154 LocationSummary::kNoCall);
1152 } 1155 }
(...skipping 3522 matching lines...) Expand 10 before | Expand all | Expand 10 after
4675 __ bltz(CMPRES1, &do_call); 4678 __ bltz(CMPRES1, &do_call);
4676 __ SmiTag(result); 4679 __ SmiTag(result);
4677 __ b(&done); 4680 __ b(&done);
4678 __ Bind(&do_call); 4681 __ Bind(&do_call);
4679 __ Push(value_obj); 4682 __ Push(value_obj);
4680 ASSERT(instance_call()->HasICData()); 4683 ASSERT(instance_call()->HasICData());
4681 const ICData& ic_data = *instance_call()->ic_data(); 4684 const ICData& ic_data = *instance_call()->ic_data();
4682 ASSERT(ic_data.NumberOfChecksIs(1)); 4685 ASSERT(ic_data.NumberOfChecksIs(1));
4683 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); 4686 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
4684 4687
4688 const intptr_t kTypeArgsLen = 0;
4685 const intptr_t kNumberOfArguments = 1; 4689 const intptr_t kNumberOfArguments = 1;
4686 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, 4690 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
4687 kNumberOfArguments, 4691 kTypeArgsLen, kNumberOfArguments,
4688 Object::null_array(), // No argument names. 4692 Object::null_array(), // No argument names.
4689 locs(), ICData::Handle()); 4693 locs(), ICData::Handle());
4690 __ Bind(&done); 4694 __ Bind(&done);
4691 } 4695 }
4692 4696
4693 4697
4694 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, 4698 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
4695 bool opt) const { 4699 bool opt) const {
4696 const intptr_t kNumInputs = 1; 4700 const intptr_t kNumInputs = 1;
4697 const intptr_t kNumTemps = 0; 4701 const intptr_t kNumTemps = 0;
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
6108 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 6112 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
6109 kGrowRegExpStackRuntimeEntry, 1, locs()); 6113 kGrowRegExpStackRuntimeEntry, 1, locs());
6110 __ lw(result, Address(SP, 1 * kWordSize)); 6114 __ lw(result, Address(SP, 1 * kWordSize));
6111 __ addiu(SP, SP, Immediate(2 * kWordSize)); 6115 __ addiu(SP, SP, Immediate(2 * kWordSize));
6112 } 6116 }
6113 6117
6114 6118
6115 } // namespace dart 6119 } // namespace dart
6116 6120
6117 #endif // defined TARGET_ARCH_MIPS 6121 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698