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

Unified Diff: runtime/vm/intermediate_language_x64.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_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 20045)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -81,11 +81,12 @@
// has its own return instruction. Method that have finally are currently
// not optimized.
if (!compiler->HasFinally()) {
+ __ Comment("Stack Check");
Label done;
+ const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
__ movq(RDI, RBP);
__ subq(RDI, RSP);
- // + 1 for Pc marker.
- __ cmpq(RDI, Immediate((compiler->StackSize() + 1) * kWordSize));
+ __ cmpq(RDI, Immediate(sp_fp_dist * kWordSize));
__ j(EQUAL, &done, Assembler::kNearJump);
__ int3();
__ Bind(&done);
@@ -908,10 +909,11 @@
__ PushObject(Object::ZoneHandle());
// Pass a pointer to the first argument in RAX.
if (!function().HasOptionalParameters()) {
- __ leaq(RAX, Address(RBP, (1 + function().NumParameters()) * kWordSize));
+ __ leaq(RAX, Address(RBP, (kLastParamSlotIndex +
+ function().NumParameters() - 1) * kWordSize));
} else {
__ leaq(RAX,
- Address(RBP, ParsedFunction::kFirstLocalSlotIndex * kWordSize));
+ Address(RBP, kFirstLocalSlotIndex * kWordSize));
}
__ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function())));
__ movq(R10, Immediate(NativeArguments::ComputeArgcTag(function())));

Powered by Google App Engine
This is Rietveld 408576698