| 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());
|
|
|