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

Unified Diff: runtime/vm/intermediate_language_ia32.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_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 21707)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -84,10 +84,12 @@
if (!compiler->HasFinally()) {
__ Comment("Stack Check");
Label done;
- const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
- __ movl(EDI, EBP);
- __ subl(EDI, ESP);
- __ cmpl(EDI, Immediate(sp_fp_dist * kWordSize));
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ movl(EDI, ESP);
+ __ subl(EDI, EBP);
+ __ cmpl(EDI, Immediate(fp_sp_dist));
__ j(EQUAL, &done, Assembler::kNearJump);
__ int3();
__ Bind(&done);
@@ -2103,13 +2105,12 @@
// Restore stack and initialize the two exception variables:
// exception and stack trace variables.
void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- // Restore RSP from RBP as we are coming from a throw and the code for
+ // Restore ESP from EBP 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;
- __ leal(ESP, Address(EBP, offset_size));
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ leal(ESP, Address(EBP, fp_sp_dist));
ASSERT(!exception_var().is_captured());
ASSERT(!stacktrace_var().is_captured());
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698