/** * 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); } }
/** * 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); } }
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); } }
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); } }
/** * Should get invoked if the node did not complete successfully. * * @param exception the exception that occurred during the execution * @param frame the current frame of the execution. * @since 0.12 * @deprecated Use {@link #onReturnExceptionalOrUnwind(VirtualFrame, Throwable, boolean)} * instead and adjust the wrapper node implementation accordingly. */ @Deprecated public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (exception instanceof ThreadDeath) { throw (ThreadDeath) exception; } EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { localChain.onReturnExceptional(context, frame, exception); } }
/** * Should get invoked if the node did not complete successfully. * * @param exception the exception that occurred during the execution * @param frame the current frame of the execution. * @since 0.12 * @deprecated Use {@link #onReturnExceptionalOrUnwind(VirtualFrame, Throwable, boolean)} * instead and adjust the wrapper node implementation accordingly. */ @Deprecated public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (exception instanceof ThreadDeath) { throw (ThreadDeath) exception; } EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { localChain.onReturnExceptional(context, frame, exception); } }
/** * Should get invoked after the node is invoked successfully. * * @param result the result value of the operation, must be an interop type (i.e. either * implementing TruffleObject or be a primitive value), or <code>null</code>. * @param frame the current frame of the execution. * @since 0.12 */ public void onReturnValue(VirtualFrame frame, Object result) { EventChainNode localChain = lazyUpdate(frame); assert isNullOrInteropValue(result); if (localChain != null) { localChain.onReturnValue(context, frame, result); } }
/** * Should get invoked after the node is invoked successfully. * * @param result the result value of the operation, must be an interop type (i.e. either * implementing TruffleObject or be a primitive value), or <code>null</code>. * @param frame the current frame of the execution. * @since 0.12 */ public void onReturnValue(VirtualFrame frame, Object result) { EventChainNode localChain = lazyUpdate(frame); assert isNullOrInteropValue(result); if (localChain != null) { localChain.onReturnValue(context, frame, result); } }
@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; }
throw (ThreadDeath) exception; EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { if (!isReturnCalled) {
throw (ThreadDeath) exception; EventChainNode localChain = lazyUpdate(frame); if (localChain != null) { if (!isReturnCalled) {