com.oracle.truffle.js.nodes.access.ArrayLiteralNodeWrapper Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.access;
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;
import com.oracle.truffle.js.runtime.builtins.JSArrayObject;
@GeneratedBy(ArrayLiteralNode.class)
final class ArrayLiteralNodeWrapper extends ArrayLiteralNode implements WrapperNode {
@Child private ArrayLiteralNode delegateNode;
@Child private ProbeNode probeNode;
ArrayLiteralNodeWrapper(ArrayLiteralNode copy, ArrayLiteralNode delegateNode, ProbeNode probeNode) {
super(copy);
this.delegateNode = delegateNode;
this.probeNode = probeNode;
}
@Override
public ArrayLiteralNode getDelegateNode() {
return delegateNode;
}
@Override
public ProbeNode getProbeNode() {
return probeNode;
}
@Override
public JSArrayObject execute(VirtualFrame frame) {
JSArrayObject 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 = (JSArrayObject) 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) {
for (;;) {
boolean wasOnReturnExecuted = false;
try {
probeNode.onEnter(frame);
delegateNode.executeVoid(frame);
wasOnReturnExecuted = true;
probeNode.onReturnValue(frame, null);
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