hotspot/src/share/vm/opto/subnode.cpp
changeset 13895 f6dfe4123709
parent 13728 882756847a04
child 13969 d2a189b83b87
--- a/hotspot/src/share/vm/opto/subnode.cpp	Tue Sep 25 15:48:17 2012 -0700
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Thu Sep 27 09:38:42 2012 -0700
@@ -149,7 +149,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, 3) AddINode(in1, phase->intcon(-i->get_con()));
+      return new (phase->C) AddINode(in1, phase->intcon(-i->get_con()));
   }
 
   // Convert "(x+c0) - y" into (x-y) + c0"
@@ -158,8 +158,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, 3) SubINode( in1->in(1), in2 ));
-      return new (phase->C, 3) AddINode( sub2, in1->in(2) );
+      Node *sub2 = phase->transform( new (phase->C) SubINode( in1->in(1), in2 ));
+      return new (phase->C) AddINode( sub2, in1->in(2) );
     }
   }
 
@@ -171,9 +171,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, 3) SubINode(in1, in21) );
+      Node* sub2 = phase->transform( new (phase->C) SubINode(in1, in21) );
       Node* neg_c0 = phase->intcon(- tcon->get_con());
-      return new (phase->C, 3) AddINode(sub2, neg_c0);
+      return new (phase->C) AddINode(sub2, neg_c0);
     }
   }
 
@@ -191,47 +191,47 @@
   // Convert "x - (x+y)" into "-y"
   if( op2 == Op_AddI &&
       phase->eqv( in1, in2->in(1) ) )
-    return new (phase->C, 3) SubINode( phase->intcon(0),in2->in(2));
+    return new (phase->C) 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, 3) SubINode( phase->intcon(0),in1->in(2));
+    return new (phase->C) 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, 3) SubINode( phase->intcon(0),in2->in(1));
+    return new (phase->C) 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, 3) SubINode( in2->in(2), in2->in(1) );
+    return new (phase->C) 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, 3) SubINode( phase->intcon(-con), in2->in(1) );
+    return new (phase->C) 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, 3) SubINode( in1->in(2), in2->in(2) );
+    return new (phase->C) 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, 3) SubINode( in1->in(1), in2->in(1) );
+    return new (phase->C) 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, 3) SubINode( in1->in(1), in2->in(2) );
+    return new (phase->C) 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, 3) SubINode( in1->in(2), in2->in(1) );
+    return new (phase->C) 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, 3) AddINode( in1, in2->in(2) ) );
-    return new (phase->C, 3) SubINode( add1, in2->in(1) );
+    Node *add1 = phase->transform( new (phase->C) AddINode( in1, in2->in(2) ) );
+    return new (phase->C) SubINode( add1, in2->in(1) );
   }
 
   return NULL;
@@ -278,7 +278,7 @@
   // Convert "x-c0" into "x+ -c0".
   if( i &&                      // Might be bottom or top...
       i->is_con() )
-    return new (phase->C, 3) AddLNode(in1, phase->longcon(-i->get_con()));
+    return new (phase->C) 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
@@ -287,8 +287,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, 3) SubLNode( in11, in2 ));
-      return new (phase->C, 3) AddLNode( sub2, in1->in(2) );
+      Node *sub2 = phase->transform( new (phase->C) SubLNode( in11, in2 ));
+      return new (phase->C) AddLNode( sub2, in1->in(2) );
     }
   }
 
@@ -299,9 +299,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, 3) SubLNode(in1, in21) );
+      Node* sub2 = phase->transform( new (phase->C) SubLNode(in1, in21) );
       Node* neg_c0 = phase->longcon(- tcon->get_con());
-      return new (phase->C, 3) AddLNode(sub2, neg_c0);
+      return new (phase->C) AddLNode(sub2, neg_c0);
     }
   }
 
@@ -319,28 +319,28 @@
   // Convert "x - (x+y)" into "-y"
   if( op2 == Op_AddL &&
       phase->eqv( in1, in2->in(1) ) )
-    return new (phase->C, 3) SubLNode( phase->makecon(TypeLong::ZERO), in2->in(2));
+    return new (phase->C) 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, 3) SubLNode( phase->makecon(TypeLong::ZERO),in2->in(1));
+    return new (phase->C) 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, 3) SubLNode( in2->in(2), in2->in(1) );
+    return new (phase->C) 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, 3) SubLNode( in1->in(2), in2->in(2) );
+    return new (phase->C) 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, 3) SubLNode( in1->in(1), in2->in(1) );
+    return new (phase->C) 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, 3) AddLNode( in1, in2->in(2) ) );
-    return new (phase->C, 3) SubLNode( add1, in2->in(1) );
+    Node *add1 = phase->transform( new (phase->C) AddLNode( in1, in2->in(2) ) );
+    return new (phase->C) SubLNode( add1, in2->in(1) );
   }
 
   return NULL;
@@ -407,7 +407,7 @@
     // Convert "x - (x+y)" into "-y"
     if( in(2)->is_Add() &&
         phase->eqv(in(1),in(2)->in(1) ) )
-      return new (phase->C, 3) SubFNode( phase->makecon(TypeF::ZERO),in(2)->in(2));
+      return new (phase->C) SubFNode( phase->makecon(TypeF::ZERO),in(2)->in(2));
   }
 
   // Cannot replace 0.0-X with -X because a 'fsub' bytecode computes
@@ -450,7 +450,7 @@
     // Convert "x - (x+y)" into "-y"
     if( in(2)->is_Add() &&
         phase->eqv(in(1),in(2)->in(1) ) )
