org.truffleruby.language.dispatch.LiteralCallAssignableNodeWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruby-language Show documentation
Show all versions of ruby-language Show documentation
Core module of Ruby on Truffle
The newest version!
// CheckStyle: start generated
package org.truffleruby.language.dispatch;
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 org.truffleruby.RubyContext;
import org.truffleruby.RubyLanguage;
import org.truffleruby.core.array.AssignableNode;
import org.truffleruby.language.RubyNode;
@GeneratedBy(LiteralCallAssignableNode.class)
final class LiteralCallAssignableNodeWrapper extends LiteralCallAssignableNode implements WrapperNode {
@Child private LiteralCallAssignableNode delegateNode;
@Child private ProbeNode probeNode;
LiteralCallAssignableNodeWrapper(LiteralCallAssignableNode delegateNode, ProbeNode probeNode) {
this.delegateNode = delegateNode;
this.probeNode = probeNode;
}
@Override
public LiteralCallAssignableNode 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 AssignableNode toAssignableNode() {
return this.delegateNode.toAssignableNode();
}
@Override
public void assign(VirtualFrame frame, Object value) {
this.delegateNode.assign(frame, value);
}
@Override
public AssignableNode cloneUninitializedAssignable() {
return this.delegateNode.cloneUninitializedAssignable();
}
@Override
public RubyNode cloneUninitialized() {
return this.delegateNode.cloneUninitialized();
}
@Override
public Object isDefined(VirtualFrame frame, RubyLanguage language, RubyContext context) {
return this.delegateNode.isDefined(frame, language, context);
}
}