com.oracle.truffle.js.nodes.cast.JSToOperandNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.cast;
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.js.nodes.cast.JSToPrimitiveNode.Hint;
import com.oracle.truffle.js.runtime.builtins.JSOverloadedOperatorsObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link JSToOperandNode#doOverloaded}
* Activation probability: 0.65000
* With/without class size: 11/0 bytes
* Specialization {@link JSToOperandNode#doOther}
* Activation probability: 0.35000
* With/without class size: 11/4 bytes
*
*/
@GeneratedBy(JSToOperandNode.class)
@SuppressWarnings("javadoc")
public final class JSToOperandNodeGen extends JSToOperandNode {
/**
* State Info:
* 0: SpecializationActive {@link JSToOperandNode#doOverloaded}
* 1: SpecializationActive {@link JSToOperandNode#doOther}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link JSToOperandNode#doOther}
* Parameter: {@link JSToPrimitiveNode} toPrimitiveNode
*/
@Child private JSToPrimitiveNode other_toPrimitiveNode_;
private JSToOperandNodeGen(Hint hint, boolean checkOperatorAllowed) {
super(hint, checkOperatorAllowed);
}
@Override
public Object execute(Object arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[JSToOperandNode.doOverloaded(JSOverloadedOperatorsObject)] || SpecializationActive[JSToOperandNode.doOther(Object, JSToPrimitiveNode)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSToOperandNode.doOverloaded(JSOverloadedOperatorsObject)] */ && arg0Value instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject arg0Value_ = (JSOverloadedOperatorsObject) arg0Value;
return doOverloaded(arg0Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSToOperandNode.doOther(Object, JSToPrimitiveNode)] */) {
{
JSToPrimitiveNode toPrimitiveNode__ = this.other_toPrimitiveNode_;
if (toPrimitiveNode__ != null) {
if ((!(hasOverloadedOperators(arg0Value)))) {
return doOther(arg0Value, toPrimitiveNode__);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Object executeAndSpecialize(Object arg0Value) {
int state_0 = this.state_0_;
if (arg0Value instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject arg0Value_ = (JSOverloadedOperatorsObject) arg0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[JSToOperandNode.doOverloaded(JSOverloadedOperatorsObject)] */;
this.state_0_ = state_0;
return doOverloaded(arg0Value_);
}
if ((!(hasOverloadedOperators(arg0Value)))) {
JSToPrimitiveNode toPrimitiveNode__ = this.insert((JSToPrimitiveNode.create(getHint())));
Objects.requireNonNull(toPrimitiveNode__, "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.other_toPrimitiveNode_ = toPrimitiveNode__;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSToOperandNode.doOther(Object, JSToPrimitiveNode)] */;
this.state_0_ = state_0;
return doOther(arg0Value, toPrimitiveNode__);
}
throw new UnsupportedSpecializationException(this, null, arg0Value);
}
@NeverDefault
public static JSToOperandNode create(Hint hint, boolean checkOperatorAllowed) {
return new JSToOperandNodeGen(hint, checkOperatorAllowed);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy