< prev index next >

src/share/vm/opto/parse1.cpp

Print this page
rev 12619 : 8174164: SafePointNode::_replaced_nodes breaks with irreducible loops
Reviewed-by:


1069     while ((ex_map = kit.pop_exception_state()) != NULL) {
1070       Node* ex_oop = kit.use_exception_state(ex_map);
1071       // Force the exiting JVM state to have this method at InvocationEntryBci.
1072       // The exiting JVM state is otherwise a copy of the calling JVMS.
1073       JVMState* caller = kit.jvms();
1074       JVMState* ex_jvms = caller->clone_shallow(C);
1075       ex_jvms->set_map(kit.clone_map());
1076       ex_jvms->map()->set_jvms(ex_jvms);
1077       ex_jvms->set_bci(   InvocationEntryBci);
1078       kit.set_jvms(ex_jvms);
1079       if (do_synch) {
1080         // Add on the synchronized-method box/object combo
1081         kit.map()->push_monitor(_synch_lock);
1082         // Unlock!
1083         kit.shared_unlock(_synch_lock->box_node(), _synch_lock->obj_node());
1084       }
1085       if (C->env()->dtrace_method_probes()) {
1086         kit.make_dtrace_method_exit(method());
1087       }
1088       if (_replaced_nodes_for_exceptions) {
1089         kit.map()->apply_replaced_nodes();
1090       }
1091       // Done with exception-path processing.
1092       ex_map = kit.make_exception_state(ex_oop);
1093       assert(ex_jvms->same_calls_as(ex_map->jvms()), "sanity");
1094       // Pop the last vestige of this method:
1095       ex_map->set_jvms(caller->clone_shallow(C));
1096       ex_map->jvms()->set_map(ex_map);
1097       _exits.push_exception_state(ex_map);
1098     }
1099     assert(_exits.map() == normal_map, "keep the same return state");
1100   }
1101 
1102   {
1103     // Capture very early exceptions (receiver null checks) from caller JVMS
1104     GraphKit caller(_caller);
1105     SafePointNode* ex_map;
1106     while ((ex_map = caller.pop_exception_state()) != NULL) {
1107       _exits.add_exception_state(ex_map);
1108     }
1109   }
1110   _exits.map()->apply_replaced_nodes();
1111 }
1112 
1113 //-----------------------------create_entry_map-------------------------------
1114 // Initialize our parser map to contain the types at method entry.
1115 // For OSR, the map contains a single RawPtr parameter.
1116 // Initial monitor locking for sync. methods is performed by do_method_entry.
1117 SafePointNode* Parse::create_entry_map() {
1118   // Check for really stupid bail-out cases.
1119   uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1120   if (len >= 32760) {
1121     C->record_method_not_compilable("too many local variables");
1122     return NULL;
1123   }
1124 
1125   // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1126   _caller->map()->delete_replaced_nodes();
1127 
1128   // If this is an inlined method, we may have to do a receiver null check.
1129   if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
1130     GraphKit kit(_caller);




1069     while ((ex_map = kit.pop_exception_state()) != NULL) {
1070       Node* ex_oop = kit.use_exception_state(ex_map);
1071       // Force the exiting JVM state to have this method at InvocationEntryBci.
1072       // The exiting JVM state is otherwise a copy of the calling JVMS.
1073       JVMState* caller = kit.jvms();
1074       JVMState* ex_jvms = caller->clone_shallow(C);
1075       ex_jvms->set_map(kit.clone_map());
1076       ex_jvms->map()->set_jvms(ex_jvms);
1077       ex_jvms->set_bci(   InvocationEntryBci);
1078       kit.set_jvms(ex_jvms);
1079       if (do_synch) {
1080         // Add on the synchronized-method box/object combo
1081         kit.map()->push_monitor(_synch_lock);
1082         // Unlock!
1083         kit.shared_unlock(_synch_lock->box_node(), _synch_lock->obj_node());
1084       }
1085       if (C->env()->dtrace_method_probes()) {
1086         kit.make_dtrace_method_exit(method());
1087       }
1088       if (_replaced_nodes_for_exceptions) {
1089         kit.map()->apply_replaced_nodes(_new_idx);
1090       }
1091       // Done with exception-path processing.
1092       ex_map = kit.make_exception_state(ex_oop);
1093       assert(ex_jvms->same_calls_as(ex_map->jvms()), "sanity");
1094       // Pop the last vestige of this method:
1095       ex_map->set_jvms(caller->clone_shallow(C));
1096       ex_map->jvms()->set_map(ex_map);
1097       _exits.push_exception_state(ex_map);
1098     }
1099     assert(_exits.map() == normal_map, "keep the same return state");
1100   }
1101 
1102   {
1103     // Capture very early exceptions (receiver null checks) from caller JVMS
1104     GraphKit caller(_caller);
1105     SafePointNode* ex_map;
1106     while ((ex_map = caller.pop_exception_state()) != NULL) {
1107       _exits.add_exception_state(ex_map);
1108     }
1109   }
1110   _exits.map()->apply_replaced_nodes(_new_idx);
1111 }
1112 
1113 //-----------------------------create_entry_map-------------------------------
1114 // Initialize our parser map to contain the types at method entry.
1115 // For OSR, the map contains a single RawPtr parameter.
1116 // Initial monitor locking for sync. methods is performed by do_method_entry.
1117 SafePointNode* Parse::create_entry_map() {
1118   // Check for really stupid bail-out cases.
1119   uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1120   if (len >= 32760) {
1121     C->record_method_not_compilable("too many local variables");
1122     return NULL;
1123   }
1124 
1125   // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1126   _caller->map()->delete_replaced_nodes();
1127 
1128   // If this is an inlined method, we may have to do a receiver null check.
1129   if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
1130     GraphKit kit(_caller);


< prev index next >