src/share/vm/opto/stringopts.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8034812 Cdiff src/share/vm/opto/stringopts.cpp

src/share/vm/opto/stringopts.cpp

Print this page

        

*** 68,78 **** _end(end), _begin(NULL), _multiple(false), _string_alloc(NULL), _stringopts(stringopts) { ! _arguments = new (_stringopts->C) Node(1); _arguments->del_req(0); } bool validate_mem_flow(); bool validate_control_flow(); --- 68,78 ---- _end(end), _begin(NULL), _multiple(false), _string_alloc(NULL), _stringopts(stringopts) { ! _arguments = new Node(1); _arguments->del_req(0); } bool validate_mem_flow(); bool validate_control_flow();
*** 226,236 **** // 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(); const TypePtr* no_memory_effects = NULL; Compile* C = _stringopts->C; ! 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)); } // Set the trap request to record intrinsic failure if this trap --- 226,236 ---- // 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(); const TypePtr* no_memory_effects = NULL; Compile* C = _stringopts->C; ! CallStaticJavaNode* call = new 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)); } // Set the trap request to record intrinsic failure if this trap
*** 1125,1137 **** C->get_alias_index(mirror_type->add_offset(field->offset_in_bytes())), MemNode::unordered); } Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) { ! RegionNode *final_merge = new (C) RegionNode(3); kit.gvn().set_type(final_merge, Type::CONTROL); ! 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(), __ Bool(__ CmpI(arg, __ intcon(0x80000000)), BoolTest::ne), PROB_FAIR, COUNT_UNKNOWN); --- 1125,1137 ---- C->get_alias_index(mirror_type->add_offset(field->offset_in_bytes())), MemNode::unordered); } Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) { ! RegionNode *final_merge = new RegionNode(3); kit.gvn().set_type(final_merge, Type::CONTROL); ! Node* final_size = new PhiNode(final_merge, TypeInt::INT); kit.gvn().set_type(final_size, TypeInt::INT); IfNode* iff = kit.create_and_map_if(kit.control(), __ Bool(__ CmpI(arg, __ intcon(0x80000000)), BoolTest::ne), PROB_FAIR, COUNT_UNKNOWN);
*** 1144,1158 **** final_merge->init_req(2, C->top()); final_size->init_req(2, C->top()); } else { // int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); ! RegionNode *r = new (C) RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); ! Node *phi = new (C) PhiNode(r, TypeInt::INT); kit.gvn().set_type(phi, 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); IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_FAIR, COUNT_UNKNOWN); Node* lessthan = __ IfTrue(iff); --- 1144,1158 ---- final_merge->init_req(2, C->top()); final_size->init_req(2, C->top()); } else { // int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); ! RegionNode *r = new RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); ! Node *phi = new PhiNode(r, TypeInt::INT); kit.gvn().set_type(phi, TypeInt::INT); ! Node *size = new PhiNode(r, TypeInt::INT); kit.gvn().set_type(size, TypeInt::INT); Node* chk = __ CmpI(arg, __ intcon(0)); Node* p = __ Bool(chk, BoolTest::lt); IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_FAIR, COUNT_UNKNOWN); Node* lessthan = __ IfTrue(iff);
*** 1173,1187 **** // return i+1; // Add loop predicate first. kit.add_predicate(); ! RegionNode *loop = new (C) RegionNode(3); loop->init_req(1, kit.control()); kit.gvn().set_type(loop, Type::CONTROL); ! 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); Node* sizeTable = fetch_static_field(kit, size_table_field); --- 1173,1187 ---- // return i+1; // Add loop predicate first. kit.add_predicate(); ! RegionNode *loop = new RegionNode(3); loop->init_req(1, kit.control()); kit.gvn().set_type(loop, Type::CONTROL); ! Node *index = new PhiNode(loop, TypeInt::INT); index->init_req(1, __ intcon(0)); kit.gvn().set_type(index, TypeInt::INT); kit.set_control(loop); Node* sizeTable = fetch_static_field(kit, size_table_field);
*** 1210,1220 **** return final_size; } void PhaseStringOpts::int_getChars(GraphKit& kit, Node* arg, Node* char_array, Node* start, Node* end) { ! 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); // need to handle Integer.MIN_VALUE specially because negating doesn't make it positive --- 1210,1220 ---- return final_size; } void PhaseStringOpts::int_getChars(GraphKit& kit, Node* arg, Node* char_array, Node* start, Node* end) { ! RegionNode *final_merge = new 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); // need to handle Integer.MIN_VALUE specially because negating doesn't make it positive
*** 1260,1274 **** { IfNode* iff = kit.create_and_map_if(kit.control(), __ Bool(__ CmpI(arg, __ intcon(0)), BoolTest::lt), PROB_FAIR, COUNT_UNKNOWN); ! RegionNode *merge = new (C) RegionNode(3); kit.gvn().set_type(merge, Type::CONTROL); ! i = new (C) PhiNode(merge, TypeInt::INT); kit.gvn().set_type(i, TypeInt::INT); ! sign = new (C) PhiNode(merge, TypeInt::INT); kit.gvn().set_type(sign, TypeInt::INT); merge->init_req(1, __ IfTrue(iff)); i->init_req(1, __ SubI(__ intcon(0), arg)); sign->init_req(1, __ intcon('-')); --- 1260,1274 ---- { IfNode* iff = kit.create_and_map_if(kit.control(), __ Bool(__ CmpI(arg, __ intcon(0)), BoolTest::lt), PROB_FAIR, COUNT_UNKNOWN); ! RegionNode *merge = new RegionNode(3); kit.gvn().set_type(merge, Type::CONTROL); ! i = new PhiNode(merge, TypeInt::INT); kit.gvn().set_type(i, TypeInt::INT); ! sign = new PhiNode(merge, TypeInt::INT); kit.gvn().set_type(sign, TypeInt::INT); merge->init_req(1, __ IfTrue(iff)); i->init_req(1, __ SubI(__ intcon(0), arg)); sign->init_req(1, __ intcon('-'));
*** 1293,1306 **** { // Add loop predicate first. kit.add_predicate(); ! RegionNode *head = new (C) RegionNode(3); head->init_req(1, kit.control()); kit.gvn().set_type(head, Type::CONTROL); ! 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); kit.gvn().set_type(charPos, TypeInt::INT); Node *mem = PhiNode::make(head, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS); --- 1293,1306 ---- { // Add loop predicate first. kit.add_predicate(); ! RegionNode *head = new RegionNode(3); head->init_req(1, kit.control()); kit.gvn().set_type(head, Type::CONTROL); ! Node *i_phi = new PhiNode(head, TypeInt::INT); i_phi->init_req(1, i); kit.gvn().set_type(i_phi, TypeInt::INT); charPos = PhiNode::make(head, charPos); kit.gvn().set_type(charPos, TypeInt::INT); Node *mem = PhiNode::make(head, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS);
*** 1418,1428 **** // pull the JVMState of the allocation into a SafePointNode to serve as // 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) 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 // into the new section of code. for (uint i1 = 0; i1 < TypeFunc::Parms; i1++) { --- 1418,1428 ---- // pull the JVMState of the allocation into a SafePointNode to serve as // 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 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 // into the new section of code. for (uint i1 = 0; i1 < TypeFunc::Parms; i1++) {
*** 1463,1478 **** Node* null_string = __ makecon(TypeInstPtr::make(C->env()->the_null_string())); // Create a region for the overflow checks to merge into. int args = MAX2(sc->num_arguments(), 1); ! 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) Node(args); Node* length = __ intcon(0); for (int argi = 0; argi < sc->num_arguments(); argi++) { Node* arg = sc->argument(argi); switch (sc->mode(argi)) { --- 1463,1478 ---- Node* null_string = __ makecon(TypeInstPtr::make(C->env()->the_null_string())); // Create a region for the overflow checks to merge into. int args = MAX2(sc->num_arguments(), 1); ! RegionNode* overflow = new 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 Node(args); Node* length = __ intcon(0); for (int argi = 0; argi < sc->num_arguments(); argi++) { Node* arg = sc->argument(argi); switch (sc->mode(argi)) {
*** 1512,1524 **** arg = null_string; sc->set_argument(argi, arg); } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) { // s = s != null ? s : "null"; // length = length + (s.count - s.offset); ! RegionNode *r = new (C) RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); ! 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); Node* notnull = __ IfTrue(iff); Node* isnull = __ IfFalse(iff); --- 1512,1524 ---- arg = null_string; sc->set_argument(argi, arg); } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) { // s = s != null ? s : "null"; // length = length + (s.count - s.offset); ! RegionNode *r = new RegionNode(3); kit.gvn().set_type(r, Type::CONTROL); ! Node *phi = new 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); Node* notnull = __ IfTrue(iff); Node* isnull = __ IfFalse(iff);
src/share/vm/opto/stringopts.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File