use of st.gravel.support.compiler.jvm.JVMDefinedObjectType in project gravel by gravel-st.
the class JavaSystemMappingCompilerTools method runAstInit_.
@Override
public SystemMappingCompilerTools runAstInit_(JVMClass jvmClass) {
JVMDefinedObjectType key = jvmClass.type();
CompiledClass current = jvmClasses.get(key);
Object[] astConstants = jvmClass.astConstants();
if (astConstants.length == 0)
return this;
MethodType type = MethodType.genericMethodType(astConstants.length).changeReturnType(void.class);
MethodHandle findStatic;
try {
findStatic = MethodHandles.lookup().findStatic(current.javaClass, "_astinit", type);
findStatic.invokeWithArguments(astConstants);
} catch (Throwable e) {
throw new RuntimeException(e);
}
return this;
}
Aggregations