hotspot/src/share/vm/opto/subnode.cpp
changeset 24923 9631f7d691dc
parent 24482 5fc5c8f199e6
child 25930 eae8b7490d2c
--- a/hotspot/src/share/vm/opto/subnode.cpp	Fri May 30 20:01:11 2014 +0000
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Mon Jun 02 08:07:29 2014 +0200
@@ -159,7 +159,7 @@
   if( t2->base() == Type::Int ){        // Might be bottom or top...
     const TypeInt *i = t2->is_int();
     if( i->is_con() )
-      return new (phase->C) AddINode(in1, phase->intcon(-i->get_con()));
+      return new AddINode(in1, phase->intcon(-i->get_con()));
   }
 
   // Convert "(x+c0) - y" into (x-y) + c0"
@@ -168,8 +168,8 @@
   if( op1 == Op_AddI && ok_to_convert(in1, in2) ) {
     const Type *tadd = phase->type( in1->in(2) );
     if( tadd->singleton() && tadd != Type::TOP ) {
-      Node *sub2 = phase->transform( new (phase->C) SubINode( in1->in(1), in2 ));
-      return new (phase->C) AddINode( sub2, in1->in(2) );
+      Node *sub2 = phase->transform( new SubINode( in1->in(1), in2 ));
+      return new AddINode( sub2, in1->in(2) );
     }
   }
 
@@ -181,9 +181,9 @@
     Node* in22 = in2->in(2);
     const TypeInt* tcon = phase->type(in22)->isa_int();
     if (tcon != NULL && tcon->is_con()) {
-      Node* sub2 = phase->transform( new (phase->C) SubINode(in1, in21) );
+      Node* sub2 = phase->transform( new SubINode(in1, in21) );
       Node* neg_c0 = phase->intcon(- tcon->get_con());
-      return new (phase->C) AddINode(sub2, neg_c0);
+      return new AddINode(sub2, neg_c0);
     }
   }
 
@@ -201,47 +201,47 @@
   // Convert "x - (x+y)" into "-y"
   if( op2 == Op_AddI &&
       phase->eqv( in1, in2->in(1) ) )
-    return new (phase->C) SubINode( phase->intcon(0),in2->in(2));
+    return new SubINode( phase->intcon(0),in2->in(2));
   // Convert "(x-y) - x" into "-y"
   if( op1 == Op_SubI &&
       phase->eqv( in1->in(1), in2 ) )
-    return new (phase->C) SubINode( phase->intcon(0),in1->in(2));
+    return new SubINode( phase->intcon(0),in1->in(2));
   // Convert "x - (y+x)" into "-y"
   if( op2 == Op_AddI &&
       phase->eqv( in1, in2->in(2) ) )
-    return new (phase->C) SubINode( phase->intcon(0),in2->in(1));
+    return new SubINode( phase->intcon(0),in2->in(1));
 
   // Convert "0 - (x-y)" into "y-x"
   if( t1 == TypeInt::ZERO && op2 == Op_SubI )
-    return new (phase->C) SubINode( in2->in(2), in2->in(1) );
+    return new SubINode( in2->in(2), in2->in(1) );
 
   // Convert "0 - (x+con)" into "-con-x"
   jint con;
   if( t1 == TypeInt::ZERO && op2 == Op_AddI &&
       (con = in2->in(2)->find_int_con(0)) != 0 )
-    return new (phase->C) SubINode( phase->intcon(-con), in2->in(1) );
+    return new SubINode( phase->intcon(-con), in2->in(1) );
 
   // Convert "(X+A) - (X+B)" into "A - B"
   if( op1 == Op_AddI && op2 == Op_AddI && in1->in(1) == in2->in(1) )
-    return new (phase->C) SubINode( in1->in(2), in2->in(2) );
+    return new SubINode( in1->in(2), in2->in(2) );
 
   // Convert "(A+X) - (B+X)" into "A - B"
   if( op1 == Op_AddI && op2 == Op_AddI && in1->in(2) == in2->in(2) )
-    return new (phase->C) SubINode( in1->in(1), in2->in(1) );
+    return new SubINode( in1->in(1), in2->in(1) );
 
   // Convert "(A+X) - (X+B)" into "A - B"
   if( op1 == Op_AddI && op2 == Op_AddI && in1->in(2) == in2->in(1) )
-    return new (phase->C) SubINode( in1->in(1), in2->in(2) );
+    return new SubINode( in1->in(1), in2->in(2) );
 
   // Convert "(X+A) - (B+X)" into "A - B"
   if( op1 == Op_AddI && op2 == Op_AddI && in1->in(1) == in2->in(2) )
-    return new (phase->C) SubINode( in1->in(2), in2->in(1) );
+    return new SubINode( in1->in(2), in2->in(1) );
 
   // Convert "A-(B-C)" into (A+C)-B", since add is commutative and generally
   // nicer to optimize than subtract.
   if( op2 == Op_SubI && in2->outcnt() == 1) {
-    Node *add1 = phase->transform( new (phase->C) AddINode( in1, in2->in(2) ) );
-    return new (phase->C) SubINode( add1, in2->in(1) );
+    Node *add1 = phase->transform( new AddINode( in1, in2->in(2) ) );
+    return new SubINode( add1, in2->in(1) );
   }
 
   return NULL;
