use of com.oracle.truffle.api.CompilerDirectives.TruffleBoundary in project graal by oracle.
the class SLDisableSplittingBuiltin method disableSplitting.
@Specialization
@TruffleBoundary
public SLFunction disableSplitting(SLFunction function) {
OptimizedCallTarget target = (OptimizedCallTarget) function.getCallTarget();
((SLRootNode) target.getRootNode()).setCloningAllowed(false);
return function;
}
use of com.oracle.truffle.api.CompilerDirectives.TruffleBoundary in project sulong by graalvm.
the class LLVMInfo method getpid.
@TruffleBoundary
public static long getpid() {
LLVMProcessStat stat = getstat();
if (stat != null) {
return stat.getPid();
}
String info = java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
return Long.parseLong(info.split("@")[0]);
}
use of com.oracle.truffle.api.CompilerDirectives.TruffleBoundary in project sulong by graalvm.
the class LLVMNativeDispatchNode method identityFunction.
@TruffleBoundary
protected TruffleObject identityFunction() {
LLVMContext context = getContextReference().get();
NFIContextExtension nfiContextExtension = context.getContextExtension(NFIContextExtension.class);
String signature;
try {
signature = nfiContextExtension.getNativeSignature(type, LLVMCallNode.USER_ARGUMENT_OFFSET);
} catch (UnsupportedNativeTypeException e) {
throw new IllegalStateException(e);
}
return nfiContextExtension.getNativeFunction(context, "@identity", String.format("(POINTER):%s", signature));
}
use of com.oracle.truffle.api.CompilerDirectives.TruffleBoundary in project sulong by graalvm.
the class LongDivision method divs128by64.
@TruffleBoundary
public static Result divs128by64(long a1, long a0, long b) {
if (a1 == 0 && a0 > 0) {
return new Result(a0 / b, a0 % b);
}
BigInteger x = s128(a1, a0);
BigInteger y = BigInteger.valueOf(b);
BigInteger[] result = x.divideAndRemainder(y);
BigInteger q = result[0];
BigInteger r = result[1];
if (q.bitCount() > 64) {
return Result.OVERFLOW;
} else {
return new Result(q.longValue(), r.longValue());
}
}
use of com.oracle.truffle.api.CompilerDirectives.TruffleBoundary in project sulong by graalvm.
the class LLVMPrintStackTrace method doOp.
@TruffleBoundary
@Specialization
protected Object doOp() {
SulongStackTrace trace = getStackTrace("__sulong_print_stacktrace");
printCStackTrace(trace);
return null;
}
Aggregations