< prev index next >

src/hotspot/share/opto/parse1.cpp

Print this page

1127   _exits.map()->apply_replaced_nodes(_new_idx);
1128 }
1129 
1130 //-----------------------------create_entry_map-------------------------------
1131 // Initialize our parser map to contain the types at method entry.
1132 // For OSR, the map contains a single RawPtr parameter.
1133 // Initial monitor locking for sync. methods is performed by do_method_entry.
1134 SafePointNode* Parse::create_entry_map() {
1135   // Check for really stupid bail-out cases.
1136   uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1137   if (len >= 32760) {
1138     // Bailout expected, this is a very rare edge case.
1139     C->record_method_not_compilable("too many local variables");
1140     return nullptr;
1141   }
1142 
1143   // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1144   _caller->map()->delete_replaced_nodes();
1145 
1146   // If this is an inlined method, we may have to do a receiver null check.
1147   if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
1148     GraphKit kit(_caller);
1149     kit.null_check_receiver_before_call(method());









1150     _caller = kit.transfer_exceptions_into_jvms();
1151     if (kit.stopped()) {
1152       _exits.add_exception_states_from(_caller);
1153       _exits.set_jvms(_caller);
1154       return nullptr;
1155     }
1156   }
1157 
1158   assert(method() != nullptr, "parser must have a method");
1159 
1160   // Create an initial safepoint to hold JVM state during parsing
1161   JVMState* jvms = new (C) JVMState(method(), _caller->has_method() ? _caller : nullptr);
1162   set_map(new SafePointNode(len, jvms));
1163   jvms->set_map(map());
1164   record_for_igvn(map());
1165   assert(jvms->endoff() == len, "correct jvms sizing");
1166 
1167   SafePointNode* inmap = _caller->map();
1168   assert(inmap != nullptr, "must have inmap");
1169   // In case of null check on receiver above

2150 
2151     Node* fast_io  = call->in(TypeFunc::I_O);
2152     Node* fast_mem = call->in(TypeFunc::Memory);
2153     // These two phis are pre-filled with copies of of the fast IO and Memory
2154     Node* io_phi   = PhiNode::make(result_rgn, fast_io,  Type::ABIO);
2155     Node* mem_phi  = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
2156 
2157     result_rgn->init_req(2, control());
2158     io_phi    ->init_req(2, i_o());
2159     mem_phi   ->init_req(2, reset_memory());
2160 
2161     set_all_memory( _gvn.transform(mem_phi) );
2162     set_i_o(        _gvn.transform(io_phi) );
2163   }
2164 
2165   set_control( _gvn.transform(result_rgn) );
2166 }
2167 
2168 // Add check to deoptimize once holder klass is fully initialized.
2169 void Parse::clinit_deopt() {



2170   assert(C->has_method(), "only for normal compilations");
2171   assert(depth() == 1, "only for main compiled method");
2172   assert(is_normal_parse(), "no barrier needed on osr entry");
2173   assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2174 
2175   set_parse_bci(0);
2176 
2177   Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2178   guard_klass_being_initialized(holder);
2179 }
2180 
2181 // Add check to deoptimize if RTM state is not ProfileRTM
2182 void Parse::rtm_deopt() {
2183 #if INCLUDE_RTM_OPT
2184   if (C->profile_rtm()) {
2185     assert(C->has_method(), "only for normal compilations");
2186     assert(!C->method()->method_data()->is_empty(), "MDO is needed to record RTM state");
2187     assert(depth() == 1, "generate check only for main compiled method");
2188 
2189     // Set starting bci for uncommon trap.

1127   _exits.map()->apply_replaced_nodes(_new_idx);
1128 }
1129 
1130 //-----------------------------create_entry_map-------------------------------
1131 // Initialize our parser map to contain the types at method entry.
1132 // For OSR, the map contains a single RawPtr parameter.
1133 // Initial monitor locking for sync. methods is performed by do_method_entry.
1134 SafePointNode* Parse::create_entry_map() {
1135   // Check for really stupid bail-out cases.
1136   uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1137   if (len >= 32760) {
1138     // Bailout expected, this is a very rare edge case.
1139     C->record_method_not_compilable("too many local variables");
1140     return nullptr;
1141   }
1142 
1143   // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1144   _caller->map()->delete_replaced_nodes();
1145 
1146   // If this is an inlined method, we may have to do a receiver null check.
1147   if (_caller->has_method() && is_normal_parse()) {
1148     GraphKit kit(_caller);
1149     if (!method()->is_static()) {
1150       kit.null_check_receiver_before_call(method());
1151     } else if (C->do_clinit_barriers() && C->needs_clinit_barrier(method()->holder(), _caller->method())) {
1152       ciMethod* declared_method = kit.method()->get_method_at_bci(kit.bci());
1153       const int nargs = declared_method->arg_size();
1154       kit.inc_sp(nargs);
1155       Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
1156       kit.guard_klass_is_initialized(holder);
1157       kit.dec_sp(nargs);
1158     }
1159     _caller = kit.transfer_exceptions_into_jvms();
1160     if (kit.stopped()) {
1161       _exits.add_exception_states_from(_caller);
1162       _exits.set_jvms(_caller);
1163       return nullptr;
1164     }
1165   }
1166 
1167   assert(method() != nullptr, "parser must have a method");
1168 
1169   // Create an initial safepoint to hold JVM state during parsing
1170   JVMState* jvms = new (C) JVMState(method(), _caller->has_method() ? _caller : nullptr);
1171   set_map(new SafePointNode(len, jvms));
1172   jvms->set_map(map());
1173   record_for_igvn(map());
1174   assert(jvms->endoff() == len, "correct jvms sizing");
1175 
1176   SafePointNode* inmap = _caller->map();
1177   assert(inmap != nullptr, "must have inmap");
1178   // In case of null check on receiver above

2159 
2160     Node* fast_io  = call->in(TypeFunc::I_O);
2161     Node* fast_mem = call->in(TypeFunc::Memory);
2162     // These two phis are pre-filled with copies of of the fast IO and Memory
2163     Node* io_phi   = PhiNode::make(result_rgn, fast_io,  Type::ABIO);
2164     Node* mem_phi  = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
2165 
2166     result_rgn->init_req(2, control());
2167     io_phi    ->init_req(2, i_o());
2168     mem_phi   ->init_req(2, reset_memory());
2169 
2170     set_all_memory( _gvn.transform(mem_phi) );
2171     set_i_o(        _gvn.transform(io_phi) );
2172   }
2173 
2174   set_control( _gvn.transform(result_rgn) );
2175 }
2176 
2177 // Add check to deoptimize once holder klass is fully initialized.
2178 void Parse::clinit_deopt() {
2179   if (method()->holder()->is_initialized()) {
2180     return; // in case do_clinit_barriers() is true
2181   }
2182   assert(C->has_method(), "only for normal compilations");
2183   assert(depth() == 1, "only for main compiled method");
2184   assert(is_normal_parse(), "no barrier needed on osr entry");
2185   assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2186 
2187   set_parse_bci(0);
2188 
2189   Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2190   guard_klass_being_initialized(holder);
2191 }
2192 
2193 // Add check to deoptimize if RTM state is not ProfileRTM
2194 void Parse::rtm_deopt() {
2195 #if INCLUDE_RTM_OPT
2196   if (C->profile_rtm()) {
2197     assert(C->has_method(), "only for normal compilations");
2198     assert(!C->method()->method_data()->is_empty(), "MDO is needed to record RTM state");
2199     assert(depth() == 1, "generate check only for main compiled method");
2200 
2201     // Set starting bci for uncommon trap.
< prev index next >