[foreign-abi] RFR: 8251047: GC stackwalking doesn't work when intrinsics are enabled

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Aug 5 11:28:50 UTC 2020


On Wed, 5 Aug 2020 10:54:02 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Hi,
> 
> This patch fixes GC stack walking for optimized native calls.
> 
> For calls in compiled frames, the callee argument oops are processed using special case code in
> `CompiledMethod::preserve_callee_argument_oops`. This code relies on the original bytecode to find the signature of the
> callee, but for optimized native calls this doesn't make sense, since the original call is replaced, and some of the
> arguments (notably some that are oops) are discarded. In the case of an optimized native call, we can skip all callee
> argument oop processing, since we can't pass any oops to native calls any ways.  Since the current code was already
> looking at debug info to find the signature of the callee, I piggy-backed on that to add a flag for optimized native
> calls. If the flag is set, we return early, skipping any processing.  (I left in the assert I used to debug this, since
> it gives the failure a better error message, should we run into this again in the future)  Thanks, Jorn

Makes sense to me - probably better if somebody from the VM team takes a look :-)

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

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/279


More information about the panama-dev mailing list