private synchronized void disableCancel() { int usersLeft = --cancellationUsers; if (usersLeft <= 0) { EventBinding<?> b = cancellationBinding; if (b != null) { b.dispose(); } cancellationBinding = null; } } }
private <T extends ContextsListener> EventBinding<T> attachContextsListener(AbstractInstrumenter instrumenter, T listener, boolean includeActiveContexts) { assert listener != null; return addContextsBinding(new EventBinding<>(instrumenter, listener), includeActiveContexts); }
private static void disposeOutputBindingsBulk(DispatchOutputStream dos, Collection<EventBinding<? extends OutputStream>> list) { for (EventBinding<? extends OutputStream> binding : list) { AccessorInstrumentHandler.engineAccess().detachOutputConsumer(dos, binding.getElement()); binding.disposeBulk(); } }
private void notifyContextClosed(TruffleContext context) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onContextClosed(context); } }
sourceBinding.dispose(); } else if (breakpointBinding == null && (sourceBinding == null || sourceBinding.isDisposed())) {
@SuppressWarnings("deprecation") void disposeBinding(EventBinding<?> binding) { if (TRACE) { trace("BEGIN: Dispose binding %s, %s%n", binding.getFilter(), binding.getElement()); AllocationListener l = (AllocationListener) binding.getElement(); for (AllocationReporter allocationReporter : allocationReporters) { if (allocationBinding.getAllocationFilter().contains(allocationReporter.language)) { Object elm = binding.getElement(); if (elm instanceof OutputStream) { if (outputErrBindings.contains(binding)) { trace("END: Disposed binding %s, %s%n", binding.getFilter(), binding.getElement());
@Override protected EB unwrap(EB element) { if (element.isDisposed()) { return null; } return element; }
@SuppressWarnings("deprecation") private static void traceFilterCheck(String result, Set<Class<?>> providedTags, EventBinding<?> binding, Node node, SourceSection sourceSection) { Set<Class<?>> tags = binding.getFilter().getReferencedTags(); Set<Class<?>> containedTags = new HashSet<>(); for (Class<?> tag : tags) { if (hasTagImpl(providedTags, node, tag)) { containedTags.add(tag); } } trace(" Filter %4s %s section:%s tags:%s%n", result, binding.getFilter(), sourceSection, containedTags); }
private static void disposeBindingsBulk(Collection<EventBinding.Source<?>> list) { for (EventBinding<?> binding : list) { binding.disposeBulk(); } }
private void notifyLanguageContextDisposed(TruffleContext context, LanguageInfo language) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onLanguageContextDisposed(context, language); } }
sourceBinding.dispose(); } else if (breakpointBinding == null && sourceBinding.isDisposed()) {
@SuppressWarnings("deprecation") void disposeBinding(EventBinding<?> binding) { if (TRACE) { trace("BEGIN: Dispose binding %s, %s%n", binding.getFilter(), binding.getElement()); AllocationListener l = (AllocationListener) binding.getElement(); for (AllocationReporter allocationReporter : allocationReporters) { if (allocationBinding.getAllocationFilter().contains(allocationReporter.language)) { Object elm = binding.getElement(); if (elm instanceof OutputStream) { if (outputErrBindings.contains(binding)) { trace("END: Disposed binding %s, %s%n", binding.getFilter(), binding.getElement());
@Override protected EB unwrap(EB element) { if (element.isDisposed()) { return null; } return element; }
@SuppressWarnings("deprecation") private static void traceFilterCheck(String result, Set<Class<?>> providedTags, EventBinding<?> binding, Node node, SourceSection sourceSection) { Set<Class<?>> tags = binding.getFilter().getReferencedTags(); Set<Class<?>> containedTags = new HashSet<>(); for (Class<?> tag : tags) { if (hasTagImpl(providedTags, node, tag)) { containedTags.add(tag); } } trace(" Filter %4s %s section:%s tags:%s%n", result, binding.getFilter(), sourceSection, containedTags); }
private static void disposeBindingsBulk(Collection<EventBinding.Source<?>> list) { for (EventBinding<?> binding : list) { binding.disposeBulk(); } }
private synchronized void disableCancel() { int usersLeft = --cancellationUsers; if (usersLeft <= 0) { EventBinding<?> b = cancellationBinding; if (b != null) { b.dispose(); } cancellationBinding = null; } } }
private void notifyThreadFinished(TruffleContext context, Thread thread) { for (EventBinding<? extends ThreadsListener> binding : threadsBindings) { binding.getElement().onThreadDisposed(context, thread); } }
private static void disposeOutputBindingsBulk(DispatchOutputStream dos, Collection<EventBinding<? extends OutputStream>> list) { for (EventBinding<? extends OutputStream> binding : list) { AccessorInstrumentHandler.engineAccess().detachOutputConsumer(dos, binding.getElement()); binding.disposeBulk(); } }
private <T extends ContextsListener> EventBinding<T> attachContextsListener(AbstractInstrumenter instrumenter, T listener, boolean includeActiveContexts) { assert listener != null; return addContextsBinding(new EventBinding<>(instrumenter, listener), includeActiveContexts); }
ExecutionEventNode lookupExecutionEventNode(EventBinding<?> binding) { if (binding.isDisposed()) { return null; } EventChainNode chainNode = this.chain; while (chainNode != null) { if (chainNode.binding == binding) { if (chainNode instanceof EventProviderChainNode) { return ((EventProviderChainNode) chainNode).eventNode; } } chainNode = chainNode.next; } return null; }