Revision: 17339
Author:   [email protected]
Date:     Wed Oct 23 12:34:39 2013 UTC
Log:      PushAndAdd() usages refactored.

[email protected]

Review URL: https://codereview.chromium.org/36893002
http://code.google.com/p/v8/source/detail?r=17339

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

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Oct 23 10:41:21 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed Oct 23 12:34:39 2013 UTC
@@ -3213,12 +3213,6 @@
     }
   }
 }
-
-
-void HGraphBuilder::PushAndAdd(HInstruction* instr) {
-  Push(instr);
-  AddInstruction(instr);
-}


 template <class Instruction>
@@ -3898,9 +3892,7 @@
     set_current_block(body_exit);

     HValue* current_index = Pop();
-    HInstruction* new_index = New<HAdd>(current_index,
-                                        graph()->GetConstant1());
-    PushAndAdd(new_index);
+    Push(Add<HAdd>(current_index, graph()->GetConstant1()));
     body_exit = current_block();
   }

@@ -5327,7 +5319,8 @@
     HValue* left = Pop();

     HInstruction* instr = BuildBinaryOperation(operation, left, right);
-    PushAndAdd(instr);
+    AddInstruction(instr);
+    Push(instr);
     if (instr->HasObservableSideEffects()) {
       Add<HSimulate>(operation->id(), REMOVABLE_SIMULATE);
     }
@@ -6962,9 +6955,9 @@
     }

     Drop(arguments_count - 1);
-    PushAndAdd(New<HPushArgument>(Pop()));
+    Push(Add<HPushArgument>(Pop()));
     for (int i = 1; i < arguments_count; i++) {
-      PushAndAdd(New<HPushArgument>(arguments_values->at(i)));
+      Push(Add<HPushArgument>(arguments_values->at(i)));
     }

     HInvokeFunction* call = New<HInvokeFunction>(function,
@@ -7077,8 +7070,8 @@
       if (known_global_function) {
         // Push the global object instead of the global receiver because
         // code generated by the full code generator expects it.
-        HGlobalObject* global_object = New<HGlobalObject>();
-        PushAndAdd(global_object);
+        HGlobalObject* global_object = Add<HGlobalObject>();
+        Push(global_object);
         CHECK_ALIVE(VisitExpressions(expr->arguments()));

         CHECK_ALIVE(VisitForValue(expr->expression()));
@@ -7117,7 +7110,7 @@
         }
       } else {
         HGlobalObject* receiver = Add<HGlobalObject>();
-        PushAndAdd(New<HPushArgument>(receiver));
+        Push(Add<HPushArgument>(receiver));
         CHECK_ALIVE(VisitArgumentList(expr->arguments()));

         call = New<HCallGlobal>(var->name(), argument_count);
@@ -7130,8 +7123,8 @@
       CHECK_ALIVE(VisitForValue(expr->expression()));
       HValue* function = Top();
       HGlobalObject* global = Add<HGlobalObject>();
-      HGlobalReceiver* receiver = New<HGlobalReceiver>(global);
-      PushAndAdd(receiver);
+      HGlobalReceiver* receiver = Add<HGlobalReceiver>(global);
+      Push(receiver);
       CHECK_ALIVE(VisitExpressions(expr->arguments()));
       Add<HCheckValue>(function, expr->target());

@@ -7157,7 +7150,7 @@
       HValue* function = Top();
       HGlobalObject* global_object = Add<HGlobalObject>();
       HGlobalReceiver* receiver = Add<HGlobalReceiver>(global_object);
-      PushAndAdd(New<HPushArgument>(receiver));
+      Push(Add<HPushArgument>(receiver));
       CHECK_ALIVE(VisitArgumentList(expr->arguments()));

       call = New<HCallFunction>(function, argument_count);
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Tue Oct 22 11:29:05 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.h      Wed Oct 23 12:34:39 2013 UTC
@@ -1309,8 +1309,6 @@
   HValue* EnforceNumberType(HValue* number, Handle<Type> expected);
   HValue* TruncateToNumber(HValue* value, Handle<Type>* expected);

-  void PushAndAdd(HInstruction* instr);
-
   void FinishExitWithHardDeoptimization(const char* reason,
                                         HBasicBlock* continuation);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to