use of com.oracle.truffle.llvm.runtime.LLVMArgumentBuffer in project graal by oracle.
the class LLVMGlobalRootNode method executeWithoutFrame.
@SuppressWarnings("try")
@TruffleBoundary
private Object executeWithoutFrame() {
LLVMStack stack = getContext().getThreadingStack().getStack();
try {
Object appPath = new LLVMArgumentBuffer(applicationPath);
LLVMManagedPointer applicationPathObj = LLVMManagedPointer.create(appPath);
Object[] realArgs = new Object[] { stack, mainFunctionType, applicationPathObj, getContext().getSymbolUncached(mainFunction) };
Object result = startFunction.call(realArgs);
getContext().awaitThreadTermination();
return (int) result;
} catch (LLVMExitException e) {
LLVMContext context = getContext();
// if any variant of exit or abort was called, we know that all the necessary
// cleanup was already done
context.setCleanupNecessary(false);
context.awaitThreadTermination();
return e.getExceptionExitStatus();
} finally {
// if not done already, we want at least call a shutdown command
getContext().shutdownThreads();
}
}
Aggregations