Revision: 16853
Author:   [email protected]
Date:     Fri Sep 20 09:25:10 2013 UTC
Log:      Use New<> constructors in BuildBinaryOperation.

BUG=
[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Sep 20 07:21:30 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Sep 20 09:25:10 2013 UTC
@@ -4961,9 +4961,11 @@

 class HRor V8_FINAL : public HBitwiseBinaryOperation {
  public:
-  HRor(HValue* context, HValue* left, HValue* right)
-       : HBitwiseBinaryOperation(context, left, right) {
-    ChangeRepresentation(Representation::Integer32());
+  static HInstruction* New(Zone* zone,
+                           HValue* context,
+                           HValue* left,
+                           HValue* right) {
+    return new(zone) HRor(context, left, right);
   }

   virtual void UpdateRepresentation(Representation new_rep,
@@ -4977,6 +4979,12 @@

  protected:
   virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
+
+ private:
+  HRor(HValue* context, HValue* left, HValue* right)
+       : HBitwiseBinaryOperation(context, left, right) {
+    ChangeRepresentation(Representation::Integer32());
+  }
 };


=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Fri Sep 20 08:34:23 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Fri Sep 20 09:25:10 2013 UTC
@@ -7714,14 +7714,13 @@
     BinaryOperation* expr,
     HValue* left,
     HValue* right) {
-  HValue* context = environment()->context();
   Handle<Type> left_type = expr->left()->bounds().lower;
   Handle<Type> right_type = expr->right()->bounds().lower;
   Handle<Type> result_type = expr->bounds().lower;
   Maybe<int> fixed_right_arg = expr->fixed_right_arg();

   return HGraphBuilder::BuildBinaryOperation(expr->op(), left, right,
-      left_type, right_type, result_type, fixed_right_arg, context);
+      left_type, right_type, result_type, fixed_right_arg);
 }


@@ -7732,8 +7731,7 @@
     Handle<Type> left_type,
     Handle<Type> right_type,
     Handle<Type> result_type,
-    Maybe<int> fixed_right_arg,
-    HValue* context) {
+    Maybe<int> fixed_right_arg) {

   Representation left_rep = Representation::FromType(left_type);
   Representation right_rep = Representation::FromType(right_type);
@@ -7784,22 +7782,22 @@
           flags = (flags == STRING_ADD_CHECK_BOTH)
               ? STRING_ADD_CHECK_LEFT : STRING_ADD_CHECK_NONE;
         }
-        instr = HStringAdd::New(zone(), context, left, right, flags);
+        instr = NewUncasted<HStringAdd>(left, right, flags);
       } else {
-        instr = HAdd::New(zone(), context, left, right);
+        instr = NewUncasted<HAdd>(left, right);
       }
       break;
     case Token::SUB:
-      instr = HSub::New(zone(), context, left, right);
+      instr = NewUncasted<HSub>(left, right);
       break;
     case Token::MUL:
-      instr = HMul::New(zone(), context, left, right);
+      instr = NewUncasted<HMul>(left, right);
       break;
     case Token::MOD:
-      instr = HMod::New(zone(), context, left, right, fixed_right_arg);
+      instr = NewUncasted<HMod>(left, right, fixed_right_arg);
       break;
     case Token::DIV:
-      instr = HDiv::New(zone(), context, left, right);
+      instr = NewUncasted<HDiv>(left, right);
       break;
     case Token::BIT_XOR:
     case Token::BIT_AND:
@@ -7810,24 +7808,24 @@
       if (left_type->Is(Type::Signed32()) &&
           right_type->Is(Type::Signed32()) &&
           MatchRotateRight(left, right, &operand, &shift_amount)) {
-        instr = new(zone()) HRor(context, operand, shift_amount);
+        instr = NewUncasted<HRor>(operand, shift_amount);
       } else {
         instr = NewUncasted<HBitwise>(op, left, right);
       }
       break;
     }
     case Token::SAR:
-      instr = HSar::New(zone(), context, left, right);
+      instr = NewUncasted<HSar>(left, right);
       break;
     case Token::SHR:
-      instr = HShr::New(zone(), context, left, right);
+      instr = NewUncasted<HShr>(left, right);
       if (FLAG_opt_safe_uint32_operations && instr->IsShr() &&
           CanBeZero(right)) {
         graph()->RecordUint32Instruction(instr);
       }
       break;
     case Token::SHL:
-      instr = HShl::New(zone(), context, left, right);
+      instr = NewUncasted<HShl>(left, right);
       break;
     default:
       UNREACHABLE();
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Fri Sep 20 07:21:30 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.h      Fri Sep 20 09:25:10 2013 UTC
@@ -1272,8 +1272,7 @@
                                      Handle<Type> left_type,
                                      Handle<Type> right_type,
                                      Handle<Type> result_type,
-                                     Maybe<int> fixed_right_arg,
-                                     HValue* context);
+                                     Maybe<int> fixed_right_arg);

   HLoadNamedField* AddLoadFixedArrayLength(HValue *object);

--
--
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