use of com.oracle.svm.core.c.function.CEntryPointOptions in project graal by oracle.
the class NativeClosure method invokeClosureObjectRet.
@CEntryPoint
@CEntryPointOptions(prologue = EnterClosureDataIsolatePrologue.class, publishAs = Publish.NotPublished, include = CEntryPointOptions.NotIncludedAutomatically.class)
static void invokeClosureObjectRet(@SuppressWarnings("unused") ffi_cif cif, WordPointer ret, WordPointer args, ClosureData user) {
CIntPointer errnoMirror = ErrnoMirror.getErrnoMirrorLocation();
errnoMirror.write(Errno.errno());
try {
Object obj = lookup(user).call(args, null);
if (obj == null) {
ret.write(WordFactory.zero());
} else {
TruffleObjectHandle handle = ImageSingletons.lookup(TruffleNFISupport.class).createGlobalHandle(obj);
ret.write(handle);
}
} finally {
Errno.set_errno(errnoMirror.read());
}
}
use of com.oracle.svm.core.c.function.CEntryPointOptions in project graal by oracle.
the class NativeClosure method invokeClosureStringRet.
@CEntryPoint
@CEntryPointOptions(prologue = EnterClosureDataIsolatePrologue.class, publishAs = Publish.NotPublished, include = CEntryPointOptions.NotIncludedAutomatically.class)
static void invokeClosureStringRet(@SuppressWarnings("unused") ffi_cif cif, WordPointer ret, WordPointer args, ClosureData user) {
CIntPointer errnoMirror = ErrnoMirror.getErrnoMirrorLocation();
errnoMirror.write(Errno.errno());
try {
Object retValue = lookup(user).call(args, null);
ret.write(serializeStringRet(retValue));
} finally {
Errno.set_errno(errnoMirror.read());
}
}
Aggregations