-      return new (phase->C, 3) SubDNode( phase->makecon(TypeD::ZERO),in(2)->in(2));
+      return new (phase->C) SubDNode( phase->makecon(TypeD::ZERO),in(2)->in(2));
   }
 
   // Cannot replace 0.0-X with -X because a 'dsub' bytecode computes
@@ -581,11 +581,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, 3) CmpLNode(in(1)->in(1),in(1)->in(2));
+      return new (phase->C) CmpLNode(in(1)->in(1),in(1)->in(2));
     case Op_CmpF3:              // Collapse a CmpF3/CmpI into a CmpF
-      return new (phase->C, 3) CmpFNode(in(1)->in(1),in(1)->in(2));
+      return new (phase->C) CmpFNode(in(1)->in(1),in(1)->in(2));
     case Op_CmpD3:              // Collapse a CmpD3/CmpI into a CmpD
-      return new (phase->C, 3) CmpDNode(in(1)->in(1),in(1)->in(2));
+      return new (phase->C) 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).
@@ -1023,8 +1023,8 @@
         new_in2 = tmp;
       }
       CmpFNode *new_cmp = (Opcode() == Op_CmpD3)
-        ? new (phase->C, 3) CmpF3Node( new_in1, new_in2 )
-        : new (phase->C, 3) CmpFNode ( new_in1, new_in2 ) ;
+        ? new (phase->C) CmpF3Node( new_in1, new_in2 )
+        : new (phase->C) CmpFNode ( new_in1, new_in2 ) ;
       return new_cmp;           // Changed to CmpFNode
     }
     // Testing value required the precision of a double
@@ -1085,7 +1085,7 @@
   ncmp->set_req(1,cmp1);
   ncmp->set_req(2,cmp2);
   ncmp = gvn->transform( ncmp );
-  return new (gvn->C, 2) BoolNode( ncmp, test );
+  return new (gvn->C) BoolNode( ncmp, test );
 }
 
 //-------------------------------make_predicate--------------------------------
@@ -1106,9 +1106,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, 3) CmpINode(test_value, phase->intcon(0));
+  Node* cmp = new (C) CmpINode(test_value, phase->intcon(0));
   cmp = phase->transform(cmp);
-  Node* bol = new (C, 2) BoolNode(cmp, BoolTest::ne);
+  Node* bol = new (C) BoolNode(cmp, BoolTest::ne);
   return phase->transform(bol);
 }
 
@@ -1124,7 +1124,7 @@
 //----------------------------------negate-------------------------------------
 BoolNode* BoolNode::negate(PhaseGVN* phase) {
   Compile* C = phase->C;
-  return new (C, 2) BoolNode(in(1), _test.negate());
+  return new (C) BoolNode(in(1), _test.negate());
 }
 
 
@@ -1158,7 +1158,7 @@
     // Swap inputs to the clone
     cmp->swap_edges(1, 2);
     cmp = phase->transform( cmp );
-    return new (phase->C, 2) BoolNode( cmp, _test.commute() );
+    return new (phase->C) BoolNode( cmp, _test.commute() );
   }
 
   // Change "bool eq/ne (cmp (xor X 1) 0)" into "bool ne/eq (cmp X 0)".
@@ -1175,8 +1175,8 @@
       phase->type( j_xor->in(2) ) == TypeInt::ONE &&
       (_test._test == BoolTest::eq ||
        _test._test == BoolTest::ne) ) {
-    Node *ncmp = phase->transform(new (phase->C, 3) CmpINode(j_xor->in(1),cmp2));
-    return new (phase->C, 2) BoolNode( ncmp, _test.negate() );
+    Node *ncmp = phase->transform(new (phase->C) CmpINode(j_xor->in(1),cmp2));
+    return new (phase->C) BoolNode( ncmp, _test.negate() );
   }
 
   // Change "bool eq/ne (cmp (Conv2B X) 0)" into "bool eq/ne (cmp X 0)".
@@ -1187,10 +1187,10 @@
       (_test._test == BoolTest::eq ||
        _test._test == BoolTest::ne) ) {
     Node *ncmp = phase->transform(phase->type(c2b->in(1))->isa_int()
-       ? (Node*)new (phase->C, 3) CmpINode(c2b->in(1),cmp2)
-       : (Node*)new (phase->C, 3) CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
+       ? (Node*)new (phase->C) CmpINode(c2b->in(1),cmp2)
+       : (Node*)new (phase->C) CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
     );
-    return new (phase->C, 2) BoolNode( ncmp, _test._test );
+    return new (phase->C) BoolNode( ncmp, _test._test );
   }
 
   // Comparing a SubI against a zero is equal to comparing the SubI
@@ -1200,8 +1200,8 @@
         (cop == Op_CmpI) &&
         (cmp1->Opcode() == Op_SubI) &&
         ( cmp2_type == TypeInt::ZERO ) ) {
-    Node *ncmp = phase->transform( new (phase->C, 3) CmpINode(cmp1->in(1),cmp1->in(2)));
-    return new (phase->C, 2) BoolNode( ncmp, _test._test );
+    Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(1),cmp1->in(2)));
+    return new (phase->C) BoolNode( ncmp, _test._test );
   }
 
   // Change (-A vs 0) into (A vs 0) by commuting the test.  Disallow in the
@@ -1212,8 +1212,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, 3) CmpINode(cmp1->in(2),cmp2));
-    return new (phase->C, 2) BoolNode( ncmp, _test.commute() );
+    Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(2),cmp2));
+    return new (phase->C) BoolNode( ncmp, _test.commute() );
   }
 
   //  The transformation below is not valid for either signed or unsigned