We noticed that `VectorUnsignedMinMaxOperationsTest.java` timed out in the 
Valhalla CI with `--enable-preview`. The root cause is that the test has a 
large number of `@Run` methods that get excluded from compilation and call 
`Verify.checkEQ(int_out[i], expected)` with `int` arguments that are autoboxed 
by `Integer.valueOf`. I.e. we call `Integer.valueOf` which returns a scalarized 
Integer from the interpreter and thus have to buffer via the slow path (due to 
`-XX:-UseTLAB`) by calling `StubRoutines::store_inline_type_fields_to_buf`. 
This is slower than buffering in the callee which happens in the baseline:

Without `--enable-preview` the test runs for 6m27.851s vs. with 
`--enable-preview` the test runs for 9m9.105s.

The fix is to add a fast path to 
`SharedRuntime::store_inline_type_fields_to_buf` that delegates initialization 
of the buffer to the calling stub which calls the pack handler after the 
runtime call returned. I also moved the expensive `RegisterMap` creation to the 
slow path. This improves runtime significantly to 5m34.543s which is even 
faster than the baseline (don't ask me why :slightly_smiling_face:).

Thanks,
Tobias

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - Cleanup
 - Merge branch 'lworld' into JDK-8383997
 - Merge branch 'lworld' into JDK-8383997
 - JDK-8383997 prototype

Changes: https://git.openjdk.org/valhalla/pull/2438/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2438&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8383997
  Stats: 66 lines in 3 files changed: 49 ins; 16 del; 1 mod
  Patch: https://git.openjdk.org/valhalla/pull/2438.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2438/head:pull/2438

PR: https://git.openjdk.org/valhalla/pull/2438

Reply via email to