RFR(S) 8146201: [AOT] Class static initializers that are not pure should not be executed during static compilation
vladimir.kozlov at oracle.com
Mon Mar 19 23:01:01 UTC 2018
Okay. thank you for explanation.
On 3/19/18 3:39 PM, dean.long at oracle.com wrote:
> Hi Vladimir. Thanks for looking at it.
> On 3/19/18 2:16 PM, Vladimir Kozlov wrote:
>> Changes are fine I think but I don't see changes for AOT code mentioned in bug report:
> withEagerResolving(true) by itself is not the problem, except that it used to imply "eager
> initialization" as well. Now, we allow HotSpotClassInitializationPlugin to override the default
> eagerResolving --> implies eagerInitializing behavior, so that for AOT we can have eagerResolving ==
> true and eagerInitializing == false.
> My first idea was to add withEagerInitializing() to GraphBuilderConfiguration, but I decided to go
> with just the HotSpotClassInitializationPlugin changes instead.
>> On 3/19/18 1:32 PM, dean.long at oracle.com wrote:
>>> Previously, jaotc would run static initializers on classes it accessed during compilation, which
>>> is undesirable if those initializers are not pure. This change does not attempt to identify if
>>> an initializer is pure. Instead, the compiler avoids triggering any initialization at all, while
>>> still doing eager resolution and linking. The upstream Graal changes have been pushed here:
>>> where a new HotSpotLazyInitializationTest test was also added.
More information about the hotspot-compiler-dev