RFR: 8255452: Doing GC during JVMTI MethodExit event posting breaks return oop
Erik Österlund
eosterlund at openjdk.java.net
Fri Oct 30 14:12:57 UTC 2020
On Fri, 30 Oct 2020 00:58:06 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Thanks for having a look coleen. In fact, not doing the JRT_BLOCK for the exception entry is intentional, because that entry goes through a different JRT_ENTRY (not JRT_BLOCK_ENTRY), that already transitions. So if I do the JRT_BLOCK for the exception path, it asserts saying hey you are already in VM.
>
> Oh that's actually horrible. I wonder if it's possible to hoist saving the result oop into the InterpreterRuntime entry. And pass the Handle into JvmtiExport::post_method_exit().
I tried that first, and ended up with a bunch of non-trivial code duplication instead, as reading the oop is done in both paths but for different reasons. One to preserve/restore it (interpreter remove_activation entry), but also inside of JvmtiExport::post_method_exit() so that it can be passed into the MethodExit. I will give it another shot and see if it is possible to refactor it in a better way.
-------------
PR: https://git.openjdk.java.net/jdk/pull/930
More information about the serviceability-dev
mailing list