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

Vladimir Ivanov vlivanov at openjdk.java.net
Wed Aug 5 11:51:48 UTC 2020


On Wed, 5 Aug 2020 11:26:27 GMT, Maurizio Cimadamore <mcimadamore 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 :-)

Not sure it's the best way to fix the problem (need to look into the code more closely), but the fix looks good for now.

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

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


More information about the panama-dev mailing list