Reviewers: Kevin Millikin,

Message:
Added two spills.  Are they necessary?

Description:
Small change to uses of reference: adds two more frame spills after
reference unloads.

Please review this at http://codereview.chromium.org/17231

SVN Base: http://v8.googlecode.com/svn/branches/experimental/toiger/

Affected files:
   M     src/codegen-ia32.cc


Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1034)
+++ src/codegen-ia32.cc (working copy)
@@ -2288,6 +2288,8 @@

    // Remove the exception from the stack.
    frame_->Drop();
+  // Dropping a reference can leave the stack in an unspilled state.
+  frame_->SpillAll();

    VisitStatementsAndSpill(node->catch_block()->statements());
    if (has_valid_frame()) {
@@ -3076,7 +3078,7 @@
          var->mode() == Variable::CONST &&
          node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) {
        // Assignment ignored - leave the value on the stack.
-  } else {
+    } else {
        CodeForSourcePosition(node->position());
        if (node->op() == Token::INIT_CONST) {
          // Dynamic constant initializations must use the function context
@@ -3227,6 +3229,9 @@
        // Call the function.
        CallWithArguments(args, node->position());
      }
+    // Needed because of the Reference destructor in the else case.
+    // Does nothing in the then case.
+    frame_->SpillAll();

    } else {
      // ----------------------------------



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to