@Override public Object evalInContext(Source source, Node node, final MaterializedFrame mFrame) { CallTarget target = API.nodes().getLanguage(node.getRootNode()).parse(source, node, mFrame); try { if (target instanceof RootCallTarget) { RootNode exec = ((RootCallTarget) target).getRootNode(); return exec.execute(mFrame); } else { throw new IllegalStateException("" + target); } } catch (Exception ex) { if (ex instanceof RuntimeException) { throw (RuntimeException) ex; } throw new RuntimeException(ex); } }
if (target instanceof RootCallTarget) { RootNode exec = ((RootCallTarget) target).getRootNode(); return exec.execute(mFrame); } else { throw new IllegalStateException("" + target);
@Override public Object call(Object... args) { final VirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); FrameInstance oldCurrentFrame = defaultTruffleRuntime().setCurrentFrame(new FrameInstance() { public Frame getFrame(FrameAccess access, boolean slowPath) { return frame; } public boolean isVirtualFrame() { return false; } public Node getCallNode() { return null; } public CallTarget getCallTarget() { return DefaultCallTarget.this; } }); try { return getRootNode().execute(frame); } finally { defaultTruffleRuntime().setCurrentFrame(oldCurrentFrame); } }
@Override public Object call(Object... args) { if (!this.initialized) { initialize(); } final DefaultVirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); getRuntime().pushFrame(frame, this); try { return getRootNode().execute(frame); } catch (Throwable t) { getRuntime().getTvmci().onThrowable(null, this, t, frame); throw t; } finally { getRuntime().popFrame(); } }
@Override public Object call(Object... args) { if (!this.initialized) { initialize(); } final DefaultVirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); getRuntime().pushFrame(frame, this); try { return getRootNode().execute(frame); } catch (Throwable t) { getRuntime().getTvmci().onThrowable(null, this, t, frame); throw t; } finally { getRuntime().popFrame(); } }
Object callDirectOrIndirect(final Node callNode, Object... args) { if (!this.initialized) { initialize(); } final DefaultVirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); getRuntime().pushFrame(frame, this, callNode); try { return getRootNode().execute(frame); } catch (Throwable t) { getRuntime().getTvmci().onThrowable(callNode, this, t, frame); throw t; } finally { getRuntime().popFrame(); } }
Object callDirectOrIndirect(final Node callNode, Object... args) { if (!this.initialized) { initialize(); } final DefaultVirtualFrame frame = new DefaultVirtualFrame(getRootNode().getFrameDescriptor(), args); getRuntime().pushFrame(frame, this, callNode); try { return getRootNode().execute(frame); } catch (Throwable t) { getRuntime().getTvmci().onThrowable(callNode, this, t, frame); throw t; } finally { getRuntime().popFrame(); } }
protected final Object callProxy(VirtualFrame frame) { final boolean inCompiled = CompilerDirectives.inCompilationRoot(); try { return getRootNode().execute(frame); } catch (ControlFlowException t) { throw rethrow(getCompilationProfile().profileExceptionType(t)); } catch (Throwable t) { Throwable profiledT = getCompilationProfile().profileExceptionType(t); runtime().getTvmci().onThrowable(null, this, profiledT, frame); throw rethrow(profiledT); } finally { // this assertion is needed to keep the values from being cleared as non-live locals assert frame != null && this != null; if (CompilerDirectives.inInterpreter() && inCompiled) { notifyDeoptimized(frame); } } }