< prev index next >

src/hotspot/share/opto/parse1.cpp

Print this page

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









1140     _caller = kit.transfer_exceptions_into_jvms();
1141     if (kit.stopped()) {
1142       _exits.add_exception_states_from(_caller);
1143       _exits.set_jvms(_caller);
1144       return nullptr;
1145     }
1146   }
1147 
1148   assert(method() != nullptr, "parser must have a method");
1149 
1150   // Create an initial safepoint to hold JVM state during parsing
1151   JVMState* jvms = new (C) JVMState(method(), _caller->has_method() ? _caller : nullptr);
1152   set_map(new SafePointNode(len, jvms));
1153   jvms->set_map(map());
1154   record_for_igvn(map());
1155   assert(jvms->endoff() == len, "correct jvms sizing");
1156 
1157   SafePointNode* inmap = _caller->map();
1158   assert(inmap != nullptr, "must have inmap");
1159   // In case of null check on receiver above

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



2173   assert(C->has_method(), "only for normal compilations");
2174   assert(depth() == 1, "only for main compiled method");
2175   assert(is_normal_parse(), "no barrier needed on osr entry");
2176   assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2177 
2178   set_parse_bci(0);
2179 
2180   Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2181   guard_klass_being_initialized(holder);
2182 }
2183 
2184 //------------------------------return_current---------------------------------
2185 // Append current _map to _exit_return
2186 void Parse::return_current(Node* value) {
2187   if (method()->intrinsic_id() == vmIntrinsics::_Object_init) {
2188     call_register_finalizer();
2189   }
2190 
2191   // Do not set_parse_bci, so that return goo is credited to the return insn.
2192   set_bci(InvocationEntryBci);

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

2162 
2163     Node* fast_io  = call->in(TypeFunc::I_O);
2164     Node* fast_mem = call->in(TypeFunc::Memory);
2165     // These two phis are pre-filled with copies of of the fast IO and Memory
2166     Node* io_phi   = PhiNode::make(result_rgn, fast_io,  Type::ABIO);
2167     Node* mem_phi  = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
2168 
2169     result_rgn->init_req(2, control());
2170     io_phi    ->init_req(2, i_o());
2171     mem_phi   ->init_req(2, reset_memory());
2172 
2173     set_all_memory( _gvn.transform(mem_phi) );
2174     set_i_o(        _gvn.transform(io_phi) );
2175   }
2176 
2177   set_control( _gvn.transform(result_rgn) );
2178 }
2179 
2180 // Add check to deoptimize once holder klass is fully initialized.
2181 void Parse::clinit_deopt() {
2182   if (method()->holder()->is_initialized()) {
2183     return; // in case do_clinit_barriers() is true
2184   }
2185   assert(C->has_method(), "only for normal compilations");
2186   assert(depth() == 1, "only for main compiled method");
2187   assert(is_normal_parse(), "no barrier needed on osr entry");
2188   assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2189 
2190   set_parse_bci(0);
2191 
2192   Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2193   guard_klass_being_initialized(holder);
2194 }
2195 
2196 //------------------------------return_current---------------------------------
2197 // Append current _map to _exit_return
2198 void Parse::return_current(Node* value) {
2199   if (method()->intrinsic_id() == vmIntrinsics::_Object_init) {
2200     call_register_finalizer();
2201   }
2202 
2203   // Do not set_parse_bci, so that return goo is credited to the return insn.
2204   set_bci(InvocationEntryBci);
< prev index next >