@@ -288,7 +288,7 @@
   // Convert "x-c0" into "x+ -c0".
   if( i &&                      // Might be bottom or top...
       i->is_con() )
-    return new (phase->C) AddLNode(in1, phase->longcon(-i->get_con()));
+    return new AddLNode(in1, phase->longcon(-i->get_con()));
 
   // Convert "(x+c0) - y" into (x-y) + c0"
   // Do not collapse (x+c0)-y if "+" is a loop increment or
@@ -297,8 +297,8 @@
     Node *in11 = in1->in(1);
     const Type *tadd = phase->type( in1->in(2) );
     if( tadd->singleton() && tadd != Type::TOP ) {
-      Node *sub2 = phase->transform( new (phase->C) SubLNode( in11, in2 ));
-      return new (phase->C) AddLNode( sub2, in1->in(2) );
+      Node *sub2 = phase->transform( new SubLNode( in11, in2 ));
+      return new AddLNode( sub2, in1->in(2) );
     }
   }
 
@@ -309,9 +309,9 @@
     Node* in22 = in2->in(2);
     const TypeLong* tcon = phase->type(in22)->isa_long();
     if (tcon != NULL && tcon->is_con()) {
-      Node* sub2 = phase->transform( new (phase->C) SubLNode(in1, in21) );
+      Node* sub2 = phase->transform( new SubLNode(in1, in21) );
       Node* neg_c0 = phase->longcon(- tcon->get_con());
-      return new (phase->C) AddLNode(sub2, neg_c0);
+      return new AddLNode(sub2, neg_c0);
     }
   }
 
@@ -329,28 +329,28 @@
   // Convert "x - (x+y)" into "-y"
   if( op2 == Op_AddL &&
       phase->eqv( in1, in2->in(1) ) )
-    return new (phase->C) SubLNode( phase->makecon(TypeLong::ZERO), in2->in(2));
+    return new SubLNode( phase->makecon(TypeLong::ZERO), in2->in(2));
   // Convert "x - (y+x)" into "-y"
   if( op2 == Op_AddL &&
       phase->eqv( in1, in2->in(2) ) )
-    return new (phase->C) SubLNode( phase->makecon(TypeLong::ZERO),in2->in(1));
+    return new SubLNode( phase->makecon(TypeLong::ZERO),in2->in(1));
 
   // Convert "0 - (x-y)" into "y-x"
   if( phase->type( in1 ) == TypeLong::ZERO && op2 == Op_SubL )
-    return new (phase->C) SubLNode( in2->in(2), in2->in(1) );
+    return new SubLNode( in2->in(2), in2->in(1) );
 
   // Convert "(X+A) - (X+B)" into "A - B"
   if( op1 == Op_AddL && op2 == Op_AddL && in1->in(1) == in2->in(1) )
-    return new (phase->C) SubLNode( in1->in(2), in2->in(2) );
+    return new SubLNode( in1->in(2), in2->in(2) );
 
   // Convert "(A+X) - (B+X)" into "A - B"
   if( op1 == Op_AddL && op2 == Op_AddL && in1->in(2) == in2->in(2) )
-    return new (phase->C) SubLNode( in1->in(1), in2->in(1) );
+    return new SubLNode( in1->in(1), in2->in(1) );
 
   // Convert "A-(B-C)" into (A+C)-B"
   if( op2 == Op_SubL && in2->outcnt() == 1) {
-    Node *add1 = phase->transform( new (phase->C) AddLNode( in1, in2->in(2) ) );
-    return new (phase->C) SubLNode( add1, in2->in(1) );
+    Node *add1 = phase->transform( new AddLNode( in1, in2->in(2) ) );
+    return new SubLNode( add1, in2->in(1) );
   }
 
   return NULL;
@@ -417,7 +417,7 @@
     // Convert "x - (x+y)" into "-y"
     if( in(2)->is_Add() &&
         phase->eqv(in(1),in(2)->in(1) ) )
-      return new (phase->C) SubFNode( phase->makecon(TypeF::ZERO),in(2)->in(2));
+      return new SubFNode( phase->makecon(TypeF::ZERO),in(2)->in(2));
   }
 
   // Cannot replace 0.0-X with -X because a 'fsub' bytecode computes
@@ -460,7 +460,7 @@
     // Convert "x - (x+y)" into "-y"
     if( in(2)->is_Add() &&
         phase->eqv(in(1),in(2)->in(1) ) )
-      return new (phase->C) SubDNode( phase->makecon(TypeD::ZERO),in(2)->in(2));
+      return new SubDNode( phase->makecon(TypeD::ZERO),in(2)->in(2));
   }
 
   // Cannot replace 0.0-X with -X because a 'dsub' bytecode computes
