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

com.oracle.truffle.js.nodes.cast.JSToUInt16NodeGen 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.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
import com.oracle.truffle.js.nodes.JSTypesGen;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link JSToUInt16Node#doInt}
 *     Activation probability: 0.48333
 *     With/without class size: 9/0 bytes
 *   Specialization {@link JSToUInt16Node#doDouble}
 *     Activation probability: 0.33333
 *     With/without class size: 10/1 bytes
 *   Specialization {@link JSToUInt16Node#doGeneric}
 *     Activation probability: 0.18333
 *     With/without class size: 7/4 bytes
 * 
*/ @GeneratedBy(JSToUInt16Node.class) @SuppressWarnings("javadoc") public final class JSToUInt16NodeGen extends JSToUInt16Node { private static final StateField STATE_0_JSToUInt16Node_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); /** * Source Info:
     *   Specialization: {@link JSToUInt16Node#doDouble}
     *   Parameter: {@link InlinedBranchProfile} needPositiveInfinityBranch
     *   Inline method: {@link InlinedBranchProfile#inline}
*/ private static final InlinedBranchProfile INLINED_DOUBLE_NEED_POSITIVE_INFINITY_BRANCH_ = InlinedBranchProfile.inline(InlineTarget.create(InlinedBranchProfile.class, STATE_0_JSToUInt16Node_UPDATER.subUpdater(6, 1))); /** * State Info:
     *   0: SpecializationActive {@link JSToUInt16Node#doInt}
     *   1: SpecializationActive {@link JSToUInt16Node#doDouble}
     *   2: SpecializationActive {@link JSToUInt16Node#doGeneric}
     *   3-5: ImplicitCast[type=double, index=0]
     *   6: InlinedCache
     *        Specialization: {@link JSToUInt16Node#doDouble}
     *        Parameter: {@link InlinedBranchProfile} needPositiveInfinityBranch
     *        Inline method: {@link InlinedBranchProfile#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * Source Info:
     *   Specialization: {@link JSToUInt16Node#doGeneric}
     *   Parameter: {@link JSToNumberNode} toNumberNode
*/ @Child private JSToNumberNode generic_toNumberNode_; private JSToUInt16NodeGen() { } @Override public int executeInt(Object arg0Value) { int state_0 = this.state_0_; if ((state_0 & 0b111) != 0 /* is SpecializationActive[JSToUInt16Node.doInt(int)] || SpecializationActive[JSToUInt16Node.doDouble(double, InlinedBranchProfile)] || SpecializationActive[JSToUInt16Node.doGeneric(Object, JSToNumberNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSToUInt16Node.doInt(int)] */ && arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; return doInt(arg0Value_); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSToUInt16Node.doDouble(double, InlinedBranchProfile)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b111000) >>> 3 /* get-int ImplicitCast[type=double, index=0] */, arg0Value)) { double arg0Value_ = JSTypesGen.asImplicitDouble((state_0 & 0b111000) >>> 3 /* get-int ImplicitCast[type=double, index=0] */, arg0Value); return doDouble(arg0Value_, INLINED_DOUBLE_NEED_POSITIVE_INFINITY_BRANCH_); } if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSToUInt16Node.doGeneric(Object, JSToNumberNode)] */) { { JSToNumberNode toNumberNode__ = this.generic_toNumberNode_; if (toNumberNode__ != null) { return doGeneric(arg0Value, toNumberNode__); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arg0Value); } private int executeAndSpecialize(Object arg0Value) { int state_0 = this.state_0_; if (arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; state_0 = state_0 | 0b1 /* add SpecializationActive[JSToUInt16Node.doInt(int)] */; this.state_0_ = state_0; return doInt(arg0Value_); } { int doubleCast0; if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(arg0Value)) != 0) { double arg0Value_ = JSTypesGen.asImplicitDouble(doubleCast0, arg0Value); state_0 = (state_0 | (doubleCast0 << 3) /* set-int ImplicitCast[type=double, index=0] */); state_0 = state_0 | 0b10 /* add SpecializationActive[JSToUInt16Node.doDouble(double, InlinedBranchProfile)] */; this.state_0_ = state_0; return doDouble(arg0Value_, INLINED_DOUBLE_NEED_POSITIVE_INFINITY_BRANCH_); } } 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.generic_toNumberNode_ = toNumberNode__; state_0 = state_0 | 0b100 /* add SpecializationActive[JSToUInt16Node.doGeneric(Object, JSToNumberNode)] */; this.state_0_ = state_0; return doGeneric(arg0Value, toNumberNode__); } @NeverDefault public static JSToUInt16Node create() { return new JSToUInt16NodeGen(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy