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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10824201: Verify at method exit that stack size is the same as at entry, except for methods with finally clau… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 10341)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -95,6 +95,22 @@
__ popl(temp); // Remove argument.
__ popl(result); // Restore result.
}
+#if defined(DEBUG)
+ // TODO(srdjan): Fix for functions with finally clause.
+ // A finally clause may leave a previously pushed return value if it
+ // has its own return instruction. Method that have finally are currently
+ // not optimized.
+ if (!compiler->HasFinally()) {
+ Label done;
+ __ movl(EDI, EBP);
+ __ subl(EDI, ESP);
+ // + 1 for Pc marker.
+ __ cmpl(EDI, Immediate((compiler->StackSize() + 1) * kWordSize));
+ __ j(EQUAL, &done, Assembler::kNearJump);
+ __ int3();
+ __ Bind(&done);
+ }
+#endif
__ LeaveFrame();
__ ret();

Powered by Google App Engine
This is Rietveld 408576698