synchronized void detach(OutputStream outConsumer) { if (outList == null) { return; } outList.remove(outConsumer); if (outList.isEmpty()) { outList = null; outListChanged(); } }
/** * Accessor for non-public state in {@link FrameDescriptor}. * * @since 0.14 */ protected boolean getFrameMaterializeCalled(FrameDescriptor descriptor) { return Accessor.framesAccess().getMaterializeCalled(descriptor); }
protected void onThrowable(Node callNode, RootCallTarget root, Throwable e, Frame frame) { final Accessor.LanguageSupport language = Accessor.languageAccess(); if (language != null) { language.onThrowable(callNode, root, e, frame); } }
void popFrame() { DefaultFrameInstance callerFrame = getThreadLocalStackTrace().callerFrame; if (callerFrame != null) { setThreadLocalStackTrace(new DefaultFrameInstance(callerFrame.frame, callerFrame.target, null, callerFrame.callerFrame)); } else { setThreadLocalStackTrace(null); } }
synchronized void attach(OutputStream outConsumer) { if (outList == null) { outList = new OutputStreamList(); outListChanged(); } outList.add(outConsumer); }
private void initialize() { synchronized (this) { if (!this.initialized) { getRuntime().getTvmci().onFirstExecution(this); this.initialized = true; } } } }
static <T extends TruffleLanguage<?>> T findLanguageByClass(Object vm, Class<T> languageClass) { Env env = SPI.findEnv(vm, languageClass, true); TruffleLanguage<?> language = NODES.getLanguageSpi(API.getLanguageInfo(env)); return languageClass.cast(language); }
/** * Accessor for non-public API in {@link RootNode}. * * @since 0.24 */ protected RootNode cloneUninitialized(RootNode root) { return Accessor.nodesAccess().cloneUninitialized(root); }
/** * Makes sure the <code>rootNode</code> is initialized. * * @param rootNode * @since 0.12 */ protected void onFirstExecution(RootNode rootNode) { final Accessor.InstrumentSupport accessor = Accessor.instrumentAccess(); if (accessor != null) { accessor.onFirstExecution(rootNode); } }
/** * Accessor for non-public API in {@link RootNode}. * * @since 0.24 */ protected boolean isCloneUninitializedSupported(RootNode root) { return Accessor.nodesAccess().isCloneUninitializedSupported(root); }
/** * Invoked when a call target is invoked to find out its option values. * {@link OptionValues#getDescriptors()} must match the value returned by * {@link #getCompilerOptionDescriptors()}. * * @since 0.27 */ protected OptionValues getCompilerOptionValues(RootNode rootNode) { EngineSupport engine = Accessor.engineAccess(); return engine != null ? engine.getCompilerOptionValues(rootNode) : null; }
boolean finalizeContext() { if (!finalized) { finalized = true; LANGUAGE.finalizeContext(env); if (eventsEnabled) { VMAccessor.INSTRUMENT.notifyLanguageContextFinalized(context.engine, context.truffleContext, language.info); } return true; } return false; }
/** * Accessor for non-public state in {@link FrameDescriptor}. * * @since 0.14 */ protected void markFrameMaterializeCalled(FrameDescriptor descriptor) { Accessor.framesAccess().markMaterializeCalled(descriptor); }
@SuppressWarnings("unchecked") @Override public TruffleLanguage<C> getTruffleLanguage() { return (TruffleLanguage<C>) NODES.getLanguageSpi(LANGUAGE.getLanguageInfo(env)); } }
void pushFrame(VirtualFrame frame, CallTarget target, Node parentCallNode) { DefaultFrameInstance currentFrame = getThreadLocalStackTrace(); // we need to ensure that frame instances are immutable so we need to recreate the parent // frame if (currentFrame != null) { currentFrame = new DefaultFrameInstance(currentFrame.frame, currentFrame.target, parentCallNode, currentFrame.callerFrame); } setThreadLocalStackTrace(new DefaultFrameInstance(frame, target, null, currentFrame)); }
synchronized void detach(OutputStream outConsumer) { if (outList == null) { return; } outList.remove(outConsumer); if (outList.isEmpty()) { outList = null; outListChanged(); } }
/** * Accessor for non-public state in {@link FrameDescriptor}. * * @since 0.14 */ protected boolean getFrameMaterializeCalled(FrameDescriptor descriptor) { return Accessor.framesAccess().getMaterializeCalled(descriptor); }
protected void onThrowable(Node callNode, RootCallTarget root, Throwable e, Frame frame) { final Accessor.LanguageSupport language = Accessor.languageAccess(); if (language != null) { language.onThrowable(callNode, root, e, frame); } }
/** * Accessor for non-public API in {@link RootNode}. * * @since 0.24 */ protected RootNode cloneUninitialized(RootNode root) { return Accessor.nodesAccess().cloneUninitialized(root); }
void popFrame() { DefaultFrameInstance callerFrame = getThreadLocalStackTrace().callerFrame; if (callerFrame != null) { setThreadLocalStackTrace(new DefaultFrameInstance(callerFrame.frame, callerFrame.target, null, callerFrame.callerFrame)); } else { setThreadLocalStackTrace(null); } }