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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 13474009: Implements optional parameter handling in MIPS vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language_mips.cc
===================================================================
--- runtime/vm/intermediate_language_mips.cc (revision 20887)
+++ runtime/vm/intermediate_language_mips.cc (working copy)
@@ -33,13 +33,30 @@
LocationSummary* PushArgumentInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps= 0;
+ LocationSummary* locs =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ locs->set_in(0, Location::AnyOrConstant(value()));
+ return locs;
}
void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
+ // where PushArgument is handled by BindInstr::EmitNativeCode.
+ if (compiler->is_optimizing()) {
+ Location value = locs()->in(0);
+ if (value.IsRegister()) {
+ __ Push(value.reg());
+ } else if (value.IsConstant()) {
+ __ PushObject(value.constant());
+ } else {
+ ASSERT(value.IsStackSlot());
+ __ lw(TMP, value.ToStackSlotAddress());
+ __ Push(TMP);
+ }
+ }
}
@@ -97,24 +114,30 @@
LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ return LocationSummary::Make(0,
+ Location::RequiresRegister(),
+ LocationSummary::kNoCall);
}
void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ Register result = locs()->out().reg();
+ __ lw(result, Address(FP, local().index() * kWordSize));
}
LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ return LocationSummary::Make(1,
+ Location::SameAsFirstInput(),
+ LocationSummary::kNoCall);
}
void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ Register value = locs()->in(0).reg();
+ Register result = locs()->out().reg();
+ ASSERT(result == value); // Assert that register assignment is correct.
+ __ sw(value, Address(FP, local().index() * kWordSize));
}
« runtime/vm/flow_graph_compiler_mips.cc ('K') | « runtime/vm/flow_graph_compiler_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698