@SuppressWarnings("deprecation") private static void invalidateWrapperImpl(com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode parent, Node node) { ProbeNode probeNode = parent.getProbeNode(); if (TRACE) { SourceSection section = probeNode.getContext().getInstrumentedSourceSection(); trace("Invalidate wrapper for %s, section %s %n", node, section); } if (probeNode != null) { probeNode.invalidate(); } }
@Override public <T extends LoadSourceListener> EventBinding<T> attachLoadSourceListener(SourceFilter filter, T listener, boolean notifyLoaded) { SourceSectionFilter sectionsFilter = SourceSectionFilter.newBuilder().sourceFilter(filter).build(); return attachLoadSourceListener(sectionsFilter, listener, notifyLoaded); }
void create(String[] expectedServices) { if (TRACE) { trace("Create instrument %s class %s %n", instrument, instrumentClass); } services = env.onCreate(instrument); if (expectedServices != null && !TruffleOptions.AOT) { checkServices(expectedServices); } if (TRACE) { trace("Created instrument %s class %s %n", instrument, instrumentClass); } }
private static void notifySourceBindingLoaded(EventBinding.Source<?> binding, Source source) { if (!binding.isDisposed() && binding.isInstrumentedSource(source)) { try { ((LoadSourceListener) binding.getElement()).onLoad(new LoadSourceEvent(source)); } catch (Throwable t) { if (binding.isLanguageBinding()) { throw t; } else { ProbeNode.exceptionEventForClientInstrument(binding, "onLoad", t); } } } }
private static void notifySourceExecutedBinding(EventBinding.Source<?> binding, Source source) { if (!binding.isDisposed() && binding.isInstrumentedSource(source)) { try { ((ExecuteSourceListener) binding.getElement()).onExecute(new ExecuteSourceEvent(source)); } catch (Throwable t) { if (binding.isLanguageBinding()) { throw t; } else { ProbeNode.exceptionEventForClientInstrument(binding, "onExecute", t); } } } }
private void notifyLanguageContextDisposed(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextDisposed(context, language); } }
@Override public void onLoad(RootNode rootNode) { InstrumentationHandler handler = getHandler(rootNode); if (handler != null) { handler.onLoad(rootNode); } }
private void notifyLanguageContextFinalized(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextFinalized(context, language); } }
/** * Should get invoked before the node is invoked. * * @param frame the current frame of the execution. * @since 0.12 */ public void onEnter(VirtualFrame frame) { EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { localChain.onEnter(context, frame); } }
private void notifyContextClosed(TruffleContext context) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onContextClosed(context); } }
void onInputValue(VirtualFrame frame, EventBinding<?> targetBinding, EventContext inputContext, int inputIndex, Object inputValue) { EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { localChain.onInputValue(context, frame, targetBinding, inputContext, inputIndex, inputValue); } }
@Override public void onFirstExecution(RootNode rootNode) { InstrumentationHandler handler = getHandler(rootNode); if (handler != null) { handler.onFirstExecution(rootNode); } }
private void notifyContextCreated(TruffleContext context) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onContextCreated(context); } }
private void notifyLanguageContextCreated(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextCreated(context, language); } }
private static void notifySourceBindingLoaded(EventBinding.Source<?> binding, Source source) { if (!binding.isDisposed() && binding.isInstrumentedSource(source)) { try { ((LoadSourceListener) binding.getElement()).onLoad(new LoadSourceEvent(source)); } catch (Throwable t) { if (binding.isLanguageBinding()) { throw t; } else { ProbeNode.exceptionEventForClientInstrument(binding, "onLoad", t); } } } }
@SuppressWarnings("deprecation") private static void invalidateWrapperImpl(com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode parent, Node node) { ProbeNode probeNode = parent.getProbeNode(); if (TRACE) { SourceSection section = probeNode.getContext().getInstrumentedSourceSection(); trace("Invalidate wrapper for %s, section %s %n", node, section); } if (probeNode != null) { probeNode.invalidate(); } }
@Override public <T extends LoadSourceListener> EventBinding<T> attachLoadSourceListener(SourceFilter filter, T listener, boolean notifyLoaded) { SourceSectionFilter sectionsFilter = SourceSectionFilter.newBuilder().sourceFilter(filter).build(); return attachLoadSourceListener(sectionsFilter, listener, notifyLoaded); }
private void notifyLanguageContextDisposed(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextDisposed(context, language); } }
@Override public void onLoad(RootNode rootNode) { InstrumentationHandler handler = getHandler(rootNode); if (handler != null) { handler.onLoad(rootNode); } }
private void notifyLanguageContextFinalized(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextFinalized(context, language); } }