CallTarget checkLanguage() { if (languageCheckSupplier != null) { RootNode languageCheck = languageCheckSupplier.get(); return Truffle.getRuntime().createCallTarget(languageCheck); } else { return null; } }
private synchronized Assumption getConditionUnchanged() { if (conditionUnchanged == null) { conditionUnchanged = Truffle.getRuntime().createAssumption("Breakpoint condition unchanged."); } return conditionUnchanged; }
public DirectDispatchNode(DispatchNode next, CallTarget callTarget) { this.cachedCallTarget = callTarget; this.callCachedTargetNode = Truffle.getRuntime().createDirectCallNode( this.cachedCallTarget); this.nextNode = next; }
static CatchLocation getCatchNode(Debugger debugger, Node throwNode, Throwable exception) { CatchLocation[] catchLocationPtr = new CatchLocation[]{null}; Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<FrameInstance>() { private int depth = 0; @Override public FrameInstance visitFrame(FrameInstance frameInstance) { Node node; if (depth == 0) { node = throwNode; } else { node = frameInstance.getCallNode(); } if (node != null) { Node catchNode = getCatchNode(debugger.getMessageNodes(), node, exception); if (catchNode != null) { catchLocationPtr[0] = new CatchLocation(catchNode.getSourceSection(), frameInstance, depth); return frameInstance; } } depth++; return null; } }); return catchLocationPtr[0]; }
public static HomeFinder getInstance() { if (TruffleOptions.AOT) { return nativeImageHomeFinder; } return Truffle.getRuntime().getCapability(HomeFinder.class); }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter. */ public static void transferToInterpreter() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
/** @since 0.8 or earlier */ public static IndirectCallNode create() { return Truffle.getRuntime().createIndirectCallNode(); }
static boolean isProfilingEnabled() { boolean enabled; try { enabled = Truffle.getRuntime().isProfilingEnabled(); } catch (LinkageError ex) { // running on old version of Graal enabled = true; } return enabled; }
public static Throwable fillInMumblerStackTrace(Throwable t) { final List<StackTraceElement> stackTrace = new ArrayList<>(); Truffle.getRuntime().iterateFrames(new FrameInstanceVisitor<Void>() { @Override public Void visitFrame(FrameInstance frame) {
@SuppressWarnings("unused") private static void initializeNativeImageState() { assert TruffleOptions.AOT : "Only supported during image generation"; nativeImageLocator = Truffle.getRuntime().getCapability(TruffleLocator.class); }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter, invalidating the currently executing machine code. * * @since 0.8 or earlier */ public static void transferToInterpreterAndInvalidate() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
/** @since 0.8 or earlier */ public static IndirectCallNode create() { return Truffle.getRuntime().createIndirectCallNode(); }
static boolean isProfilingEnabled() { boolean enabled; try { enabled = Truffle.getRuntime().isProfilingEnabled(); } catch (LinkageError ex) { // running on old version of Graal enabled = true; } return enabled; }
@Override public CallTarget accessIsExecutable() { return Truffle.getRuntime().createCallTarget(RootNode.createConstantNode(false)); } @Override
private synchronized Assumption getConditionExistsUnchanged() { if (conditionExistsUnchanged == null) { conditionExistsUnchanged = Truffle.getRuntime().createAssumption("Breakpoint condition existence unchanged."); } return conditionExistsUnchanged; }
/** @since 0.8 or earlier */ public static DirectCallNode create(CallTarget target) { return Truffle.getRuntime().createDirectCallNode(target); }
ArrayList<StackTraceEntry> getInitialStack(Node instrumentedNode) { ArrayList<StackTraceEntry> sourceLocations = new ArrayList<>(); reconstructStack(sourceLocations, instrumentedNode, sourceSectionFilter, initInstrumenter); Truffle.getRuntime().iterateFrames(frame -> { Node node = frame.getCallNode(); if (node != null) { reconstructStack(sourceLocations, node, sourceSectionFilter, initInstrumenter); } return null; }); Collections.reverse(sourceLocations); return sourceLocations; }
/** * Looks up the {@link HomeFinder} instance. * * NOTE: this method is called reflectively by downstream projects. * */ @SuppressWarnings("unused") private static void initializeNativeImageState() { assert TruffleOptions.AOT : "Only supported during image generation"; nativeImageHomeFinder = Truffle.getRuntime().getCapability(HomeFinder.class); }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter, invalidating the currently executing machine code. * * @since 0.8 or earlier */ public static void transferToInterpreterAndInvalidate() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
public GenericObjectAccessNode(Message access) { this.access = access; indirectCallNode = Truffle.getRuntime().createIndirectCallNode(); }