use of com.oracle.svm.core.annotate.Substitute in project graal by oracle.
the class Target_com_oracle_truffle_nfi_impl_NFIContext method prepareSignatureVarargs.
@Substitute
@SuppressWarnings("static-method")
long prepareSignatureVarargs(Target_com_oracle_truffle_nfi_impl_LibFFIType retType, int nFixedArgs, Target_com_oracle_truffle_nfi_impl_LibFFIType... args) {
CifData data = PrepareHelper.prepareArgs(args);
int ret = LibFFI.ffi_prep_cif_var(data.cif(), LibFFI.FFI_DEFAULT_ABI(), WordFactory.unsigned(nFixedArgs), WordFactory.unsigned(args.length), WordFactory.pointer(retType.type), data.args());
return PrepareHelper.checkRet(data, ret);
}
use of com.oracle.svm.core.annotate.Substitute in project graal by oracle.
the class Target_com_oracle_truffle_nfi_impl_NFIContext method initializeNativeContext.
// Checkstyle: resume
@Substitute
private long initializeNativeContext() {
TruffleNFISupport support = ImageSingletons.lookup(TruffleNFISupport.class);
NativeTruffleContext ret = UnmanagedMemory.malloc(SizeOf.get(NativeTruffleContext.class));
ret.setContextHandle(support.createContextHandle(this));
NFIInitialization.initializeContext(ret);
return ret.rawValue();
}
use of com.oracle.svm.core.annotate.Substitute in project graal by oracle.
the class Target_com_oracle_truffle_nfi_impl_NFIContext method initializeNativeEnv.
@Substitute
private static long initializeNativeEnv(long context) {
NativeTruffleContext ctx = WordFactory.pointer(context);
NativeTruffleEnv env = UnmanagedMemory.malloc(SizeOf.get(NativeTruffleEnv.class));
NFIInitialization.initializeEnv(env, ctx);
return env.rawValue();
}
use of com.oracle.svm.core.annotate.Substitute in project graal by oracle.
the class Target_com_oracle_truffle_nfi_impl_NFIContext method disposeNativeContext.
@Substitute
private static void disposeNativeContext(long context) {
TruffleNFISupport support = ImageSingletons.lookup(TruffleNFISupport.class);
NativeTruffleContext ctx = WordFactory.pointer(context);
support.destroyContextHandle(ctx.contextHandle());
UnmanagedMemory.free(ctx);
}
Aggregations