com.oracle.truffle.js.nodes.unary.JSUnaryPlusNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.unary;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.cast.JSToNumberNode;
import com.oracle.truffle.js.runtime.builtins.JSOverloadedOperatorsObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link JSUnaryPlusNode#doDefault}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link JSUnaryPlusNode#doOverloaded}
* Activation probability: 0.35000
* With/without class size: 11/4 bytes
*
*/
@GeneratedBy(JSUnaryPlusNode.class)
@SuppressWarnings("javadoc")
public final class JSUnaryPlusNodeGen extends JSUnaryPlusNode {
/**
* State Info:
* 0: SpecializationActive {@link JSUnaryPlusNode#doDefault}
* 1: SpecializationActive {@link JSUnaryPlusNode#doOverloaded}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link JSUnaryPlusNode#doDefault}
* Parameter: {@link JSToNumberNode} toNumberNode
*/
@Child private JSToNumberNode default_toNumberNode_;
/**
* Source Info:
* Specialization: {@link JSUnaryPlusNode#doOverloaded}
* Parameter: {@link JSOverloadedUnaryNode} overloadedOperatorNode
*/
@Child private JSOverloadedUnaryNode overloaded_overloadedOperatorNode_;
private JSUnaryPlusNodeGen(JavaScriptNode operand) {
super(operand);
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object operandNodeValue_ = super.operandNode.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[JSUnaryPlusNode.doDefault(Object, JSToNumberNode)] || SpecializationActive[JSUnaryPlusNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedUnaryNode)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSUnaryPlusNode.doDefault(Object, JSToNumberNode)] */) {
{
JSToNumberNode toNumberNode__ = this.default_toNumberNode_;
if (toNumberNode__ != null) {
if ((!(hasOverloadedOperators(operandNodeValue_)))) {
return doDefault(operandNodeValue_, toNumberNode__);
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSUnaryPlusNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedUnaryNode)] */ && operandNodeValue_ instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject operandNodeValue__ = (JSOverloadedOperatorsObject) operandNodeValue_;
{
JSOverloadedUnaryNode overloadedOperatorNode__ = this.overloaded_overloadedOperatorNode_;
if (overloadedOperatorNode__ != null) {
return doOverloaded(operandNodeValue__, overloadedOperatorNode__);
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(operandNodeValue_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private Object executeAndSpecialize(Object operandNodeValue) {
int state_0 = this.state_0_;
if ((!(hasOverloadedOperators(operandNodeValue)))) {
JSToNumberNode toNumberNode__ = this.insert((JSToNumberNode.create()));
Objects.requireNonNull(toNumberNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value.");
VarHandle.storeStoreFence();
this.default_toNumberNode_ = toNumberNode__;
state_0 = state_0 | 0b1 /* add SpecializationActive[JSUnaryPlusNode.doDefault(Object, JSToNumberNode)] */;
this.state_0_ = state_0;
return doDefault(operandNodeValue, toNumberNode__);
}
if (operandNodeValue instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject operandNodeValue_ = (JSOverloadedOperatorsObject) operandNodeValue;
JSOverloadedUnaryNode overloadedOperatorNode__ = this.insert((JSOverloadedUnaryNodeGen.create(getOverloadedOperatorName())));
Objects.requireNonNull(overloadedOperatorNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value.");
VarHandle.storeStoreFence();
this.overloaded_overloadedOperatorNode_ = overloadedOperatorNode__;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSUnaryPlusNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedUnaryNode)] */;
this.state_0_ = state_0;
return doOverloaded(operandNodeValue_, overloadedOperatorNode__);
}
throw new UnsupportedSpecializationException(this, new Node[] {super.operandNode}, operandNodeValue);
}
@NeverDefault
public static JSUnaryPlusNode create(JavaScriptNode operand) {
return new JSUnaryPlusNodeGen(operand);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy