RFR: 8296440: Remove Method* handling from cleanup_inline_caches_impl

Richard Reingruber rrich at openjdk.org
Mon Mar 20 18:20:03 UTC 2023


On Thu, 16 Mar 2023 00:17:27 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> I hit guarantee in tier7 running our closed tests with JRuby and `-Xcomp -ea -esa -XX:CompileThreshold=100` flags:
> 
> ```
> #  Internal Error (/workspace/open/src/hotspot/share/runtime/sharedRuntime.cpp:1411), pid=1150904, tid=1150907
> #  guarantee(false) failed: Missing dependency resolving optimized virtual (invokeinterface) call to  jnr.enxio.channels.Native$LibC$jnr$ffi$2::read
> ```
> 
> Unfortunately I can't share tests.

Thanks again for the testing.

The guarantee fails for the read call at https://github.com/jnr/jnr-enxio/blob/4e21f3a341c2cb7e8007b7bebfb964182d36318d/src/main/java/jnr/enxio/channels/Native.java#L120. It is an invokeinterface with a [constant receiver](https://github.com/jnr/jnr-enxio/blob/4e21f3a341c2cb7e8007b7bebfb964182d36318d/src/main/java/jnr/enxio/channels/Native.java#L67).

I've implemented and added a test. The guarantee fails when CHA based optimization is not possible. Then no dependencies are emitted but the call is still optimized based on the constness of the receiver. Btw wouldn't it be better to skip the CHA attempt in order to avoid emitting dependencies? It might be even possible that the caller gets deoptimized because of them.

I've adapted the verification code. If the receiver is found among the constants then we know a permanent path to the target exists even if the receiver is not constant as the target does not depend on the receiver.

My reproducer `./bin/jruby -J-Xcomp -J-ea -J-esa -J-XX:CompileThreshold=100 -S rake spec:ruby:fast` does not hit the guarantee with the changes anymore.

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

PR Comment: https://git.openjdk.org/jdk/pull/12802#issuecomment-1476722228


More information about the hotspot-dev mailing list