@SuppressWarnings("deprecation") private EventChainNode findParentChain(VirtualFrame frame, EventBinding<?> binding) { Node node = getParent().getParent(); while (node != null) { // TODO we should avoid materializing the source section here if (node instanceof com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) { ProbeNode probe = ((com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) node).getProbeNode(); EventChainNode c = probe.lazyUpdate(frame); if (c != null) { c = c.find(binding); } if (c != null) { return c; } } else if (node instanceof RootNode) { break; } node = node.getParent(); } if (node == null) { throw new IllegalStateException("The AST node is not yet adopted. "); } return null; }
@SuppressWarnings("deprecation") private EventChainNode findParentChain(VirtualFrame frame, EventBinding<?> binding) { Node node = getParent().getParent(); while (node != null) { // TODO we should avoid materializing the source section here if (node instanceof com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) { ProbeNode probe = ((com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) node).getProbeNode(); EventChainNode c = probe.lazyUpdate(frame); if (c != null) { c = c.find(binding); } if (c != null) { return c; } } else if (node instanceof RootNode) { break; } node = node.getParent(); } if (node == null) { throw new IllegalStateException("The AST node is not yet adopted. "); } return null; }
@SuppressWarnings("deprecation") @Override protected boolean visitChild(Node child) { Node parent = child.getParent(); if (parent instanceof com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) { ProbeNode probe = ((com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) parent).getProbeNode(); if (index < foundContexts.length) { foundContexts[index] = probe.context; } else { assert false; foundContexts = null; return false; } } else { // not yet materialized assert false; foundContexts = null; return false; } index++; return true; } }
@SuppressWarnings("deprecation") @Override protected boolean visitChild(Node child) { Node parent = child.getParent(); if (parent instanceof com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) { ProbeNode probe = ((com.oracle.truffle.api.instrumentation.InstrumentableFactory.WrapperNode) parent).getProbeNode(); if (index < foundContexts.length) { foundContexts[index] = probe.context; } else { assert false; foundContexts = null; return false; } } else { // not yet materialized assert false; foundContexts = null; return false; } index++; return true; } }
@Override @SuppressWarnings("deprecation") public final ExecutionEventNode lookupExecutionEventNode(Node node, EventBinding<?> binding) { if (!InstrumentationHandler.isInstrumentableNode(node, node.getSourceSection())) { return null; } Node p = node.getParent(); if (p instanceof InstrumentableFactory.WrapperNode) { InstrumentableFactory.WrapperNode w = (InstrumentableFactory.WrapperNode) p; return w.getProbeNode().lookupExecutionEventNode(binding); } else { return null; } }
@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(); } }
@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(); } }