|
74 | 74 | #include "runtime/synchronizer.inline.hpp"
|
75 | 75 | #include "runtime/timerTrace.hpp"
|
76 | 76 | #include "runtime/vframe.inline.hpp"
|
| 77 | +#include "runtime/vframe_hp.hpp" |
77 | 78 | #include "runtime/vframeArray.hpp"
|
78 | 79 | #include "runtime/vm_version.hpp"
|
79 | 80 | #include "utilities/copy.hpp"
|
@@ -1201,29 +1202,40 @@ Handle SharedRuntime::find_callee_info_helper(vframeStream& vfst, Bytecodes::Cod
|
1201 | 1202 | bool caller_is_jvmci = vfst.nm()->is_compiled_by_jvmci();
|
1202 | 1203 |
|
1203 | 1204 | if (!trust_bytecode && attached_method.not_null() && caller_is_jvmci) {
|
1204 |
| - // invoke does not correspond to bytecode |
1205 | 1205 | RegisterMap reg_map2(current,
|
1206 | 1206 | RegisterMap::UpdateMap::include,
|
1207 | 1207 | RegisterMap::ProcessFrames::include,
|
1208 | 1208 | RegisterMap::WalkContinuation::skip);
|
1209 | 1209 | frame stubFrame = current->last_frame();
|
1210 | 1210 | frame callerFrame = stubFrame.sender(®_map2);
|
1211 |
| - |
1212 |
| - Method* callee = attached_method(); |
1213 |
| - |
1214 |
| - if (attached_method->is_static()) { |
1215 |
| - bc = Bytecodes::_invokestatic; |
1216 |
| - } else { |
1217 |
| - receiver = Handle(current, callerFrame.retrieve_receiver(®_map2)); |
1218 |
| - if (attached_method->method_holder()->is_interface()) { |
1219 |
| - bc = Bytecodes::_invokeinterface; |
| 1211 | + javaVFrame* jVFrame = vfst.asJavaVFrame(); |
| 1212 | + assert(jVFrame->is_compiled_frame(), "should be compiled frame"); |
| 1213 | + compiledVFrame* cVFrame = (compiledVFrame*) jVFrame; |
| 1214 | + bool should_reexecute = cVFrame->should_reexecute(); |
| 1215 | + Bytecodes::Code code = caller->java_code_at(bci); |
| 1216 | + // TODO for Valhalla: If the bytecode is if_acmpeq or if_acmpne and the attached method performs a substitutability check, skip this logic. |
| 1217 | + // Valhalla adds handling for substitutability checks in this method. |
| 1218 | + bool is_substitutability_check = (code == Bytecodes::_if_acmpeq || code == Bytecodes::_if_acmpne) && false; |
| 1219 | + if (cVFrame->should_reexecute() && !is_substitutability_check) { |
| 1220 | + // For invoke bytecodes, the reexecute bit is not set (see Interpreter::bytecode_should_reexecute). |
| 1221 | + // Since the reexecute bit is set for this call, no corresponding invoke bytecode exists. |
| 1222 | + Method* callee = attached_method(); |
| 1223 | + if (attached_method->is_static()) { |
| 1224 | + bc = Bytecodes::_invokestatic; |
1220 | 1225 | } else {
|
1221 |
| - bc = Bytecodes::_invokevirtual; |
| 1226 | + receiver = Handle(current, callerFrame.retrieve_receiver(®_map2)); |
| 1227 | + if (attached_method->method_holder()->is_interface()) { |
| 1228 | + bc = Bytecodes::_invokeinterface; |
| 1229 | + } else { |
| 1230 | + bc = Bytecodes::_invokevirtual; |
| 1231 | + } |
1222 | 1232 | }
|
| 1233 | + |
| 1234 | + LinkResolver::resolve_invoke(callinfo, receiver, attached_method, bc, CHECK_NH); |
| 1235 | + return receiver; |
1223 | 1236 | }
|
1224 | 1237 |
|
1225 |
| - LinkResolver::resolve_invoke(callinfo, receiver, attached_method, bc, CHECK_NH); |
1226 |
| - return receiver; |
| 1238 | + |
1227 | 1239 | }
|
1228 | 1240 | #else
|
1229 | 1241 | methodHandle attached_method(THREAD, extract_attached_method(vfst));
|
|
0 commit comments