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

Unified Diff: src/codegen-ia32.cc

Issue 5626: Get rid of the local variable we use to keep the state... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « src/codegen-arm.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 400)
+++ src/codegen-ia32.cc (working copy)
@@ -3558,38 +3558,22 @@
// --- Finally block ---
__ bind(&finally_block);
- // We keep a single element on the stack - the (possibly faked)
- // result - while evaluating the finally block. Record it, so that a
- // break/continue crossing this statement can restore the stack.
- const int kFinallyStackSize = 1 * kPointerSize;
- break_stack_height_ += kFinallyStackSize;
-
- // Push the state on the stack. If necessary move the state to a
- // local variable to avoid having extra values on the stack while
- // evaluating the finally block.
+ // Push the state on the stack.
__ push(ecx);
- if (node->finally_var() != NULL) {
- Reference target(this, node->finally_var());
- SetValue(&target);
- ASSERT(target.size() == 0); // no extra stuff on the stack
- __ pop(edx); // remove the extra value that was pushed above
- }
+ // We keep two elements on the stack - the (possibly faked) result
+ // and the state - while evaluating the finally block. Record it, so
+ // that a break/continue crossing this statement can restore the
+ // stack.
+ const int kFinallyStackSize = 2 * kPointerSize;
+ break_stack_height_ += kFinallyStackSize;
+
// Generate code for the statements in the finally block.
VisitStatements(node->finally_block()->statements());
- // Get the state from the stack - or the local variable - and
- // restore the TOS register.
- if (node->finally_var() != NULL) {
- Reference target(this, node->finally_var());
- GetValue(&target);
- }
+ // Restore state and return value or faked TOS.
__ pop(ecx);
-
- // Restore return value or faked TOS.
__ pop(eax);
-
- // Record the fact that the result has been removed from the stack.
break_stack_height_ -= kFinallyStackSize;
// Generate code that jumps to the right destination for all used
« no previous file with comments | « src/codegen-arm.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698