use of org.graalvm.word.PointerBase in project graal by oracle.
the class Deoptimizer method logDeoptSourceFrameOperation.
private static void logDeoptSourceFrameOperation(Pointer sp, DeoptimizedFrame deoptimizedFrame) {
StringBuilderLog log = new StringBuilderLog();
PointerBase deoptimizedFrameAddress = deoptimizedFrame.getPin().addressOfObject();
log.string("deoptSourceFrameOperation: DeoptimizedFrame at ").hex(deoptimizedFrameAddress).string(": ");
printDeoptimizedFrame(log, sp, deoptimizedFrame, null);
recentDeoptimizationEvents.append(log.getResult());
}
use of org.graalvm.word.PointerBase in project graal by oracle.
the class NativeClosure method prepareClosure.
static Target_com_oracle_truffle_nfi_impl_ClosureNativePointer prepareClosure(Target_com_oracle_truffle_nfi_impl_NFIContext ctx, Target_com_oracle_truffle_nfi_impl_LibFFISignature signature, CallTarget callTarget, ffi_closure_callback callback) {
NativeClosure closure = new NativeClosure(callTarget, signature);
NativeClosureHandle handle = ImageSingletons.lookup(TruffleNFISupport.class).createClosureHandle(closure);
WordPointer codePtr = StackValue.get(SizeOf.get(WordPointer.class));
ClosureData data = ffi_closure_alloc(SizeOf.unsigned(ClosureData.class), codePtr);
data.setNativeClosureHandle(handle);
data.setIsolate(CEntryPointContext.getCurrentIsolate());
PointerBase code = codePtr.read();
LibFFI.ffi_prep_closure_loc(data.ffiClosure(), WordFactory.pointer(signature.cif), callback, data, code);
return ctx.createClosureNativePointer(data.rawValue(), code.rawValue(), callTarget, signature);
}
use of org.graalvm.word.PointerBase in project graal by oracle.
the class Target_com_oracle_truffle_nfi_impl_NFIContext method loadLibrary.
@Substitute
@TruffleBoundary
static long loadLibrary(@SuppressWarnings("unused") long nativeContext, String name, int flags) {
PointerBase ret = PosixUtils.dlopen(name, flags);
if (ret.equal(WordFactory.zero())) {
CompilerDirectives.transferToInterpreter();
String error = PosixUtils.dlerror();
throw new UnsatisfiedLinkError(error);
}
return ret.rawValue();
}
Aggregations