@@ -666,11 +666,11 @@
   if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {
     switch (in(1)->Opcode()) {
     case Op_CmpL3:              // Collapse a CmpL3/CmpI into a CmpL
-      return new (phase->C) CmpLNode(in(1)->in(1),in(1)->in(2));
+      return new CmpLNode(in(1)->in(1),in(1)->in(2));
     case Op_CmpF3:              // Collapse a CmpF3/CmpI into a CmpF
-      return new (phase->C) CmpFNode(in(1)->in(1),in(1)->in(2));
+      return new CmpFNode(in(1)->in(1),in(1)->in(2));
     case Op_CmpD3:              // Collapse a CmpD3/CmpI into a CmpD
-      return new (phase->C) CmpDNode(in(1)->in(1),in(1)->in(2));
+      return new CmpDNode(in(1)->in(1),in(1)->in(2));
     //case Op_SubI:
       // If (x - y) cannot overflow, then ((x - y) <?> 0)
       // can be turned into (x <?> y).
@@ -1109,8 +1109,8 @@
         new_in2 = tmp;
       }
       CmpFNode *new_cmp = (Opcode() == Op_CmpD3)
-        ? new (phase->C) CmpF3Node( new_in1, new_in2 )
-        : new (phase->C) CmpFNode ( new_in1, new_in2 ) ;
+        ? new CmpF3Node( new_in1, new_in2 )
+        : new CmpFNode ( new_in1, new_in2 ) ;
       return new_cmp;           // Changed to CmpFNode
     }
     // Testing value required the precision of a double
@@ -1182,9 +1182,9 @@
     // Else fall through.  The CMove gets in the way of the test.
     // It should be the case that make_predicate(bol->as_int_value()) == bol.
   }
-  Node* cmp = new (C) CmpINode(test_value, phase->intcon(0));
+  Node* cmp = new CmpINode(test_value, phase->intcon(0));
   cmp = phase->transform(cmp);
-  Node* bol = new (C) BoolNode(cmp, BoolTest::ne);
+  Node* bol = new BoolNode(cmp, BoolTest::ne);
   return phase->transform(bol);
 }
 
@@ -1200,7 +1200,7 @@
 //----------------------------------negate-------------------------------------
 BoolNode* BoolNode::negate(PhaseGVN* phase) {
   Compile* C = phase->C;
-  return new (C) BoolNode(in(1), _test.negate());
+  return new BoolNode(in(1), _test.negate());
 }
 
 
@@ -1238,7 +1238,7 @@
     // Swap inputs to the clone
     cmp->swap_edges(1, 2);
     cmp = phase->transform( cmp );
-    return new (phase->C) BoolNode( cmp, _test.commute() );
+    return new BoolNode( cmp, _test.commute() );
   }
 
   // Change "bool eq/ne (cmp (xor X 1) 0)" into "bool ne/eq (cmp X 0)".
@@ -1255,8 +1255,8 @@
       phase->type( j_xor->in(2) ) == TypeInt::ONE &&
       (_test._test == BoolTest::eq ||
        _test._test == BoolTest::ne) ) {
-    Node *ncmp = phase->transform(new (phase->C) CmpINode(j_xor->in(1),cmp2));
-    return new (phase->C) BoolNode( ncmp, _test.negate() );
+    Node *ncmp = phase->transform(new CmpINode(j_xor->in(1),cmp2));
+    return new BoolNode( ncmp, _test.negate() );
   }
 
   // Change "bool eq/ne (cmp (Conv2B X) 0)" into "bool eq/ne (cmp X 0)".
@@ -1267,10 +1267,10 @@
       (_test._test == BoolTest::eq ||
        _test._test == BoolTest::ne) ) {
     Node *ncmp = phase->transform(phase->type(c2b->in(1))->isa_int()
-       ? (Node*)new (phase->C) CmpINode(c2b->in(1),cmp2)
-       : (Node*)new (phase->C) CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
+       ? (Node*)new CmpINode(c2b->in(1),cmp2)
+       : (Node*)new CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
     );
-    return new (phase->C) BoolNode( ncmp, _test._test );
+    return new BoolNode( ncmp, _test._test );
   }
 
   // Comparing a SubI against a zero is equal to comparing the SubI
@@ -1280,8 +1280,8 @@
         (cop == Op_CmpI) &&
         (cmp1->Opcode() == Op_SubI) &&
         ( cmp2_type == TypeInt::ZERO ) ) {
-    Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(1),cmp1->in(2)));
-    return new (phase->C) BoolNode( ncmp, _test._test );
+    Node *ncmp = phase->transform( new CmpINode(cmp1->in(1),cmp1->in(2)));
+    return new BoolNode( ncmp, _test._test );
   }
 
   // Change (-A vs 0) into (A vs 0) by commuting the test.  Disallow in the
@@ -1292,8 +1292,8 @@
       cmp2_type == TypeInt::ZERO &&
       phase->type( cmp1->in(1) ) == TypeInt::ZERO &&
       phase->type( cmp1->in(2) )->higher_equal(TypeInt::SYMINT) ) {
-    Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(2),cmp2));
-    return new (phase->C) BoolNode( ncmp, _test.commute() );
+    Node *ncmp = phase->transform( new CmpINode(cmp1->in(2),cmp2));
+    return new BoolNode( ncmp, _test.commute() );
   }
 
   //  The transformation below is not valid for either signed or unsigned