On Fri, 20 Mar 2026 10:02:19 GMT, Christian Hagedorn <[email protected]> 
wrote:

> 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

Looks good.

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

Marked as reviewed by thartmann (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2247#pullrequestreview-3981449509

Reply via email to