RFR: 8255452: Doing GC during JVMTI MethodExit event posting breaks return oop [v2]

Erik Österlund eosterlund at openjdk.java.net
Wed Nov 4 09:06:07 UTC 2020


On Tue, 3 Nov 2020 17:49:38 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> Hi Erik,
> 
> I'm not sure, if this fragment is still needed:
> 
> ```
> 1620   if (state == NULL || !state->is_interp_only_mode()) {
> 1621     // for any thread that actually wants method exit, interp_only_mode is set
> 1622     return;
> 1623   }
> ```

Seems like it is not needed. I removed it.

> Also, can it be that this condition is true:
> ` (state == NULL || !state->is_interp_only_mode())`
> but the top frame is interpreted?
> If so, then should we still safe/restore the result oop over a possible safepoint?

It could definitely be that the top frame is interpreted even though that condition is true. However, we now enter InterpreterRuntime::post_method_exit as a JRT_BLOCK_ENTRY call, which performs no transition (similar to JRT_LEAF). So if so we should just return back to the caller without doing anything, and no GC will happen in this path then. It is only when we perform the JRT_BLOCK and JRT_BLOCK_END that we allow GCs to happen, and we save/restore the result across that section.

Thanks,


> Thanks,
> Serguei

-------------

PR: https://git.openjdk.java.net/jdk/pull/930


More information about the serviceability-dev mailing list