Reviewers: Kevin Millikin,

Description:
Fix broken debug build: Emit code for declarations later into the body block
(and not into the start block).

We hit asserts when trying to insert code into block 0 (start block), so this
change moves the stack check and the declarations into the first body block
(block 1)

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

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/hydrogen.cc


Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc     (revision 9051)
+++ src/hydrogen.cc     (working copy)
@@ -2273,10 +2273,6 @@
       return NULL;
     }
     SetupScope(scope);
-    VisitDeclarations(scope->declarations());
-    HValue* context = environment()->LookupContext();
-    AddInstruction(
-        new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry));

     // Add an edge to the body entry.  This is warty: the graph's start
     // environment will be used by the Lithium translation as the initial
@@ -2298,6 +2294,13 @@
     current_block()->Goto(body_entry);
     body_entry->SetJoinId(AstNode::kFunctionEntryId);
     set_current_block(body_entry);
+
+    VisitDeclarations(scope->declarations());
+
+    HValue* context = environment()->LookupContext();
+    AddInstruction(
+        new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry));
+
     VisitStatements(info()->function()->body());
     if (HasStackOverflow()) return NULL;



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

Reply via email to