All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.js.nodes.cast.JSToIntegerThrowOnInfinityNodeGen 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 java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doInteger}
 *     Activation probability: 0.15909
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doLong}
 *     Activation probability: 0.14545
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doBoolean}
 *     Activation probability: 0.13182
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doSafeInteger}
 *     Activation probability: 0.11818
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doDoubleInfinite}
 *     Activation probability: 0.10455
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doNull}
 *     Activation probability: 0.09091
 *     With/without class size: 5/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doUndefined}
 *     Activation probability: 0.07727
 *     With/without class size: 4/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doSymbol}
 *     Activation probability: 0.06364
 *     With/without class size: 4/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doBigInt}
 *     Activation probability: 0.05000
 *     With/without class size: 4/0 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doString}
 *     Activation probability: 0.03636
 *     With/without class size: 4/4 bytes
 *   Specialization {@link JSToIntegerThrowOnInfinityNode#doJSOrForeignObject}
 *     Activation probability: 0.02273
 *     With/without class size: 4/4 bytes
 * 
*/ @GeneratedBy(JSToIntegerThrowOnInfinityNode.class) @SuppressWarnings("javadoc") public final class JSToIntegerThrowOnInfinityNodeGen extends JSToIntegerThrowOnInfinityNode { /** * State Info:
     *   0: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doInteger}
     *   1: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doLong}
     *   2: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doBoolean}
     *   3: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doSafeInteger}
     *   4: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doDoubleInfinite}
     *   5: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doNull}
     *   6: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doUndefined}
     *   7: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doSymbol}
     *   8: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doBigInt}
     *   9: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doString}
     *   10: SpecializationActive {@link JSToIntegerThrowOnInfinityNode#doJSOrForeignObject}
     *   11-13: ImplicitCast[type=double, index=0]
     * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
     *   Specialization: {@link JSToIntegerThrowOnInfinityNode#doString}
     *   Parameter: {@link JSToIntegerThrowOnInfinityNode} toIntOrInf
*/ @Child private JSToIntegerThrowOnInfinityNode toIntOrInf; /** * Source Info:
     *   Specialization: {@link JSToIntegerThrowOnInfinityNode#doString}
     *   Parameter: {@link JSStringToNumberNode} stringToNumberNode
*/ @Child private JSStringToNumberNode string_stringToNumberNode_; /** * Source Info:
     *   Specialization: {@link JSToIntegerThrowOnInfinityNode#doJSOrForeignObject}
     *   Parameter: {@link JSToNumberNode} toNumberNode
*/ @Child private JSToNumberNode jSOrForeignObject_toNumberNode_; private JSToIntegerThrowOnInfinityNodeGen() { } @Override public Object execute(Object arg0Value) { int state_0 = this.state_0_; if ((state_0 & 0b11111111111) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doInteger(int)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doLong(long)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doBoolean(boolean)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doSafeInteger(SafeInteger)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doDoubleInfinite(double)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doNull(Object)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doUndefined(Object)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doSymbol(Symbol)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doBigInt(BigInt)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doString(TruffleString, JSToIntegerThrowOnInfinityNode, JSStringToNumberNode)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doJSOrForeignObject(Object, JSToIntegerThrowOnInfinityNode, JSToNumberNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doInteger(int)] */ && arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; return JSToIntegerThrowOnInfinityNode.doInteger(arg0Value_); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doLong(long)] */ && arg0Value instanceof Long) { long arg0Value_ = (long) arg0Value; return JSToIntegerThrowOnInfinityNode.doLong(arg0Value_); } if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doBoolean(boolean)] */ && arg0Value instanceof Boolean) { boolean arg0Value_ = (boolean) arg0Value; return JSToIntegerThrowOnInfinityNode.doBoolean(arg0Value_); } if ((state_0 & 0b1000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doSafeInteger(SafeInteger)] */ && arg0Value instanceof SafeInteger) { SafeInteger arg0Value_ = (SafeInteger) arg0Value; return JSToIntegerThrowOnInfinityNode.doSafeInteger(arg0Value_); } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doDoubleInfinite(double)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, arg0Value)) { double arg0Value_ = JSTypesGen.asImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, arg0Value); return doDoubleInfinite(arg0Value_); } if ((state_0 & 0b1100000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doNull(Object)] || SpecializationActive[JSToIntegerThrowOnInfinityNode.doUndefined(Object)] */) { if ((state_0 & 0b100000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doNull(Object)] */) { if ((JSGuards.isJSNull(arg0Value))) { return JSToIntegerThrowOnInfinityNode.doNull(arg0Value); } } if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doUndefined(Object)] */) { if ((JSGuards.isUndefined(arg0Value))) { return JSToIntegerThrowOnInfinityNode.doUndefined(arg0Value); } } } if ((state_0 & 0b10000000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doSymbol(Symbol)] */ && arg0Value instanceof Symbol) { Symbol arg0Value_ = (Symbol) arg0Value; return doSymbol(arg0Value_); } if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doBigInt(BigInt)] */ && arg0Value instanceof BigInt) { BigInt arg0Value_ = (BigInt) arg0Value; return doBigInt(arg0Value_); } if ((state_0 & 0b1000000000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doString(TruffleString, JSToIntegerThrowOnInfinityNode, JSStringToNumberNode)] */ && arg0Value instanceof TruffleString) { TruffleString arg0Value_ = (TruffleString) arg0Value; { JSToIntegerThrowOnInfinityNode toIntOrInf_ = this.toIntOrInf; if (toIntOrInf_ != null) { JSStringToNumberNode stringToNumberNode__ = this.string_stringToNumberNode_; if (stringToNumberNode__ != null) { return doString(arg0Value_, toIntOrInf_, stringToNumberNode__); } } } } if ((state_0 & 0b10000000000) != 0 /* is SpecializationActive[JSToIntegerThrowOnInfinityNode.doJSOrForeignObject(Object, JSToIntegerThrowOnInfinityNode, JSToNumberNode)] */) { { JSToIntegerThrowOnInfinityNode toIntOrInf_1 = this.toIntOrInf; if (toIntOrInf_1 != null) { JSToNumberNode toNumberNode__ = this.jSOrForeignObject_toNumberNode_; if (toNumberNode__ != null) { if ((JSGuards.isJSObject(arg0Value) || JSGuards.isForeignObject(arg0Value))) { return doJSOrForeignObject(arg0Value, toIntOrInf_1, toNumberNode__); } } } } } } 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[JSToIntegerThrowOnInfinityNode.doInteger(int)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doInteger(arg0Value_); } if (arg0Value instanceof Long) { long arg0Value_ = (long) arg0Value; state_0 = state_0 | 0b10 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doLong(long)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doLong(arg0Value_); } if (arg0Value instanceof Boolean) { boolean arg0Value_ = (boolean) arg0Value; state_0 = state_0 | 0b100 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doBoolean(boolean)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doBoolean(arg0Value_); } if (arg0Value instanceof SafeInteger) { SafeInteger arg0Value_ = (SafeInteger) arg0Value; state_0 = state_0 | 0b1000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doSafeInteger(SafeInteger)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doSafeInteger(arg0Value_); } { int doubleCast0; if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(arg0Value)) != 0) { double arg0Value_ = JSTypesGen.asImplicitDouble(doubleCast0, arg0Value); state_0 = (state_0 | (doubleCast0 << 11) /* set-int ImplicitCast[type=double, index=0] */); state_0 = state_0 | 0b10000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doDoubleInfinite(double)] */; this.state_0_ = state_0; return doDoubleInfinite(arg0Value_); } } if ((JSGuards.isJSNull(arg0Value))) { state_0 = state_0 | 0b100000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doNull(Object)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doNull(arg0Value); } if ((JSGuards.isUndefined(arg0Value))) { state_0 = state_0 | 0b1000000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doUndefined(Object)] */; this.state_0_ = state_0; return JSToIntegerThrowOnInfinityNode.doUndefined(arg0Value); } if (arg0Value instanceof Symbol) { Symbol arg0Value_ = (Symbol) arg0Value; state_0 = state_0 | 0b10000000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doSymbol(Symbol)] */; this.state_0_ = state_0; return doSymbol(arg0Value_); } if (arg0Value instanceof BigInt) { BigInt arg0Value_ = (BigInt) arg0Value; state_0 = state_0 | 0b100000000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doBigInt(BigInt)] */; this.state_0_ = state_0; return doBigInt(arg0Value_); } if (arg0Value instanceof TruffleString) { TruffleString arg0Value_ = (TruffleString) arg0Value; JSToIntegerThrowOnInfinityNode toIntOrInf_; JSToIntegerThrowOnInfinityNode toIntOrInf__shared = this.toIntOrInf; if (toIntOrInf__shared != null) { toIntOrInf_ = toIntOrInf__shared; } else { toIntOrInf_ = this.insert((JSToIntegerThrowOnInfinityNode.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 | 0b1000000000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doString(TruffleString, JSToIntegerThrowOnInfinityNode, JSStringToNumberNode)] */; this.state_0_ = state_0; return doString(arg0Value_, toIntOrInf_, stringToNumberNode__); } if ((JSGuards.isJSObject(arg0Value) || JSGuards.isForeignObject(arg0Value))) { JSToIntegerThrowOnInfinityNode toIntOrInf_1; JSToIntegerThrowOnInfinityNode toIntOrInf_1_shared = this.toIntOrInf; if (toIntOrInf_1_shared != null) { toIntOrInf_1 = toIntOrInf_1_shared; } else { toIntOrInf_1 = this.insert((JSToIntegerThrowOnInfinityNode.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__ = 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.jSOrForeignObject_toNumberNode_ = toNumberNode__; state_0 = state_0 | 0b10000000000 /* add SpecializationActive[JSToIntegerThrowOnInfinityNode.doJSOrForeignObject(Object, JSToIntegerThrowOnInfinityNode, JSToNumberNode)] */; this.state_0_ = state_0; return doJSOrForeignObject(arg0Value, toIntOrInf_1, toNumberNode__); } throw new UnsupportedSpecializationException(this, null, arg0Value); } @NeverDefault public static JSToIntegerThrowOnInfinityNode create() { return new JSToIntegerThrowOnInfinityNodeGen(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy