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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 14362008: Implement catch on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 21707)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -84,10 +84,12 @@
if (!compiler->HasFinally()) {
__ Comment("Stack Check");
Label done;
- const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
- __ movq(RDI, RBP);
- __ subq(RDI, RSP);
- __ cmpq(RDI, Immediate(sp_fp_dist * kWordSize));
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ movq(RDI, RSP);
+ __ subq(RDI, RBP);
+ __ cmpq(RDI, Immediate(fp_sp_dist));
__ j(EQUAL, &done, Assembler::kNearJump);
__ int3();
__ Bind(&done);
@@ -2071,11 +2073,10 @@
void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Restore RSP from RBP as we are coming from a throw and the code for
// popping arguments has not been run.
- const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
- ASSERT(locals_space_size >= 0);
- const intptr_t offset_size =
- -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP;
- __ leaq(RSP, Address(RBP, offset_size));
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ leaq(RSP, Address(RBP, fp_sp_dist));
ASSERT(!exception_var().is_captured());
ASSERT(!stacktrace_var().is_captured());
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698