RFR: 8259937: guarantee(loc != NULL) failed: missing saved register with native invoker [v4]

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Feb 26 16:10:41 UTC 2021


On Thu, 25 Feb 2021 10:06:47 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Thanks for addressing the comments! Looks good.
>
> @JornVernee I'm not clear that your response addresses my point. I'm concerned that a thread stack dump reported by serviceability code may contain an extra frame for the stub call. This could occur while the Java thread is still in native and it could also include the case wher the native call re-enters into Java i.e. the extra frame could appear at the top of the stack dump or interleaved between Java method frames.
> 
> I don't see how that problem is mitigated by your suggestion that this only relates to Panama API use. Code which consumes any such stack dump (incluing 3rd party code) that might be affected by the presence of this extra frame will not care (or even be aware) that the native callout is a Panama call.
> 
> Anyway, since no one from the serviceability team has noted this as a potential problem I'm ok to see the patch proceed.

Overall, the fix looks good. 

At some point, there was no frame for native invoker set up and native state transitions were put inline in generated code, but that was rewritten.

Regarding the refactorings: I find newly introduced `spill_register()`/`fill_register()` methods very confusing. 
I'd prefer to see `spill_output_registers()`/`fill_output_registers()` instead and an assert in `NativeInvokerGenerator` constructor (akin to the one in `NativeInvokerGenerator::generate()` on x86_64): 
  assert(_output_registers.length() <= 1
    || (_output_registers.length() == 2 && !_output_registers.at(1)->is_valid()), "no multi-reg returns");

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

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


More information about the hotspot-compiler-dev mailing list