162 } else { 163 bcp = method()->bcp_from(bci()); 164 pc = Interpreter::deopt_continue_after_entry(method(), bcp, callee_parameters, is_top_frame); 165 use_next_mdp = true; 166 } 167 assert(Bytecodes::is_defined(*bcp), "must be a valid bytecode"); 168 169 // Monitorenter and pending exceptions: 170 // 171 // For Compiler2, there should be no pending exception when deoptimizing at monitorenter 172 // because there is no safepoint at the null pointer check (it is either handled explicitly 173 // or prior to the monitorenter) and asynchronous exceptions are not made "pending" by the 174 // runtime interface for the slow case (see JRT_ENTRY_FOR_MONITORENTER). If an asynchronous 175 // exception was processed, the bytecode pointer would have to be extended one bytecode beyond 176 // the monitorenter to place it in the proper exception range. 177 // 178 // For Compiler1, deoptimization can occur while throwing a NullPointerException at monitorenter, 179 // in which case bcp should point to the monitorenter since it is within the exception's range. 180 181 assert(*bcp != Bytecodes::_monitorenter || is_top_frame, "a _monitorenter must be a top frame"); 182 // TIERED Must know the compiler of the deoptee QQQ 183 COMPILER2_PRESENT(guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception, 184 "shouldn't get exception during monitorenter");) 185 186 int popframe_preserved_args_size_in_bytes = 0; 187 int popframe_preserved_args_size_in_words = 0; 188 if (is_top_frame) { 189 JvmtiThreadState *state = thread->jvmti_thread_state(); 190 if (JvmtiExport::can_pop_frame() && 191 (thread->has_pending_popframe() || thread->popframe_forcing_deopt_reexecution())) { 192 if (thread->has_pending_popframe()) { 193 // Pop top frame after deoptimization 194 #ifndef CC_INTERP 195 pc = Interpreter::remove_activation_preserving_args_entry(); 196 #else 197 // Do an uncommon trap type entry. c++ interpreter will know 198 // to pop frame and preserve the args 199 pc = Interpreter::deopt_entry(vtos, 0); 200 use_next_mdp = false; 201 #endif 202 } else { 203 // Reexecute invoke in top frame 204 pc = Interpreter::deopt_entry(vtos, 0); | 162 } else { 163 bcp = method()->bcp_from(bci()); 164 pc = Interpreter::deopt_continue_after_entry(method(), bcp, callee_parameters, is_top_frame); 165 use_next_mdp = true; 166 } 167 assert(Bytecodes::is_defined(*bcp), "must be a valid bytecode"); 168 169 // Monitorenter and pending exceptions: 170 // 171 // For Compiler2, there should be no pending exception when deoptimizing at monitorenter 172 // because there is no safepoint at the null pointer check (it is either handled explicitly 173 // or prior to the monitorenter) and asynchronous exceptions are not made "pending" by the 174 // runtime interface for the slow case (see JRT_ENTRY_FOR_MONITORENTER). If an asynchronous 175 // exception was processed, the bytecode pointer would have to be extended one bytecode beyond 176 // the monitorenter to place it in the proper exception range. 177 // 178 // For Compiler1, deoptimization can occur while throwing a NullPointerException at monitorenter, 179 // in which case bcp should point to the monitorenter since it is within the exception's range. 180 181 assert(*bcp != Bytecodes::_monitorenter || is_top_frame, "a _monitorenter must be a top frame"); 182 assert(thread->deopt_nmethod() != NULL, "nmethod should be known"); 183 guarantee(!(thread->deopt_nmethod()->is_compiled_by_c2() && 184 *bcp == Bytecodes::_monitorenter && 185 exec_mode == Deoptimization::Unpack_exception), 186 "shouldn't get exception during monitorenter"); 187 188 int popframe_preserved_args_size_in_bytes = 0; 189 int popframe_preserved_args_size_in_words = 0; 190 if (is_top_frame) { 191 JvmtiThreadState *state = thread->jvmti_thread_state(); 192 if (JvmtiExport::can_pop_frame() && 193 (thread->has_pending_popframe() || thread->popframe_forcing_deopt_reexecution())) { 194 if (thread->has_pending_popframe()) { 195 // Pop top frame after deoptimization 196 #ifndef CC_INTERP 197 pc = Interpreter::remove_activation_preserving_args_entry(); 198 #else 199 // Do an uncommon trap type entry. c++ interpreter will know 200 // to pop frame and preserve the args 201 pc = Interpreter::deopt_entry(vtos, 0); 202 use_next_mdp = false; 203 #endif 204 } else { 205 // Reexecute invoke in top frame 206 pc = Interpreter::deopt_entry(vtos, 0); |