1128 _exits.map()->apply_replaced_nodes(_new_idx);
1129 }
1130
1131 //-----------------------------create_entry_map-------------------------------
1132 // Initialize our parser map to contain the types at method entry.
1133 // For OSR, the map contains a single RawPtr parameter.
1134 // Initial monitor locking for sync. methods is performed by do_method_entry.
1135 SafePointNode* Parse::create_entry_map() {
1136 // Check for really stupid bail-out cases.
1137 uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1138 if (len >= 32760) {
1139 // Bailout expected, this is a very rare edge case.
1140 C->record_method_not_compilable("too many local variables");
1141 return nullptr;
1142 }
1143
1144 // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1145 _caller->map()->delete_replaced_nodes();
1146
1147 // If this is an inlined method, we may have to do a receiver null check.
1148 if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
1149 GraphKit kit(_caller);
1150 kit.null_check_receiver_before_call(method());
1151 _caller = kit.transfer_exceptions_into_jvms();
1152 if (kit.stopped()) {
1153 _exits.add_exception_states_from(_caller);
1154 _exits.set_jvms(_caller);
1155 return nullptr;
1156 }
1157 }
1158
1159 assert(method() != nullptr, "parser must have a method");
1160
1161 // Create an initial safepoint to hold JVM state during parsing
1162 JVMState* jvms = new (C) JVMState(method(), _caller->has_method() ? _caller : nullptr);
1163 set_map(new SafePointNode(len, jvms));
1164 jvms->set_map(map());
1165 record_for_igvn(map());
1166 assert(jvms->endoff() == len, "correct jvms sizing");
1167
1168 SafePointNode* inmap = _caller->map();
1169 assert(inmap != nullptr, "must have inmap");
1170 // In case of null check on receiver above
2164
2165 Node* fast_io = call->in(TypeFunc::I_O);
2166 Node* fast_mem = call->in(TypeFunc::Memory);
2167 // These two phis are pre-filled with copies of of the fast IO and Memory
2168 Node* io_phi = PhiNode::make(result_rgn, fast_io, Type::ABIO);
2169 Node* mem_phi = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
2170
2171 result_rgn->init_req(2, control());
2172 io_phi ->init_req(2, i_o());
2173 mem_phi ->init_req(2, reset_memory());
2174
2175 set_all_memory( _gvn.transform(mem_phi) );
2176 set_i_o( _gvn.transform(io_phi) );
2177 }
2178
2179 set_control( _gvn.transform(result_rgn) );
2180 }
2181
2182 // Add check to deoptimize once holder klass is fully initialized.
2183 void Parse::clinit_deopt() {
2184 assert(C->has_method(), "only for normal compilations");
2185 assert(depth() == 1, "only for main compiled method");
2186 assert(is_normal_parse(), "no barrier needed on osr entry");
2187 assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2188
2189 set_parse_bci(0);
2190
2191 Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2192 guard_klass_being_initialized(holder);
2193 }
2194
2195 //------------------------------return_current---------------------------------
2196 // Append current _map to _exit_return
2197 void Parse::return_current(Node* value) {
2198 if (method()->intrinsic_id() == vmIntrinsics::_Object_init) {
2199 call_register_finalizer();
2200 }
2201
2202 // Do not set_parse_bci, so that return goo is credited to the return insn.
2203 set_bci(InvocationEntryBci);
|
1128 _exits.map()->apply_replaced_nodes(_new_idx);
1129 }
1130
1131 //-----------------------------create_entry_map-------------------------------
1132 // Initialize our parser map to contain the types at method entry.
1133 // For OSR, the map contains a single RawPtr parameter.
1134 // Initial monitor locking for sync. methods is performed by do_method_entry.
1135 SafePointNode* Parse::create_entry_map() {
1136 // Check for really stupid bail-out cases.
1137 uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
1138 if (len >= 32760) {
1139 // Bailout expected, this is a very rare edge case.
1140 C->record_method_not_compilable("too many local variables");
1141 return nullptr;
1142 }
1143
1144 // clear current replaced nodes that are of no use from here on (map was cloned in build_exits).
1145 _caller->map()->delete_replaced_nodes();
1146
1147 // If this is an inlined method, we may have to do a receiver null check.
1148 if (_caller->has_method() && is_normal_parse()) {
1149 GraphKit kit(_caller);
1150 if (!method()->is_static()) {
1151 kit.null_check_receiver_before_call(method());
1152 } else if (C->do_clinit_barriers() && C->needs_clinit_barrier(method()->holder(), _caller->method())) {
1153 ciMethod* declared_method = kit.method()->get_method_at_bci(kit.bci());
1154 const int nargs = declared_method->arg_size();
1155 kit.inc_sp(nargs);
1156 Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
1157 kit.guard_klass_is_initialized(holder);
1158 kit.dec_sp(nargs);
1159 }
1160 _caller = kit.transfer_exceptions_into_jvms();
1161 if (kit.stopped()) {
1162 _exits.add_exception_states_from(_caller);
1163 _exits.set_jvms(_caller);
1164 return nullptr;
1165 }
1166 }
1167
1168 assert(method() != nullptr, "parser must have a method");
1169
1170 // Create an initial safepoint to hold JVM state during parsing
1171 JVMState* jvms = new (C) JVMState(method(), _caller->has_method() ? _caller : nullptr);
1172 set_map(new SafePointNode(len, jvms));
1173 jvms->set_map(map());
1174 record_for_igvn(map());
1175 assert(jvms->endoff() == len, "correct jvms sizing");
1176
1177 SafePointNode* inmap = _caller->map();
1178 assert(inmap != nullptr, "must have inmap");
1179 // In case of null check on receiver above
2173
2174 Node* fast_io = call->in(TypeFunc::I_O);
2175 Node* fast_mem = call->in(TypeFunc::Memory);
2176 // These two phis are pre-filled with copies of of the fast IO and Memory
2177 Node* io_phi = PhiNode::make(result_rgn, fast_io, Type::ABIO);
2178 Node* mem_phi = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
2179
2180 result_rgn->init_req(2, control());
2181 io_phi ->init_req(2, i_o());
2182 mem_phi ->init_req(2, reset_memory());
2183
2184 set_all_memory( _gvn.transform(mem_phi) );
2185 set_i_o( _gvn.transform(io_phi) );
2186 }
2187
2188 set_control( _gvn.transform(result_rgn) );
2189 }
2190
2191 // Add check to deoptimize once holder klass is fully initialized.
2192 void Parse::clinit_deopt() {
2193 if (method()->holder()->is_initialized()) {
2194 return; // in case do_clinit_barriers() is true
2195 }
2196 assert(C->has_method(), "only for normal compilations");
2197 assert(depth() == 1, "only for main compiled method");
2198 assert(is_normal_parse(), "no barrier needed on osr entry");
2199 assert(!method()->holder()->is_not_initialized(), "initialization should have been started");
2200
2201 set_parse_bci(0);
2202
2203 Node* holder = makecon(TypeKlassPtr::make(method()->holder(), Type::trust_interfaces));
2204 guard_klass_being_initialized(holder);
2205 }
2206
2207 //------------------------------return_current---------------------------------
2208 // Append current _map to _exit_return
2209 void Parse::return_current(Node* value) {
2210 if (method()->intrinsic_id() == vmIntrinsics::_Object_init) {
2211 call_register_finalizer();
2212 }
2213
2214 // Do not set_parse_bci, so that return goo is credited to the return insn.
2215 set_bci(InvocationEntryBci);
|