RFR: 8330105: SharedRuntime::resolve* should respect interpreter-only mode
Patricio Chilano Mateo
pchilanomate at openjdk.org
Mon Apr 15 14:27:01 UTC 2024
On Thu, 11 Apr 2024 13:50:25 GMT, Yudi Zheng <yzheng at openjdk.org> wrote:
> JavaThread::set_interp_only_mode may be called while a thread is blocked waiting for a JIT compilation to complete. When interpreter-only mode is set, we should dispatch to interpreter instead of the returned compiled code.
This is the same initial fix I proposed for JDK-8302351 but which I later changed when stumbling upon some exception cases where we cannot just return the c2i adapter entry: method handle intrinsics and enterSpecial/doYield methods.
For method handle intrinsics, _linkToNative doesn't have an interpreter version so the c2i will lead to a i2c and we will crash because we cannot cascade those. For the other method handle intrinsics, although there is an interpreter version, I found another issue where generate_method_handle_interpreter_entry() can throw an exception before we create the interpreter frame, which will lead to crashes when walking the stack.
Regarding enterSpecial/doYield, those also lack an interpreter version as _linkToNative(although enterSpecial has a hack here), but they are not really an issue today because we cannot switch to interpreter only mode while resolving those methods.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18741#issuecomment-2056989452
More information about the hotspot-dev
mailing list