com.oracle.truffle.js.nodes.JavaScriptNodeWrapper Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.instrumentation.ProbeNode;
import com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
@GeneratedBy(JavaScriptNode.class)
final class JavaScriptNodeWrapper extends JavaScriptNode implements WrapperNode {
@Child private JavaScriptNode delegateNode;
@Child private ProbeNode probeNode;
JavaScriptNodeWrapper(JavaScriptNode delegateNode, ProbeNode probeNode) {
this.delegateNode = delegateNode;
this.probeNode = probeNode;
}
@Override
public JavaScriptNode getDelegateNode() {
return delegateNode;
}
@Override
public ProbeNode getProbeNode() {
return probeNode;
}
@Override
public Object execute(VirtualFrame frame) {
Object returnValue;
for (;;) {
boolean wasOnReturnExecuted = false;
try {
probeNode.onEnter(frame);
returnValue = delegateNode.execute(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, returnValue);
break;
} catch (Throwable t) {
Object result = probeNode.onReturnExceptionalOrUnwind(frame, t, wasOnReturnExecuted);
if (result == ProbeNode.UNWIND_ACTION_REENTER) {
continue;
} else if (result != null) {
returnValue = result;
break;
}
throw t;
}
}
return returnValue;
}
@Override
public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException {
boolean returnValue;
for (;;) {
boolean wasOnReturnExecuted = false;
try {
try {
probeNode.onEnter(frame);
returnValue = delegateNode.executeBoolean(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, returnValue);
break;
} catch (UnexpectedResultException e) {
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, e.getResult());
throw e;
}
} catch (Throwable t) {
Object result = probeNode.onReturnExceptionalOrUnwind(frame, t, wasOnReturnExecuted);
if (result == ProbeNode.UNWIND_ACTION_REENTER) {
continue;
}
if (result instanceof Boolean) {
returnValue = (boolean) result;
break;
} else if (result != null) {
throw new UnexpectedResultException(result);
}
throw t;
}
}
return returnValue;
}
@Override
public double executeDouble(VirtualFrame frame) throws UnexpectedResultException {
double returnValue;
for (;;) {
boolean wasOnReturnExecuted = false;
try {
try {
probeNode.onEnter(frame);
returnValue = delegateNode.executeDouble(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, returnValue);
break;
} catch (UnexpectedResultException e) {
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, e.getResult());
throw e;
}
} catch (Throwable t) {
Object result = probeNode.onReturnExceptionalOrUnwind(frame, t, wasOnReturnExecuted);
if (result == ProbeNode.UNWIND_ACTION_REENTER) {
continue;
}
if (result instanceof Double) {
returnValue = (double) result;
break;
} else if (result != null) {
throw new UnexpectedResultException(result);
}
throw t;
}
}
return returnValue;
}
@Override
public int executeInt(VirtualFrame frame) throws UnexpectedResultException {
int returnValue;
for (;;) {
boolean wasOnReturnExecuted = false;
try {
try {
probeNode.onEnter(frame);
returnValue = delegateNode.executeInt(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, returnValue);
break;
} catch (UnexpectedResultException e) {
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, e.getResult());
throw e;
}
} catch (Throwable t) {
Object result = probeNode.onReturnExceptionalOrUnwind(frame, t, wasOnReturnExecuted);
if (result == ProbeNode.UNWIND_ACTION_REENTER) {
continue;
}
if (result instanceof Integer) {
returnValue = (int) result;
break;
} else if (result != null) {
throw new UnexpectedResultException(result);
}
throw t;
}
}
return returnValue;
}
@Override
public void executeVoid(VirtualFrame frame) {
Object returnValue;
for (;;) {
boolean wasOnReturnExecuted = false;
try {
probeNode.onEnter(frame);
returnValue = delegateNode.execute(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, returnValue);
break;
} catch (Throwable t) {
Object result = probeNode.onReturnExceptionalOrUnwind(frame, t, wasOnReturnExecuted);
if (result == ProbeNode.UNWIND_ACTION_REENTER) {
continue;
} else if (result != null) {
break;
}
throw t;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy