src/share/vm/opto/parse1.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/parse1.cpp	Tue Jun  3 13:54:40 2014
--- new/src/share/vm/opto/parse1.cpp	Tue Jun  3 13:54:40 2014

*** 381,392 **** --- 381,392 ---- } } //------------------------------Parse------------------------------------------ // Main parser constructor. - Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Parse* parent) - : _exits(caller), _parent(parent) { // Init some variables _caller = caller; _method = parse_method; _expected_uses = expected_uses;
*** 397,406 **** --- 397,409 ---- _wrote_fields = false; _alloc_with_final = NULL; _entry_bci = InvocationEntryBci; _tf = NULL; _block = NULL; + _first_return = true; + _replaced_nodes_for_exceptions = false; + _new_idx = C->unique(); debug_only(_block_count = -1); debug_only(_blocks = (Block*)-1); #ifndef PRODUCT if (PrintCompilation || PrintOpto) { // Make sure I have an inline tree, so I can print messages about it.
*** 899,908 **** --- 902,915 ---- caller.set_sp(_caller->sp()); // Copy out the standard machine state: for (uint i = 0; i < TypeFunc::Parms; i++) { caller.map()->set_req(i, ex_map->in(i)); } + if (ex_map->has_replaced_nodes()) { + _replaced_nodes_for_exceptions = true; + } + caller.map()->transfer_replaced_nodes_from(ex_map, _new_idx); // ...and the exception: Node* ex_oop = saved_ex_oop(ex_map); SafePointNode* caller_ex_map = caller.make_exception_state(ex_oop); // Finally, collect the new exception state in my exits: _exits.add_exception_state(caller_ex_map);
*** 989,999 **** --- 996,1006 ---- // (e.g., null checks) arising from multiple points within this method. // See GraphKit::add_exception_state, which performs the commoning. bool do_synch = method()->is_synchronized() && GenerateSynchronizationCode; // record exit from a method if compiled while Dtrace is turned on. ! if (do_synch || C->env()->dtrace_method_probes() || _replaced_nodes_for_exceptions) { // First move the exception list out of _exits: GraphKit kit(_exits.transfer_exceptions_into_jvms()); SafePointNode* normal_map = kit.map(); // keep this guy safe // Now re-collect the exceptions into _exits: SafePointNode* ex_map;
*** 1014,1023 **** --- 1021,1033 ---- kit.shared_unlock(_synch_lock->box_node(), _synch_lock->obj_node()); } if (C->env()->dtrace_method_probes()) { kit.make_dtrace_method_exit(method()); } + if (_replaced_nodes_for_exceptions) { + kit.map()->apply_replaced_nodes(); + } // Done with exception-path processing. ex_map = kit.make_exception_state(ex_oop); assert(ex_jvms->same_calls_as(ex_map->jvms()), "sanity"); // Pop the last vestige of this method: ex_map->set_jvms(caller->clone_shallow(C));
*** 1033,1042 **** --- 1043,1053 ---- SafePointNode* ex_map; while ((ex_map = caller.pop_exception_state()) != NULL) { _exits.add_exception_state(ex_map); } } + _exits.map()->apply_replaced_nodes(); } //-----------------------------create_entry_map------------------------------- // Initialize our parser map to contain the types at method entry. // For OSR, the map contains a single RawPtr parameter.
*** 1047,1056 **** --- 1058,1070 ---- if (len >= 32760) { C->record_method_not_compilable_all_tiers("too many local variables"); return NULL; } + // clear current replaced nodes that are of no use from here on (map was cloned in build_exits). + _caller->map()->delete_replaced_nodes(); + // If this is an inlined method, we may have to do a receiver null check. if (_caller->has_method() && is_normal_parse() && !method()->is_static()) { GraphKit kit(_caller); kit.null_check_receiver_before_call(method()); _caller = kit.transfer_exceptions_into_jvms();
*** 1070,1079 **** --- 1084,1095 ---- record_for_igvn(map()); assert(jvms->endoff() == len, "correct jvms sizing"); SafePointNode* inmap = _caller->map(); assert(inmap != NULL, "must have inmap"); + // In case of null check on receiver above + map()->transfer_replaced_nodes_from(inmap, _new_idx); uint i; // Pass thru the predefined input parameters. for (i = 0; i < TypeFunc::Parms; i++) {
*** 1699,1708 **** --- 1715,1726 ---- !r->in(0)) { // The occasional useless Region assert(control() == r, ""); set_control(r->nonnull_req()); } + map()->merge_replaced_nodes_with(newin); + // newin has been subsumed into the lazy merge, and is now dead. set_block(save_block); stop(); // done with this guy, for now }
*** 2128,2137 **** --- 2146,2162 ---- } } phi->add_req(value); } + if (_first_return) { + _exits.map()->transfer_replaced_nodes_from(map(), _new_idx); + _first_return = false; + } else { + _exits.map()->merge_replaced_nodes_with(map()); + } + stop_and_kill_map(); // This CFG path dies here } //------------------------------add_safepoint----------------------------------

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