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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 12663024: Implement optional parameter handling in ARM 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 20390)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -34,13 +34,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());
+ __ ldr(IP, value.ToStackSlotAddress());
+ __ Push(IP);
+ }
+ }
}
@@ -106,13 +123,17 @@
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.
+ __ str(value, Address(FP, local().index() * kWordSize));
}
@@ -133,8 +154,15 @@
LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ const intptr_t kNumInputs = 3;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+ summary->set_in(0, Location::RegisterLocation(R0)); // Value.
+ summary->set_in(1, Location::RegisterLocation(R1)); // Instantiator.
+ summary->set_in(2, Location::RegisterLocation(R2)); // Type arguments.
+ summary->set_out(Location::RegisterLocation(R0));
+ return summary;
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698