Experimentation with build time and runtime class initialization in qbicc

David P Grove groved at us.ibm.com
Thu May 26 16:35:55 UTC 2022


Hi,

In the qbicc project, we’ve been exploring options for adapting Java’s class initialization semantics for native images.  In particular, we are trying to arrive at a non-surprising semantics that in a native-image scenarios allows most initialization to happen at build-time while still enabling runtime initialization of selected static fields.

Our current design and experience is captured here: https://github.com/qbicc/qbicc/wiki/Class-Initialization-in-qbicc.  In a nutshell, the idea is to initialize classes via build-time execution of existing <clinit> methods as per normal Java semantics while adding per-static-field <rtinit> methods to provide a capability for runtime-reinitialization of a field before its first access.

--dave



More information about the leyden-dev mailing list