com.oracle.truffle.api.instrumentation.test.InstrumentedNodeWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truffle-instrument-test Show documentation
Show all versions of truffle-instrument-test Show documentation
Instrumentation tests including InstrumentationTestLanguage.
The newest version!
// CheckStyle: start generated
package com.oracle.truffle.api.instrumentation.test;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.instrumentation.InstrumentableFactory;
import com.oracle.truffle.api.instrumentation.ProbeNode;
import com.oracle.truffle.api.instrumentation.test.InstrumentationTestLanguage.InstrumentedNode;
import com.oracle.truffle.api.nodes.NodeCost;
@GeneratedBy(InstrumentedNode.class)
public final class InstrumentedNodeWrapper implements InstrumentableFactory {
@Override
public WrapperNode createWrapper(InstrumentedNode delegateNode, ProbeNode probeNode) {
return new InstrumentedNodeWrapper0(delegateNode, delegateNode, probeNode);
}
@GeneratedBy(InstrumentedNode.class)
private static final class InstrumentedNodeWrapper0 extends InstrumentedNode implements WrapperNode {
@Child private InstrumentedNode delegateNode;
@Child private ProbeNode probeNode;
private InstrumentedNodeWrapper0(InstrumentedNode delegate, InstrumentedNode delegateNode, ProbeNode probeNode) {
super(delegate);
this.delegateNode = delegateNode;
this.probeNode = probeNode;
}
@Override
public InstrumentedNode getDelegateNode() {
return delegateNode;
}
@Override
public ProbeNode getProbeNode() {
return probeNode;
}
@Override
public NodeCost getCost() {
return NodeCost.NONE;
}
@Override
public Object execute(VirtualFrame frame) {
try {
probeNode.onEnter(frame);
Object returnValue = delegateNode.execute(frame);
probeNode.onReturnValue(frame, returnValue);
return returnValue;
} catch (Throwable t) {
probeNode.onReturnExceptional(frame, t);
throw t;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy