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

Unified Diff: runtime/vm/intermediate_language_ia32.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_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 20045)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -83,10 +83,10 @@
if (!compiler->HasFinally()) {
__ Comment("Stack Check");
Label done;
+ const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
__ movl(EDI, EBP);
__ subl(EDI, ESP);
- // + 1 for Pc marker.
- __ cmpl(EDI, Immediate((compiler->StackSize() + 1) * kWordSize));
+ __ cmpl(EDI, Immediate(sp_fp_dist * kWordSize));
__ j(EQUAL, &done, Assembler::kNearJump);
__ int3();
__ Bind(&done);
@@ -1043,10 +1043,10 @@
__ PushObject(Object::ZoneHandle());
// Pass a pointer to the first argument in EAX.
if (!function().HasOptionalParameters()) {
- __ leal(EAX, Address(EBP, (1 + function().NumParameters()) * kWordSize));
+ __ leal(EAX, Address(EBP, (kLastParamSlotIndex +
+ function().NumParameters() - 1) * kWordSize));
} else {
- __ leal(EAX,
- Address(EBP, ParsedFunction::kFirstLocalSlotIndex * kWordSize));
+ __ leal(EAX, Address(EBP, kFirstLocalSlotIndex * kWordSize));
}
__ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function())));
__ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function())));

Powered by Google App Engine
This is Rietveld 408576698