When compiling a method, we check whether it is a trivial method like a simple 
getter. When this is the case, we only directly compile it with C1 without 
profiling (level 1) because we cannot optimize it better with C2. In Valhalla, 
we want to special case this with a value class: We still want to C2 compile 
such trivial methods in order to be able to use the scalarized calling 
convention.  `compiler/valhalla/inlinetypes/TestTrivialMethods.java` checks 
that this special casing works.

Before  [JDK-8380053](https://bugs.openjdk.org/browse/JDK-8380053), 
`TestTrivialMethods` passed even with `-XX:-PreloadClasses` because it 
contained at least one `@NullRestricted` field which triggered a mandatory 
class preloading. JDK-8380053 now removed this mandatory preloading. When then 
running `TestTrivialMethods`  with `-XX:-PreloadClasses`, no preloading will be 
done anymore and the test starts to fail. I'm therefore proposing to simply 
pass `-XX:+PreloadClasses` to the test such that it works with our CI stress 
testing job that also runs tests with `-XX:-PreloadClasses`.

Thanks,
Christian

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

Commit messages:
 - 8380520: [lworld] compiler/valhalla/inlinetypes/TestTrivialMethods.java 
fails with -XX:-PreloadClasses after JDK-8380053

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

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

Reply via email to