Mercurial > hg > truffle
diff src/share/vm/opto/stringopts.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 | ed21db7b3fda |
children | 2aff40cb4703 |
line wrap: on
line diff
--- a/src/share/vm/opto/stringopts.cpp Tue Sep 25 15:48:17 2012 -0700 +++ b/src/share/vm/opto/stringopts.cpp Thu Sep 27 09:38:42 2012 -0700 @@ -69,7 +69,7 @@ _multiple(false), _string_alloc(NULL), _stringopts(stringopts) { - _arguments = new (_stringopts->C, 1) Node(1); + _arguments = new (_stringopts->C) Node(1); _arguments->del_req(0); } @@ -220,11 +220,10 @@ // Build a new call using the jvms state of the allocate address call_addr = SharedRuntime::uncommon_trap_blob()->entry_point(); const TypeFunc* call_type = OptoRuntime::uncommon_trap_Type(); - int size = call_type->domain()->cnt(); const TypePtr* no_memory_effects = NULL; Compile* C = _stringopts->C; - CallStaticJavaNode* call = new (C, size) CallStaticJavaNode(call_type, call_addr, "uncommon_trap", - jvms->bci(), no_memory_effects); + CallStaticJavaNode* call = new (C) CallStaticJavaNode(call_type, call_addr, "uncommon_trap", + jvms->bci(), no_memory_effects); for (int e = 0; e < TypeFunc::Parms; e++) { call->init_req(e, uct->in(e)); } @@ -969,9 +968,9 @@ } Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) { - RegionNode *final_merge = new (C, 3) RegionNode(3); + RegionNode *final_merge = new (C) RegionNode(3); kit.gvn().set_type(final_merge, Type::CONTROL); - Node* final_size = new (C, 3) PhiNode(final_merge, TypeInt::INT); + Node* final_size = new (C) PhiNode(final_merge, TypeInt::INT); kit.gvn().set_type(final_size, TypeInt::INT); IfNode* iff = kit.create_and_map_if(kit.control(), @@ -988,11 +987,11 @@ } else { // int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); - RegionNode *r = new (C, 3) RegionNode(3); + RegionNode *r = new (C) RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); - Node *phi = new (C, 3) PhiNode(r, TypeInt::INT); + Node *phi = new (C) PhiNode(r, TypeInt::INT); kit.gvn().set_type(phi, TypeInt::INT); - Node *size = new (C, 3) PhiNode(r, TypeInt::INT); + Node *size = new (C) PhiNode(r, TypeInt::INT); kit.gvn().set_type(size, TypeInt::INT); Node* chk = __ CmpI(arg, __ intcon(0)); Node* p = __ Bool(chk, BoolTest::lt); @@ -1017,11 +1016,11 @@ // Add loop predicate first. kit.add_predicate(); - RegionNode *loop = new (C, 3) RegionNode(3); + RegionNode *loop = new (C) RegionNode(3); loop->init_req(1, kit.control()); kit.gvn().set_type(loop, Type::CONTROL); - Node *index = new (C, 3) PhiNode(loop, TypeInt::INT); + Node *index = new (C) PhiNode(loop, TypeInt::INT); index->init_req(1, __ intcon(0)); kit.gvn().set_type(index, TypeInt::INT); kit.set_control(loop); @@ -1054,7 +1053,7 @@ } void PhaseStringOpts::int_getChars(GraphKit& kit, Node* arg, Node* char_array, Node* start, Node* end) { - RegionNode *final_merge = new (C, 4) RegionNode(4); + RegionNode *final_merge = new (C) RegionNode(4); kit.gvn().set_type(final_merge, Type::CONTROL); Node *final_mem = PhiNode::make(final_merge, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS); kit.gvn().set_type(final_mem, Type::MEMORY); @@ -1104,11 +1103,11 @@ __ Bool(__ CmpI(arg, __ intcon(0)), BoolTest::lt), PROB_FAIR, COUNT_UNKNOWN); - RegionNode *merge = new (C, 3) RegionNode(3); + RegionNode *merge = new (C) RegionNode(3); kit.gvn().set_type(merge, Type::CONTROL); - i = new (C, 3) PhiNode(merge, TypeInt::INT); + i = new (C) PhiNode(merge, TypeInt::INT); kit.gvn().set_type(i, TypeInt::INT); - sign = new (C, 3) PhiNode(merge, TypeInt::INT); + sign = new (C) PhiNode(merge, TypeInt::INT); kit.gvn().set_type(sign, TypeInt::INT); merge->init_req(1, __ IfTrue(iff)); @@ -1137,10 +1136,10 @@ // Add loop predicate first. kit.add_predicate(); - RegionNode *head = new (C, 3) RegionNode(3); + RegionNode *head = new (C) RegionNode(3); head->init_req(1, kit.control()); kit.gvn().set_type(head, Type::CONTROL); - Node *i_phi = new (C, 3) PhiNode(head, TypeInt::INT); + Node *i_phi = new (C) PhiNode(head, TypeInt::INT); i_phi->init_req(1, i); kit.gvn().set_type(i_phi, TypeInt::INT); charPos = PhiNode::make(head, charPos); @@ -1261,7 +1260,7 @@ // as a shim for the insertion of the new code. JVMState* jvms = sc->begin()->jvms()->clone_shallow(C); uint size = sc->begin()->req(); - SafePointNode* map = new (C, size) SafePointNode(size, jvms); + SafePointNode* map = new (C) SafePointNode(size, jvms); // copy the control and memory state from the final call into our // new starting state. This allows any preceeding tests to feed @@ -1306,12 +1305,12 @@ // Create a region for the overflow checks to merge into. int args = MAX2(sc->num_arguments(), 1); - RegionNode* overflow = new (C, args) RegionNode(args); + RegionNode* overflow = new (C) RegionNode(args); kit.gvn().set_type(overflow, Type::CONTROL); // Create a hook node to hold onto the individual sizes since they // are need for the copying phase. - Node* string_sizes = new (C, args) Node(args); + Node* string_sizes = new (C) Node(args); Node* length = __ intcon(0); for (int argi = 0; argi < sc->num_arguments(); argi++) { @@ -1355,9 +1354,9 @@ } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) { // s = s != null ? s : "null"; // length = length + (s.count - s.offset); - RegionNode *r = new (C, 3) RegionNode(3); + RegionNode *r = new (C) RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); - Node *phi = new (C, 3) PhiNode(r, type); + Node *phi = new (C) PhiNode(r, type); kit.gvn().set_type(phi, phi->bottom_type()); Node* p = __ Bool(__ CmpP(arg, kit.null()), BoolTest::ne); IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_MIN, COUNT_UNKNOWN);