On Fri, 20 Mar 2026 10:13:21 GMT, Marc Chevalier <[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
>
> Yes, when we look deeply inside how things happen under the hood, it's not 
> shocking we may occasionally need to pin some behavior with a flag. I'm 
> convinced.

Thanks @marc-chevalier and @TobiHartmann for your reviews!

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

PR Comment: https://git.openjdk.org/valhalla/pull/2247#issuecomment-4099594580

Reply via email to