@TruffleBoundary private void doReturn(MaterializedFrame frame, Object result) { SteppingStrategy steppingStrategy; try { if (hasRootElement) { doStepAfter(frame, result); } } finally { steppingStrategy = strategyMap.get(Thread.currentThread()); if (steppingStrategy != null) { // Stepping out of a function. steppingStrategy.notifyCallExit(); } } if (steppingStrategy != null && steppingStrategy.isStopAfterCall()) { Object newResult = notifyCallerReturn(steppingStrategy, this, SuspendAnchor.AFTER, result); if (newResult != result) { throw getContext().createUnwind(new ChangedReturnInfo(newResult)); } } }
@Override protected Object onUnwind(VirtualFrame frame, Object info) { if (stepping.get()) { return doUnwind(frame.materialize()); } else { return null; } }
@Override public void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { doReturn(); } }
@Override protected void onEnter(VirtualFrame frame) { if (stepping.get()) { doEnter(); if (hasRootElement) { super.onEnter(frame); } } }
@Override public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doReturn(); } }
@Override public void onReturnExceptional(VirtualFrame frame, Throwable exception) { if (stepping.get()) { doReturn(); } }
@Override protected void onEnter(VirtualFrame frame) { if (stepping.get()) { doEnter(); } }
@Override public void setParentOf(Node child) { insert(child); }
@Override protected Object onUnwind(VirtualFrame frame, Object info) { Object ret = super.onUnwind(frame, info); if (ret != null) { return ret; } if (stepping.get()) { return doUnwind(frame.materialize()); } else { return null; } }
@Override public ExecutionEventNode create(EventContext context) { if (context.hasTag(RootTag.class)) { return new RootSteppingDepthNode(context); } else { return new SteppingNode(context); } } }, hasExpressionElement, syntaxTags);
@Override public ExecutionEventNode create(EventContext context) { return new RootSteppingDepthNode(); } }, false, RootTag.class);
@Override public void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { doReturn(frame.materialize(), result); } }