Mercurial > hg > truffle
diff src/share/vm/opto/cfgnode.cpp @ 6804:e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
Summary: Deleted placement new operator of Node - node(size_t, Compile *, int).
Reviewed-by: kvn, twisti
Contributed-by: bharadwaj.yadavalli@oracle.com
author | kvn |
---|---|
date | Thu, 27 Sep 2012 09:38:42 -0700 |
parents | da91efe96a93 |
children | 8e47bac5643a |
line wrap: on
line diff
--- a/src/share/vm/opto/cfgnode.cpp Tue Sep 25 15:48:17 2012 -0700 +++ b/src/share/vm/opto/cfgnode.cpp Thu Sep 27 09:38:42 2012 -0700 @@ -612,17 +612,17 @@ convf2i->in(1) == bot_in ) { // Matched pattern, including LShiftI; RShiftI, replace with integer compares // max test - Node *cmp = gvn->register_new_node_with_optimizer(new (phase->C, 3) CmpINode( convf2i, min )); - Node *boo = gvn->register_new_node_with_optimizer(new (phase->C, 2) BoolNode( cmp, BoolTest::lt )); - IfNode *iff = (IfNode*)gvn->register_new_node_with_optimizer(new (phase->C, 2) IfNode( top_if->in(0), boo, PROB_UNLIKELY_MAG(5), top_if->_fcnt )); - Node *if_min= gvn->register_new_node_with_optimizer(new (phase->C, 1) IfTrueNode (iff)); - Node *ifF = gvn->register_new_node_with_optimizer(new (phase->C, 1) IfFalseNode(iff)); + Node *cmp = gvn->register_new_node_with_optimizer(new (phase->C) CmpINode( convf2i, min )); + Node *boo = gvn->register_new_node_with_optimizer(new (phase->C) BoolNode( cmp, BoolTest::lt )); + IfNode *iff = (IfNode*)gvn->register_new_node_with_optimizer(new (phase->C) IfNode( top_if->in(0), boo, PROB_UNLIKELY_MAG(5), top_if->_fcnt )); + Node *if_min= gvn->register_new_node_with_optimizer(new (phase->C) IfTrueNode (iff)); + Node *ifF = gvn->register_new_node_with_optimizer(new (phase->C) IfFalseNode(iff)); // min test - cmp = gvn->register_new_node_with_optimizer(new (phase->C, 3) CmpINode( convf2i, max )); - boo = gvn->register_new_node_with_optimizer(new (phase->C, 2) BoolNode( cmp, BoolTest::gt )); - iff = (IfNode*)gvn->register_new_node_with_optimizer(new (phase->C, 2) IfNode( ifF, boo, PROB_UNLIKELY_MAG(5), bot_if->_fcnt )); - Node *if_max= gvn->register_new_node_with_optimizer(new (phase->C, 1) IfTrueNode (iff)); - ifF = gvn->register_new_node_with_optimizer(new (phase->C, 1) IfFalseNode(iff)); + cmp = gvn->register_new_node_with_optimizer(new (phase->C) CmpINode( convf2i, max )); + boo = gvn->register_new_node_with_optimizer(new (phase->C) BoolNode( cmp, BoolTest::gt )); + iff = (IfNode*)gvn->register_new_node_with_optimizer(new (phase->C) IfNode( ifF, boo, PROB_UNLIKELY_MAG(5), bot_if->_fcnt )); + Node *if_max= gvn->register_new_node_with_optimizer(new (phase->C) IfTrueNode (iff)); + ifF = gvn->register_new_node_with_optimizer(new (phase->C) IfFalseNode(iff)); // update input edges to region node set_req_X( min_idx, if_min, gvn ); set_req_X( max_idx, if_max, gvn ); @@ -681,7 +681,7 @@ PhiNode* PhiNode::make(Node* r, Node* x, const Type *t, const TypePtr* at) { uint preds = r->req(); // Number of predecessor paths assert(t != Type::MEMORY || at == flatten_phi_adr_type(at), "flatten at"); - PhiNode* p = new (Compile::current(), preds) PhiNode(r, t, at); + PhiNode* p = new (Compile::current()) PhiNode(r, t, at); for (uint j = 1; j < preds; j++) { // Fill in all inputs, except those which the region does not yet have if (r->in(j) != NULL) @@ -699,7 +699,7 @@ const Type* t = x->bottom_type(); const TypePtr* at = NULL; if (t == Type::MEMORY) at = flatten_phi_adr_type(x->adr_type()); - return new (Compile::current(), r->req()) PhiNode(r, t, at); + return new (Compile::current()) PhiNode(r, t, at); } @@ -1205,9 +1205,9 @@ } else return NULL; // Build int->bool conversion - Node *n = new (phase->C, 2) Conv2BNode( cmp->in(1) ); + Node *n = new (phase->C) Conv2BNode( cmp->in(1) ); if( flipped ) - n = new (phase->C, 3) XorINode( phase->transform(n), phase->intcon(1) ); + n = new (phase->C) XorINode( phase->transform(n), phase->intcon(1) ); return n; } @@ -1266,9 +1266,9 @@ if( q->is_Con() && phase->type(q) != TypeInt::ZERO && y->is_Con() ) return NULL; - Node *cmplt = phase->transform( new (phase->C, 3) CmpLTMaskNode(p,q) ); - Node *j_and = phase->transform( new (phase->C, 3) AndINode(cmplt,y) ); - return new (phase->C, 3) AddINode(j_and,x); + Node *cmplt = phase->transform( new (phase->C) CmpLTMaskNode(p,q) ); + Node *j_and = phase->transform( new (phase->C) AndINode(cmplt,y) ); + return new (phase->C) AddINode(j_and,x); } //------------------------------is_absolute------------------------------------ @@ -1330,17 +1330,17 @@ if( sub->Opcode() != Op_SubF || sub->in(2) != x || phase->type(sub->in(1)) != tzero ) return NULL; - x = new (phase->C, 2) AbsFNode(x); + x = new (phase->C) AbsFNode(x); if (flip) { - x = new (phase->C, 3) SubFNode(sub->in(1), phase->transform(x)); + x = new (phase->C) SubFNode(sub->in(1), phase->transform(x)); } } else { if( sub->Opcode() != Op_SubD || sub->in(2) != x || phase->type(sub->in(1)) != tzero ) return NULL; - x = new (phase->C, 2) AbsDNode(x); + x = new (phase->C) AbsDNode(x); if (flip) { - x = new (phase->C, 3) SubDNode(sub->in(1), phase->transform(x)); + x = new (phase->C) SubDNode(sub->in(1), phase->transform(x)); } } @@ -1415,7 +1415,7 @@ // Now start splitting out the flow paths that merge the same value. // Split first the RegionNode. PhaseIterGVN *igvn = phase->is_IterGVN(); - RegionNode *newr = new (phase->C, hit+1) RegionNode(hit+1); + RegionNode *newr = new (phase->C) RegionNode(hit+1); split_once(igvn, phi, val, r, newr); // Now split all other Phis than this one @@ -1723,13 +1723,13 @@ } if (doit) { if (base == NULL) { - base = new (phase->C, in(0)->req()) PhiNode(in(0), type, NULL); + base = new (phase->C) PhiNode(in(0), type, NULL); for (uint i = 1; i < req(); i++) { base->init_req(i, in(i)->in(AddPNode::Base)); } phase->is_IterGVN()->register_new_node_with_optimizer(base); } - return new (phase->C, 4) AddPNode(base, base, y); + return new (phase->C) AddPNode(base, base, y); } } } @@ -1806,7 +1806,7 @@ // Phi(...MergeMem(m0, m1:AT1, m2:AT2)...) into // MergeMem(Phi(...m0...), Phi:AT1(...m1...), Phi:AT2(...m2...)) PhaseIterGVN *igvn = phase->is_IterGVN(); - Node* hook = new (phase->C, 1) Node(1); + Node* hook = new (phase->C) Node(1); PhiNode* new_base = (PhiNode*) clone(); // Must eagerly register phis, since they participate in loops. if (igvn) { @@ -1896,7 +1896,7 @@ PhaseIterGVN *igvn = phase->is_IterGVN(); // Make narrow type for new phi. const Type* narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr()); - PhiNode* new_phi = new (phase->C, r->req()) PhiNode(r, narrow_t); + PhiNode* new_phi = new (phase->C) PhiNode(r, narrow_t); uint orig_cnt = req(); for (uint i=1; i<req(); ++i) {// For all paths in Node *ii = in(i); @@ -1909,14 +1909,14 @@ if (ii->as_Phi() == this) { new_ii = new_phi; } else { - new_ii = new (phase->C, 2) EncodePNode(ii, narrow_t); + new_ii = new (phase->C) EncodePNode(ii, narrow_t); igvn->register_new_node_with_optimizer(new_ii); } } new_phi->set_req(i, new_ii); } igvn->register_new_node_with_optimizer(new_phi, this); - progress = new (phase->C, 2) DecodeNNode(new_phi, bottom_type()); + progress = new (phase->C) DecodeNNode(new_phi, bottom_type()); } } #endif