Revision: 12093
Author:   [email protected]
Date:     Mon Jul 16 05:22:46 2012
Log: Maintain the invariant that all HGraphBuilder::VisitFoo methods return void.

Additionally, this enables the use of a CHECK_ALIVE macro instead of
copy-n-paste code at one place.

This CL is part of a series of several yak-shaving CLs to prepare the inlining
of JavaScript accessors.

Review URL: https://chromiumcodereview.appspot.com/10783017
http://code.google.com/p/v8/source/detail?r=12093

Modified:
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/hydrogen.h

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Mon Jul 16 02:49:00 2012
+++ /branches/bleeding_edge/src/hydrogen.cc     Mon Jul 16 05:22:46 2012
@@ -2992,12 +2992,9 @@
 }


-HValue* HGraphBuilder::VisitArgument(Expression* expr) {
-  VisitForValue(expr);
-  if (HasStackOverflow() || current_block() == NULL) return NULL;
-  HValue* value = Pop();
-  Push(AddInstruction(new(zone()) HPushArgument(value)));
-  return value;
+void HGraphBuilder::VisitArgument(Expression* expr) {
+  CHECK_ALIVE(VisitForValue(expr));
+  Push(AddInstruction(new(zone()) HPushArgument(Pop())));
 }


@@ -7450,8 +7447,8 @@
   } else {
// The constructor function is both an operand to the instruction and an
     // argument to the construct call.
-    HValue* constructor = NULL;
-    CHECK_ALIVE(constructor = VisitArgument(expr->expression()));
+    CHECK_ALIVE(VisitArgument(expr->expression()));
+    HValue* constructor = HPushArgument::cast(Top())->argument();
     CHECK_ALIVE(VisitArgumentList(expr->arguments()));
     HInstruction* call =
         new(zone()) HCallNew(context, constructor, argument_count);
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Fri Jul 13 00:14:28 2012
+++ /branches/bleeding_edge/src/hydrogen.h      Mon Jul 16 05:22:46 2012
@@ -976,9 +976,8 @@
                        HBasicBlock* true_block,
                        HBasicBlock* false_block);

-  // Visit an argument subexpression and emit a push to the outgoing
-  // arguments.  Returns the hydrogen value that was pushed.
-  HValue* VisitArgument(Expression* expr);
+ // Visit an argument subexpression and emit a push to the outgoing arguments.
+  void VisitArgument(Expression* expr);

   void VisitArgumentList(ZoneList<Expression*>* arguments);

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

Reply via email to