void disposeInstrumenter(Object key, boolean cleanupRequired) { AbstractInstrumenter disposedInstrumenter = instrumenterMap.remove(key); if (disposedInstrumenter == null) { throw new AssertionError("Instrumenter already disposed."); } if (TRACE) { trace("BEGIN: Dispose instrumenter %n", key); } disposedInstrumenter.dispose(); if (cleanupRequired) { Collection<EventBinding.Source<?>> disposedExecutionBindings = filterBindingsForInstrumenter(executionBindings, disposedInstrumenter); if (!disposedExecutionBindings.isEmpty()) { visitRoots(executedRoots, new DisposeWrappersWithBindingVisitor(disposedExecutionBindings)); } disposeBindingsBulk(disposedExecutionBindings); disposeBindingsBulk(filterBindingsForInstrumenter(sourceSectionBindings, disposedInstrumenter)); disposeBindingsBulk(filterBindingsForInstrumenter(sourceBindings, disposedInstrumenter)); disposeOutputBindingsBulk(out, outputStdBindings); disposeOutputBindingsBulk(err, outputErrBindings); } if (TRACE) { trace("END: Disposed instrumenter %n", key); } }
private <T> T lookup(Object key, Class<T> type) { AbstractInstrumenter value = instrumenterMap.get(key); return value == null ? null : value.lookup(this, type); }
void finalizeInstrumenter(Object key) { AbstractInstrumenter finalisingInstrumenter = instrumenterMap.get(key); if (finalisingInstrumenter == null) { throw new AssertionError("Instrumenter already disposed."); } finalisingInstrumenter.doFinalize(); }
void disposeInstrumenter(Object key, boolean cleanupRequired) { AbstractInstrumenter disposedInstrumenter = instrumenterMap.remove(key); if (disposedInstrumenter == null) { throw new AssertionError("Instrumenter already disposed."); } if (TRACE) { trace("BEGIN: Dispose instrumenter %n", key); } disposedInstrumenter.dispose(); if (cleanupRequired) { Collection<EventBinding.Source<?>> disposedExecutionBindings = filterBindingsForInstrumenter(executionBindings, disposedInstrumenter); if (!disposedExecutionBindings.isEmpty()) { visitRoots(executedRoots, new DisposeWrappersWithBindingVisitor(disposedExecutionBindings)); } disposeBindingsBulk(disposedExecutionBindings); disposeBindingsBulk(filterBindingsForInstrumenter(sourceSectionBindings, disposedInstrumenter)); disposeBindingsBulk(filterBindingsForInstrumenter(sourceBindings, disposedInstrumenter)); disposeOutputBindingsBulk(out, outputStdBindings); disposeOutputBindingsBulk(err, outputErrBindings); } if (TRACE) { trace("END: Disposed instrumenter %n", key); } }
boolean isInstrumentedSource(com.oracle.truffle.api.source.Source source) { return getInstrumenter().isInstrumentableSource(source) && getFilter().isInstrumentedSource(source); }
boolean isInstrumentedSource(com.oracle.truffle.api.source.Source source) { return getInstrumenter().isInstrumentableSource(source) && getFilter().isInstrumentedSource(source); }
boolean isInstrumentedRoot(Set<Class<?>> providedTags, RootNode rootNode, SourceSection rootSourceSection, int rootNodeBits) { return getInstrumenter().isInstrumentableRoot(rootNode) && getFilter().isInstrumentedRoot(providedTags, rootSourceSection, rootNode, rootNodeBits); }
private <T> T lookup(Object key, Class<T> type) { AbstractInstrumenter value = instrumenterMap.get(key); return value == null ? null : value.lookup(this, type); }
@Override public <T extends ExecutionEventNodeFactory> EventBinding<T> attachExecutionEventFactory(SourceSectionFilter filter, SourceSectionFilter inputFilter, T factory) { verifyFilter(filter); return InstrumentationHandler.this.attachFactory(this, filter, inputFilter, factory); }
@Override public <T extends ExecutionEventNodeFactory> EventBinding<T> attachExecutionEventFactory(SourceSectionFilter filter, SourceSectionFilter inputFilter, T factory) { verifyFilter(filter); return InstrumentationHandler.this.attachFactory(this, filter, inputFilter, factory); }
/** * Cancels the subscription permanently. * * @since 0.12 */ public synchronized void dispose() { CompilerAsserts.neverPartOfCompilation(); if (!disposed) { instrumenter.disposeBinding(this); disposed = true; } }
@Override @SuppressWarnings("deprecation") public <T extends LoadSourceListener> EventBinding<T> attachLoadSourceListener(SourceSectionFilter filter, T listener, boolean includeExistingSources) { verifySourceOnly(filter); verifyFilter(filter); return InstrumentationHandler.this.attachSourceListener(this, filter, listener, includeExistingSources); }
boolean isInstrumentedRoot(Set<Class<?>> providedTags, RootNode rootNode, SourceSection rootSourceSection, int rootNodeBits) { return getInstrumenter().isInstrumentableRoot(rootNode) && getFilter().isInstrumentedRoot(providedTags, rootSourceSection, rootNode, rootNodeBits); }
@Override public <T extends LoadSourceSectionListener> EventBinding<T> attachLoadSourceSectionListener(SourceSectionFilter filter, T listener, boolean notifyLoaded) { verifyFilter(filter); return InstrumentationHandler.this.attachSourceSectionListener(this, filter, listener, notifyLoaded); }
@Override public <T extends LoadSourceSectionListener> EventBinding<T> attachLoadSourceSectionListener(SourceSectionFilter filter, T listener, boolean notifyLoaded) { verifyFilter(filter); return InstrumentationHandler.this.attachSourceSectionListener(this, filter, listener, notifyLoaded); }
@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); }
/** * Cancels the subscription permanently. * * @since 0.12 */ public synchronized void dispose() { CompilerAsserts.neverPartOfCompilation(); if (!disposed) { instrumenter.disposeBinding(this); disposed = true; } }
@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); }
@Override @SuppressWarnings("deprecation") public <T extends LoadSourceListener> EventBinding<T> attachLoadSourceListener(SourceSectionFilter filter, T listener, boolean includeExistingSources) { verifySourceOnly(filter); verifyFilter(filter); return InstrumentationHandler.this.attachSourceListener(this, filter, listener, includeExistingSources); }
@Override public <T extends ExecutionEventListener> EventBinding<T> attachExecutionEventListener(SourceSectionFilter filter, SourceSectionFilter inputFilter, T listener) { verifyFilter(filter); return InstrumentationHandler.this.attachListener(this, filter, inputFilter, listener); }