RFR: 8355387: [jittester] Disable downcasts by default

Evgeny Nikitin enikitin at openjdk.org
Thu Apr 24 06:27:52 UTC 2025


Currently, JITTester's love to downcast often produces something like this:

ArrayList<Integer> someVar = (TreeSet)(Object)(List)(new ArrayList<Integer>());

... which is possible because it goes up to Object and then starts downcasting to some totally unrelated class / type.

Considering the JITTester's love to casts (they are more-or-less 'safe' expressions), it means a high probability (30-50%) of a gentest to fail compilation. Even worse is the situation for ByteCode tests - that they're faulty is only recognized during the run phase.

I suggest to disable the downcasts for now.
Testing: 50-100 generated tests in different combinations (default, with the flag set to 'false' or 'true') with artificially increased chance to casts.

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

Commit messages:
 - 8355387: [jittester] Disable downcasts by default

Changes: https://git.openjdk.org/jdk/pull/24840/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24840&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8355387
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24840.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24840/head:pull/24840

PR: https://git.openjdk.org/jdk/pull/24840


More information about the hotspot-compiler-dev mailing list