RFR: 8371121: compiler/whitebox/DeoptimizeRelocatedNMethod.java fails with C1
Christian Hagedorn
chagedorn at openjdk.org
Thu Nov 13 13:31:41 UTC 2025
On Wed, 12 Nov 2025 00:59:54 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
> [JDK-8371121](https://bugs.openjdk.org/browse/JDK-8371121)
>
> This update aims to improve the test’s stability. A previous failure occurred because the method wasn’t compiled at the time of the check. I believe this could have occurred due to a deoptimization but I have not been able to reproduce. Previously, the test ensured compilation by repeatedly invoking the function. Instead, we now use Whitebox to add the method directly to the compile queue and wait for it to finish compiling. This approach should eliminate issues caused by deoptimization from function calls.
test/hotspot/jtreg/compiler/whitebox/DeoptimizeRelocatedNMethod.java line 64:
> 62: while (WHITE_BOX.isMethodQueuedForCompilation(method)) {
> 63: Thread.onSpinWait();
> 64: }
Thanks for tackling this. I have a concern that this can still fail when we remove the task from the queue to compile it, i.e. `isMethodQueuedForCompilation()` returns false, but we have not finished the compilation in the background and already check if it's compiled below. Can't we just re-add `-Xbatch` which makes `enqueueMethodForCompilation()` blocking until the method is compiled? Then you can remove the loop.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28246#discussion_r2523472797
More information about the hotspot-compiler-dev
mailing list