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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 12776006: Make allocation of Dart parameters and local variables architecture independent. (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_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 20045)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -66,9 +66,10 @@
// has its own return instruction. Method that have finally are currently
// not optimized.
if (!compiler->HasFinally()) {
+ __ Comment("Stack Check");
+ const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
__ sub(R2, FP, ShifterOperand(SP));
- // + 1 for saved PP.
- __ CompareImmediate(R2, (compiler->StackSize() + 1) * kWordSize);
+ __ CompareImmediate(R2, sp_fp_dist * kWordSize);
__ bkpt(0, NE);
}
#endif
@@ -92,13 +93,15 @@
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();
+ __ LoadFromOffset(kLoadWord, result, FP, local().index() * kWordSize);
}
@@ -214,9 +217,10 @@
__ PushObject(Object::ZoneHandle());
// Pass a pointer to the first argument in R2.
if (!function().HasOptionalParameters()) {
- __ AddImmediate(R2, FP, (2 + function().NumParameters()) * kWordSize);
+ __ AddImmediate(R2, FP, (kLastParamSlotIndex +
+ function().NumParameters() - 1) * kWordSize);
} else {
- __ AddImmediate(R2, FP, ParsedFunction::kFirstLocalSlotIndex * kWordSize);
+ __ AddImmediate(R2, FP, kFirstLocalSlotIndex * kWordSize);
}
// Compute the effective address. When running under the simulator,
// this is a redirection address that forces the simulator to call

Powered by Google App Engine
This is Rietveld 408576698