com.oracle.truffle.js.nodes.cast.JSToIntegerOrInfinityNodeGen 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.api.strings.TruffleString;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.JSTypesGen;
import com.oracle.truffle.js.runtime.BigInt;
import com.oracle.truffle.js.runtime.SafeInteger;
import com.oracle.truffle.js.runtime.Symbol;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link JSToIntegerOrInfinityNode#doInteger}
* Activation probability: 0.13626
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doLong}
* Activation probability: 0.12637
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doBoolean}
* Activation probability: 0.11648
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doSafeInteger}
* Activation probability: 0.10659
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doDoubleNegativeZero}
* Activation probability: 0.09670
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doDouble}
* Activation probability: 0.08681
* With/without class size: 5/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doNull}
* Activation probability: 0.07692
* With/without class size: 4/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doUndefined}
* Activation probability: 0.06703
* With/without class size: 4/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doSymbol}
* Activation probability: 0.05714
* With/without class size: 4/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doBigInt}
* Activation probability: 0.04725
* With/without class size: 4/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doString}
* Activation probability: 0.03736
* With/without class size: 4/4 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doJSObject}
* Activation probability: 0.02747
* With/without class size: 4/0 bytes
* Specialization {@link JSToIntegerOrInfinityNode#doJSOrForeignObject}
* Activation probability: 0.01758
* With/without class size: 4/0 bytes
*
*/
@GeneratedBy(JSToIntegerOrInfinityNode.class)
@SuppressWarnings("javadoc")
public final class JSToIntegerOrInfinityNodeGen extends JSToIntegerOrInfinityNode {
/**
* State Info:
* 0: SpecializationActive {@link JSToIntegerOrInfinityNode#doInteger}
* 1: SpecializationActive {@link JSToIntegerOrInfinityNode#doLong}
* 2: SpecializationActive {@link JSToIntegerOrInfinityNode#doBoolean}
* 3: SpecializationActive {@link JSToIntegerOrInfinityNode#doSafeInteger}
* 4: SpecializationActive {@link JSToIntegerOrInfinityNode#doDoubleNegativeZero}
* 5: SpecializationActive {@link JSToIntegerOrInfinityNode#doDouble}
* 6: SpecializationActive {@link JSToIntegerOrInfinityNode#doNull}
* 7: SpecializationActive {@link JSToIntegerOrInfinityNode#doUndefined}
* 8: SpecializationActive {@link JSToIntegerOrInfinityNode#doSymbol}
* 9: SpecializationActive {@link JSToIntegerOrInfinityNode#doBigInt}
* 10: SpecializationActive {@link JSToIntegerOrInfinityNode#doString}
* 11: SpecializationActive {@link JSToIntegerOrInfinityNode#doJSObject}
* 12: SpecializationActive {@link JSToIntegerOrInfinityNode#doJSOrForeignObject}
* 13-15: ImplicitCast[type=double, index=0]
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link JSToIntegerOrInfinityNode#doString}
* Parameter: {@link JSToIntegerOrInfinityNode} toIntOrInf
*/
@Child private JSToIntegerOrInfinityNode toIntOrInf;
/**
* Source Info:
* Specialization: {@link JSToIntegerOrInfinityNode#doJSObject}
* Parameter: {@link JSToNumberNode} toNumberNode
*/
@Child private JSToNumberNode toNumberNode;
/**
* Source Info:
* Specialization: {@link JSToIntegerOrInfinityNode#doString}
* Parameter: {@link JSStringToNumberNode} stringToNumberNode
*/
@Child private JSStringToNumberNode string_stringToNumberNode_;
private JSToIntegerOrInfinityNodeGen() {
}
@Override
public Object execute(Object arg0Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b1111111111111) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doInteger(int)] || SpecializationActive[JSToIntegerOrInfinityNode.doLong(long)] || SpecializationActive[JSToIntegerOrInfinityNode.doBoolean(boolean)] || SpecializationActive[JSToIntegerOrInfinityNode.doSafeInteger(SafeInteger)] || SpecializationActive[JSToIntegerOrInfinityNode.doDoubleNegativeZero(double)] || SpecializationActive[JSToIntegerOrInfinityNode.doDouble(double)] || SpecializationActive[JSToIntegerOrInfinityNode.doNull(Object)] || SpecializationActive[JSToIntegerOrInfinityNode.doUndefined(Object)] || SpecializationActive[JSToIntegerOrInfinityNode.doSymbol(Symbol)] || SpecializationActive[JSToIntegerOrInfinityNode.doBigInt(BigInt)] || SpecializationActive[JSToIntegerOrInfinityNode.doString(TruffleString, JSToIntegerOrInfinityNode, JSStringToNumberNode)] || SpecializationActive[JSToIntegerOrInfinityNode.doJSObject(JSObject, JSToIntegerOrInfinityNode, JSToNumberNode)] || SpecializationActive[JSToIntegerOrInfinityNode.doJSOrForeignObject(Object, JSToIntegerOrInfinityNode, JSToNumberNode)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doInteger(int)] */ && arg0Value instanceof Integer) {
int arg0Value_ = (int) arg0Value;
return JSToIntegerOrInfinityNode.doInteger(arg0Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doLong(long)] */ && arg0Value instanceof Long) {
long arg0Value_ = (long) arg0Value;
return JSToIntegerOrInfinityNode.doLong(arg0Value_);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doBoolean(boolean)] */ && arg0Value instanceof Boolean) {
boolean arg0Value_ = (boolean) arg0Value;
return JSToIntegerOrInfinityNode.doBoolean(arg0Value_);
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doSafeInteger(SafeInteger)] */ && arg0Value instanceof SafeInteger) {
SafeInteger arg0Value_ = (SafeInteger) arg0Value;
return JSToIntegerOrInfinityNode.doSafeInteger(arg0Value_);
}
if ((state_0 & 0b110000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doDoubleNegativeZero(double)] || SpecializationActive[JSToIntegerOrInfinityNode.doDouble(double)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b1110000000000000) >>> 13 /* get-int ImplicitCast[type=double, index=0] */, arg0Value)) {
double arg0Value_ = JSTypesGen.asImplicitDouble((state_0 & 0b1110000000000000) >>> 13 /* get-int ImplicitCast[type=double, index=0] */, arg0Value);
if ((state_0 & 0b10000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doDoubleNegativeZero(double)] */) {
if ((JSToIntegerOrInfinityNode.shouldConvertToZero(arg0Value_))) {
return JSToIntegerOrInfinityNode.doDoubleNegativeZero(arg0Value_);
}
}
if ((state_0 & 0b100000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doDouble(double)] */) {
if ((!(JSToIntegerOrInfinityNode.shouldConvertToZero(arg0Value_)))) {
return doDouble(arg0Value_);
}
}
}
if ((state_0 & 0b11000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doNull(Object)] || SpecializationActive[JSToIntegerOrInfinityNode.doUndefined(Object)] */) {
if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doNull(Object)] */) {
if ((JSGuards.isJSNull(arg0Value))) {
return JSToIntegerOrInfinityNode.doNull(arg0Value);
}
}
if ((state_0 & 0b10000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doUndefined(Object)] */) {
if ((JSGuards.isUndefined(arg0Value))) {
return JSToIntegerOrInfinityNode.doUndefined(arg0Value);
}
}
}
if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doSymbol(Symbol)] */ && arg0Value instanceof Symbol) {
Symbol arg0Value_ = (Symbol) arg0Value;
return doSymbol(arg0Value_);
}
if ((state_0 & 0b1000000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doBigInt(BigInt)] */ && arg0Value instanceof BigInt) {
BigInt arg0Value_ = (BigInt) arg0Value;
return doBigInt(arg0Value_);
}
if ((state_0 & 0b10000000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doString(TruffleString, JSToIntegerOrInfinityNode, JSStringToNumberNode)] */ && arg0Value instanceof TruffleString) {
TruffleString arg0Value_ = (TruffleString) arg0Value;
{
JSToIntegerOrInfinityNode toIntOrInf_ = this.toIntOrInf;
if (toIntOrInf_ != null) {
JSStringToNumberNode stringToNumberNode__ = this.string_stringToNumberNode_;
if (stringToNumberNode__ != null) {
return doString(arg0Value_, toIntOrInf_, stringToNumberNode__);
}
}
}
}
if ((state_0 & 0b100000000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doJSObject(JSObject, JSToIntegerOrInfinityNode, JSToNumberNode)] */ && arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
{
JSToIntegerOrInfinityNode toIntOrInf_1 = this.toIntOrInf;
if (toIntOrInf_1 != null) {
JSToNumberNode toNumberNode_ = this.toNumberNode;
if (toNumberNode_ != null) {
return doJSObject(arg0Value_, toIntOrInf_1, toNumberNode_);
}
}
}
}
if ((state_0 & 0b1000000000000) != 0 /* is SpecializationActive[JSToIntegerOrInfinityNode.doJSOrForeignObject(Object, JSToIntegerOrInfinityNode, JSToNumberNode)] */) {
{
JSToIntegerOrInfinityNode toIntOrInf_2 = this.toIntOrInf;
if (toIntOrInf_2 != null) {
JSToNumberNode toNumberNode_1 = this.toNumberNode;
if (toNumberNode_1 != null) {
if ((JSGuards.isJSObject(arg0Value) || JSGuards.isForeignObject(arg0Value))) {
return doJSOrForeignObject(arg0Value, toIntOrInf_2, toNumberNode_1);
}
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Object executeAndSpecialize(Object arg0Value) {
int state_0 = this.state_0_;
if (arg0Value instanceof Integer) {
int arg0Value_ = (int) arg0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[JSToIntegerOrInfinityNode.doInteger(int)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doInteger(arg0Value_);
}
if (arg0Value instanceof Long) {
long arg0Value_ = (long) arg0Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSToIntegerOrInfinityNode.doLong(long)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doLong(arg0Value_);
}
if (arg0Value instanceof Boolean) {
boolean arg0Value_ = (boolean) arg0Value;
state_0 = state_0 | 0b100 /* add SpecializationActive[JSToIntegerOrInfinityNode.doBoolean(boolean)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doBoolean(arg0Value_);
}
if (arg0Value instanceof SafeInteger) {
SafeInteger arg0Value_ = (SafeInteger) arg0Value;
state_0 = state_0 | 0b1000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doSafeInteger(SafeInteger)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doSafeInteger(arg0Value_);
}
{
int doubleCast0;
if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(arg0Value)) != 0) {
double arg0Value_ = JSTypesGen.asImplicitDouble(doubleCast0, arg0Value);
if ((JSToIntegerOrInfinityNode.shouldConvertToZero(arg0Value_))) {
state_0 = (state_0 | (doubleCast0 << 13) /* set-int ImplicitCast[type=double, index=0] */);
state_0 = state_0 | 0b10000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doDoubleNegativeZero(double)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doDoubleNegativeZero(arg0Value_);
}
if ((!(JSToIntegerOrInfinityNode.shouldConvertToZero(arg0Value_)))) {
state_0 = (state_0 | (doubleCast0 << 13) /* set-int ImplicitCast[type=double, index=0] */);
state_0 = state_0 | 0b100000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doDouble(double)] */;
this.state_0_ = state_0;
return doDouble(arg0Value_);
}
}
}
if ((JSGuards.isJSNull(arg0Value))) {
state_0 = state_0 | 0b1000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doNull(Object)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doNull(arg0Value);
}
if ((JSGuards.isUndefined(arg0Value))) {
state_0 = state_0 | 0b10000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doUndefined(Object)] */;
this.state_0_ = state_0;
return JSToIntegerOrInfinityNode.doUndefined(arg0Value);
}
if (arg0Value instanceof Symbol) {
Symbol arg0Value_ = (Symbol) arg0Value;
state_0 = state_0 | 0b100000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doSymbol(Symbol)] */;
this.state_0_ = state_0;
return doSymbol(arg0Value_);
}
if (arg0Value instanceof BigInt) {
BigInt arg0Value_ = (BigInt) arg0Value;
state_0 = state_0 | 0b1000000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doBigInt(BigInt)] */;
this.state_0_ = state_0;
return doBigInt(arg0Value_);
}
if (arg0Value instanceof TruffleString) {
TruffleString arg0Value_ = (TruffleString) arg0Value;
JSToIntegerOrInfinityNode toIntOrInf_;
JSToIntegerOrInfinityNode toIntOrInf__shared = this.toIntOrInf;
if (toIntOrInf__shared != null) {
toIntOrInf_ = toIntOrInf__shared;
} else {
toIntOrInf_ = this.insert((JSToIntegerOrInfinityNode.create()));
if (toIntOrInf_ == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.toIntOrInf == null) {
VarHandle.storeStoreFence();
this.toIntOrInf = toIntOrInf_;
}
JSStringToNumberNode stringToNumberNode__ = this.insert((JSStringToNumberNode.create()));
Objects.requireNonNull(stringToNumberNode__, "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.string_stringToNumberNode_ = stringToNumberNode__;
state_0 = state_0 | 0b10000000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doString(TruffleString, JSToIntegerOrInfinityNode, JSStringToNumberNode)] */;
this.state_0_ = state_0;
return doString(arg0Value_, toIntOrInf_, stringToNumberNode__);
}
if (((state_0 & 0b1000000000000)) == 0 /* is-not SpecializationActive[JSToIntegerOrInfinityNode.doJSOrForeignObject(Object, JSToIntegerOrInfinityNode, JSToNumberNode)] */ && arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
JSToIntegerOrInfinityNode toIntOrInf_1;
JSToIntegerOrInfinityNode toIntOrInf_1_shared = this.toIntOrInf;
if (toIntOrInf_1_shared != null) {
toIntOrInf_1 = toIntOrInf_1_shared;
} else {
toIntOrInf_1 = this.insert((JSToIntegerOrInfinityNode.create()));
if (toIntOrInf_1 == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.toIntOrInf == null) {
VarHandle.storeStoreFence();
this.toIntOrInf = toIntOrInf_1;
}
JSToNumberNode toNumberNode_;
JSToNumberNode toNumberNode__shared = this.toNumberNode;
if (toNumberNode__shared != null) {
toNumberNode_ = toNumberNode__shared;
} else {
toNumberNode_ = this.insert((JSToNumberNode.create()));
if (toNumberNode_ == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.toNumberNode == null) {
VarHandle.storeStoreFence();
this.toNumberNode = toNumberNode_;
}
state_0 = state_0 | 0b100000000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doJSObject(JSObject, JSToIntegerOrInfinityNode, JSToNumberNode)] */;
this.state_0_ = state_0;
return doJSObject(arg0Value_, toIntOrInf_1, toNumberNode_);
}
if ((JSGuards.isJSObject(arg0Value) || JSGuards.isForeignObject(arg0Value))) {
JSToIntegerOrInfinityNode toIntOrInf_2;
JSToIntegerOrInfinityNode toIntOrInf_2_shared = this.toIntOrInf;
if (toIntOrInf_2_shared != null) {
toIntOrInf_2 = toIntOrInf_2_shared;
} else {
toIntOrInf_2 = this.insert((JSToIntegerOrInfinityNode.create()));
if (toIntOrInf_2 == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.toIntOrInf == null) {
VarHandle.storeStoreFence();
this.toIntOrInf = toIntOrInf_2;
}
JSToNumberNode toNumberNode_1;
JSToNumberNode toNumberNode_1_shared = this.toNumberNode;
if (toNumberNode_1_shared != null) {
toNumberNode_1 = toNumberNode_1_shared;
} else {
toNumberNode_1 = this.insert((JSToNumberNode.create()));
if (toNumberNode_1 == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.toNumberNode == null) {
VarHandle.storeStoreFence();
this.toNumberNode = toNumberNode_1;
}
state_0 = state_0 & 0xfffff7ff /* remove SpecializationActive[JSToIntegerOrInfinityNode.doJSObject(JSObject, JSToIntegerOrInfinityNode, JSToNumberNode)] */;
state_0 = state_0 | 0b1000000000000 /* add SpecializationActive[JSToIntegerOrInfinityNode.doJSOrForeignObject(Object, JSToIntegerOrInfinityNode, JSToNumberNode)] */;
this.state_0_ = state_0;
return doJSOrForeignObject(arg0Value, toIntOrInf_2, toNumberNode_1);
}
throw new UnsupportedSpecializationException(this, null, arg0Value);
}
@NeverDefault
public static JSToIntegerOrInfinityNode create() {
return new JSToIntegerOrInfinityNodeGen();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy