org.qbicc.runtime.main.RuntimeInitializerRunner Maven / Gradle / Ivy
Show all versions of qbicc-runtime-main Show documentation
package org.qbicc.runtime.main;
import org.qbicc.runtime.AutoQueued;
import org.qbicc.runtime.Hidden;
/**
* Effectively a lambda that will execute a specific runtime initializer.
*
* Runtime init checks are constructed by compile-time instantiation of
* a Once instance whose Runnable is an instance of this class with the
* initID of the target initializer. These instances are then serialized
* as part of the build time heap.
*/
@SuppressWarnings("unused")
public final class RuntimeInitializerRunner implements Runnable {
private final int initID;
private RuntimeInitializerRunner(int initID) {
this.initID = initID;
}
@SuppressWarnings("unused") // invoked at buildtime
public static Once allocateThunk(int initID) {
return new Once(new RuntimeInitializerRunner(initID));
}
@Override
@AutoQueued
@Hidden
public void run() {
CompilerIntrinsics.callRuntimeInitializer(initID);
}
}