--- old/src/share/vm/opto/subnode.cpp 2014-05-15 17:09:32.318522612 +0200 +++ new/src/share/vm/opto/subnode.cpp 2014-05-15 17:09:32.110522621 +0200 @@ -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) AddINode(in1, phase->intcon(-i->get_con())); + return new 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) 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) ); } } @@ -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) 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); } } @@ -191,47 +191,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; @@ -278,7 +278,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 @@ -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) 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) ); } } @@ -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) 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); } } @@ -319,28 +319,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; @@ -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) 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 @@ -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) 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 @@ -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) 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). @@ -1024,8 +1024,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 @@ -1097,9 +1097,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); } @@ -1115,7 +1115,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()); } @@ -1153,7 +1153,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)". @@ -1170,8 +1170,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)". @@ -1182,10 +1182,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 @@ -1195,8 +1195,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 @@ -1207,8 +1207,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