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

com.oracle.truffle.js.nodes.access.IsPrimitiveNodeGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.nodes.access;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
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.dsl.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.EncapsulatingNodeReference;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnadoptableNode;
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.JSConfig;
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.MethodHandles;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link IsPrimitiveNode#doNull}
 *     Activation probability: 0.13626
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doUndefined}
 *     Activation probability: 0.12637
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doBoolean}
 *     Activation probability: 0.11648
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doInt}
 *     Activation probability: 0.10659
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doLong}
 *     Activation probability: 0.09670
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doLargeInt}
 *     Activation probability: 0.08681
 *     With/without class size: 5/0 bytes
 *   Specialization {@link IsPrimitiveNode#doDouble}
 *     Activation probability: 0.07692
 *     With/without class size: 4/0 bytes
 *   Specialization {@link IsPrimitiveNode#doSymbol}
 *     Activation probability: 0.06703
 *     With/without class size: 4/0 bytes
 *   Specialization {@link IsPrimitiveNode#doBigInt}
 *     Activation probability: 0.05714
 *     With/without class size: 4/0 bytes
 *   Specialization {@link IsPrimitiveNode#doString}
 *     Activation probability: 0.04725
 *     With/without class size: 4/0 bytes
 *   Specialization {@link IsPrimitiveNode#doIsObject}
 *     Activation probability: 0.03736
 *     With/without class size: 4/0 bytes
 *   Specialization {@link IsPrimitiveNode#doForeignObject}
 *     Activation probability: 0.02747
 *     With/without class size: 4/4 bytes
 *   Specialization {@link IsPrimitiveNode#doForeignObject}
 *     Activation probability: 0.01758
 *     With/without class size: 4/0 bytes
 * 
*/ @GeneratedBy(IsPrimitiveNode.class) @SuppressWarnings({"javadoc", "unused"}) public final class IsPrimitiveNodeGen extends IsPrimitiveNode { static final ReferenceField FOREIGN_OBJECT0_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "foreignObject0_cache", ForeignObject0Data.class); private static final Uncached UNCACHED = new Uncached(); private static final LibraryFactory INTEROP_LIBRARY_ = LibraryFactory.resolve(InteropLibrary.class); /** * State Info:
     *   0: SpecializationActive {@link IsPrimitiveNode#doNull}
     *   1: SpecializationActive {@link IsPrimitiveNode#doUndefined}
     *   2: SpecializationActive {@link IsPrimitiveNode#doBoolean}
     *   3: SpecializationActive {@link IsPrimitiveNode#doInt}
     *   4: SpecializationActive {@link IsPrimitiveNode#doLong}
     *   5: SpecializationActive {@link IsPrimitiveNode#doLargeInt}
     *   6: SpecializationActive {@link IsPrimitiveNode#doDouble}
     *   7: SpecializationActive {@link IsPrimitiveNode#doSymbol}
     *   8: SpecializationActive {@link IsPrimitiveNode#doBigInt}
     *   9: SpecializationActive {@link IsPrimitiveNode#doString}
     *   10: SpecializationActive {@link IsPrimitiveNode#doIsObject}
     *   11: SpecializationActive {@link IsPrimitiveNode#doForeignObject}
     *   12: SpecializationActive {@link IsPrimitiveNode#doForeignObject}
     *   13-15: ImplicitCast[type=double, index=0]
     * 
*/ @CompilationFinal private int state_0_; @UnsafeAccessedField @Child private ForeignObject0Data foreignObject0_cache; private IsPrimitiveNodeGen() { } @ExplodeLoop @Override public boolean executeBoolean(Object arg0Value) { int state_0 = this.state_0_; if ((state_0 & 0b1111111111111) != 0 /* is SpecializationActive[IsPrimitiveNode.doNull(Object)] || SpecializationActive[IsPrimitiveNode.doUndefined(Object)] || SpecializationActive[IsPrimitiveNode.doBoolean(boolean)] || SpecializationActive[IsPrimitiveNode.doInt(int)] || SpecializationActive[IsPrimitiveNode.doLong(long)] || SpecializationActive[IsPrimitiveNode.doLargeInt(SafeInteger)] || SpecializationActive[IsPrimitiveNode.doDouble(double)] || SpecializationActive[IsPrimitiveNode.doSymbol(Symbol)] || SpecializationActive[IsPrimitiveNode.doBigInt(BigInt)] || SpecializationActive[IsPrimitiveNode.doString(TruffleString)] || SpecializationActive[IsPrimitiveNode.doIsObject(JSObject)] || SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] || SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */) { if ((state_0 & 0b11) != 0 /* is SpecializationActive[IsPrimitiveNode.doNull(Object)] || SpecializationActive[IsPrimitiveNode.doUndefined(Object)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsPrimitiveNode.doNull(Object)] */) { if ((JSGuards.isJSNull(arg0Value))) { return IsPrimitiveNode.doNull(arg0Value); } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsPrimitiveNode.doUndefined(Object)] */) { if ((JSGuards.isUndefined(arg0Value))) { return IsPrimitiveNode.doUndefined(arg0Value); } } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[IsPrimitiveNode.doBoolean(boolean)] */ && arg0Value instanceof Boolean) { boolean arg0Value_ = (boolean) arg0Value; return IsPrimitiveNode.doBoolean(arg0Value_); } if ((state_0 & 0b1000) != 0 /* is SpecializationActive[IsPrimitiveNode.doInt(int)] */ && arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; return IsPrimitiveNode.doInt(arg0Value_); } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[IsPrimitiveNode.doLong(long)] */ && arg0Value instanceof Long) { long arg0Value_ = (long) arg0Value; return IsPrimitiveNode.doLong(arg0Value_); } if ((state_0 & 0b100000) != 0 /* is SpecializationActive[IsPrimitiveNode.doLargeInt(SafeInteger)] */ && arg0Value instanceof SafeInteger) { SafeInteger arg0Value_ = (SafeInteger) arg0Value; return IsPrimitiveNode.doLargeInt(arg0Value_); } if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[IsPrimitiveNode.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); return IsPrimitiveNode.doDouble(arg0Value_); } if ((state_0 & 0b10000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doSymbol(Symbol)] */ && arg0Value instanceof Symbol) { Symbol arg0Value_ = (Symbol) arg0Value; return IsPrimitiveNode.doSymbol(arg0Value_); } if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doBigInt(BigInt)] */ && arg0Value instanceof BigInt) { BigInt arg0Value_ = (BigInt) arg0Value; return IsPrimitiveNode.doBigInt(arg0Value_); } if ((state_0 & 0b1000000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doString(TruffleString)] */ && arg0Value instanceof TruffleString) { TruffleString arg0Value_ = (TruffleString) arg0Value; return IsPrimitiveNode.doString(arg0Value_); } if ((state_0 & 0b10000000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doIsObject(JSObject)] */ && arg0Value instanceof JSObject) { JSObject arg0Value_ = (JSObject) arg0Value; return IsPrimitiveNode.doIsObject(arg0Value_); } if ((state_0 & 0b1100000000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] || SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */) { if ((state_0 & 0b100000000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */) { ForeignObject0Data s11_ = this.foreignObject0_cache; while (s11_ != null) { if ((s11_.interop_.accepts(arg0Value)) && (JSGuards.isForeignObject(arg0Value))) { return IsPrimitiveNode.doForeignObject(arg0Value, s11_.interop_); } s11_ = s11_.next_; } } if ((state_0 & 0b1000000000000) != 0 /* is SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */) { if ((JSGuards.isForeignObject(arg0Value))) { return this.foreignObject1Boundary(state_0, arg0Value); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arg0Value); } @SuppressWarnings("static-method") @TruffleBoundary private boolean foreignObject1Boundary(int state_0, Object arg0Value) { EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent(); Node prev_ = encapsulating_.set(this); try { { InteropLibrary interop__ = (INTEROP_LIBRARY_.getUncached(arg0Value)); return IsPrimitiveNode.doForeignObject(arg0Value, interop__); } } finally { encapsulating_.set(prev_); } } private boolean executeAndSpecialize(Object arg0Value) { int state_0 = this.state_0_; if ((JSGuards.isJSNull(arg0Value))) { state_0 = state_0 | 0b1 /* add SpecializationActive[IsPrimitiveNode.doNull(Object)] */; this.state_0_ = state_0; return IsPrimitiveNode.doNull(arg0Value); } if ((JSGuards.isUndefined(arg0Value))) { state_0 = state_0 | 0b10 /* add SpecializationActive[IsPrimitiveNode.doUndefined(Object)] */; this.state_0_ = state_0; return IsPrimitiveNode.doUndefined(arg0Value); } if (arg0Value instanceof Boolean) { boolean arg0Value_ = (boolean) arg0Value; state_0 = state_0 | 0b100 /* add SpecializationActive[IsPrimitiveNode.doBoolean(boolean)] */; this.state_0_ = state_0; return IsPrimitiveNode.doBoolean(arg0Value_); } if (arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; state_0 = state_0 | 0b1000 /* add SpecializationActive[IsPrimitiveNode.doInt(int)] */; this.state_0_ = state_0; return IsPrimitiveNode.doInt(arg0Value_); } if (arg0Value instanceof Long) { long arg0Value_ = (long) arg0Value; state_0 = state_0 | 0b10000 /* add SpecializationActive[IsPrimitiveNode.doLong(long)] */; this.state_0_ = state_0; return IsPrimitiveNode.doLong(arg0Value_); } if (arg0Value instanceof SafeInteger) { SafeInteger arg0Value_ = (SafeInteger) arg0Value; state_0 = state_0 | 0b100000 /* add SpecializationActive[IsPrimitiveNode.doLargeInt(SafeInteger)] */; this.state_0_ = state_0; return IsPrimitiveNode.doLargeInt(arg0Value_); } { int doubleCast0; if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(arg0Value)) != 0) { double arg0Value_ = JSTypesGen.asImplicitDouble(doubleCast0, arg0Value); state_0 = (state_0 | (doubleCast0 << 13) /* set-int ImplicitCast[type=double, index=0] */); state_0 = state_0 | 0b1000000 /* add SpecializationActive[IsPrimitiveNode.doDouble(double)] */; this.state_0_ = state_0; return IsPrimitiveNode.doDouble(arg0Value_); } } if (arg0Value instanceof Symbol) { Symbol arg0Value_ = (Symbol) arg0Value; state_0 = state_0 | 0b10000000 /* add SpecializationActive[IsPrimitiveNode.doSymbol(Symbol)] */; this.state_0_ = state_0; return IsPrimitiveNode.doSymbol(arg0Value_); } if (arg0Value instanceof BigInt) { BigInt arg0Value_ = (BigInt) arg0Value; state_0 = state_0 | 0b100000000 /* add SpecializationActive[IsPrimitiveNode.doBigInt(BigInt)] */; this.state_0_ = state_0; return IsPrimitiveNode.doBigInt(arg0Value_); } if (arg0Value instanceof TruffleString) { TruffleString arg0Value_ = (TruffleString) arg0Value; state_0 = state_0 | 0b1000000000 /* add SpecializationActive[IsPrimitiveNode.doString(TruffleString)] */; this.state_0_ = state_0; return IsPrimitiveNode.doString(arg0Value_); } if (arg0Value instanceof JSObject) { JSObject arg0Value_ = (JSObject) arg0Value; state_0 = state_0 | 0b10000000000 /* add SpecializationActive[IsPrimitiveNode.doIsObject(JSObject)] */; this.state_0_ = state_0; return IsPrimitiveNode.doIsObject(arg0Value_); } if (((state_0 & 0b1000000000000)) == 0 /* is-not SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */) { while (true) { int count11_ = 0; ForeignObject0Data s11_ = FOREIGN_OBJECT0_CACHE_UPDATER.getVolatile(this); ForeignObject0Data s11_original = s11_; while (s11_ != null) { if ((s11_.interop_.accepts(arg0Value)) && (JSGuards.isForeignObject(arg0Value))) { break; } count11_++; s11_ = s11_.next_; } if (s11_ == null) { if ((JSGuards.isForeignObject(arg0Value)) && count11_ < (JSConfig.InteropLibraryLimit)) { // assert (s11_.interop_.accepts(arg0Value)); s11_ = this.insert(new ForeignObject0Data(s11_original)); InteropLibrary interop__ = s11_.insert((INTEROP_LIBRARY_.create(arg0Value))); Objects.requireNonNull(interop__, "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."); s11_.interop_ = interop__; if (!FOREIGN_OBJECT0_CACHE_UPDATER.compareAndSet(this, s11_original, s11_)) { continue; } state_0 = state_0 | 0b100000000000 /* add SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */; this.state_0_ = state_0; } } if (s11_ != null) { return IsPrimitiveNode.doForeignObject(arg0Value, s11_.interop_); } break; } } { InteropLibrary interop__ = null; { EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent(); Node prev_ = encapsulating_.set(this); try { if ((JSGuards.isForeignObject(arg0Value))) { interop__ = (INTEROP_LIBRARY_.getUncached(arg0Value)); this.foreignObject0_cache = null; state_0 = state_0 & 0xfffff7ff /* remove SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */; state_0 = state_0 | 0b1000000000000 /* add SpecializationActive[IsPrimitiveNode.doForeignObject(Object, InteropLibrary)] */; this.state_0_ = state_0; return IsPrimitiveNode.doForeignObject(arg0Value, interop__); } } finally { encapsulating_.set(prev_); } } } throw new UnsupportedSpecializationException(this, null, arg0Value); } @TruffleBoundary private static UnsupportedSpecializationException newUnsupportedSpecializationException1(Node thisNode_, Object arg0Value) { return new UnsupportedSpecializationException(thisNode_, null, arg0Value); } @NeverDefault public static IsPrimitiveNode create() { return new IsPrimitiveNodeGen(); } @NeverDefault public static IsPrimitiveNode getUncached() { return IsPrimitiveNodeGen.UNCACHED; } @GeneratedBy(IsPrimitiveNode.class) @DenyReplace private static final class ForeignObject0Data extends Node implements SpecializationDataNode { @Child ForeignObject0Data next_; /** * Source Info:
         *   Specialization: {@link IsPrimitiveNode#doForeignObject}
         *   Parameter: {@link InteropLibrary} interop
*/ @Child InteropLibrary interop_; ForeignObject0Data(ForeignObject0Data next_) { this.next_ = next_; } } @GeneratedBy(IsPrimitiveNode.class) @DenyReplace private static final class Uncached extends IsPrimitiveNode implements UnadoptableNode { @TruffleBoundary @Override public boolean executeBoolean(Object arg0Value) { if ((JSGuards.isJSNull(arg0Value))) { return IsPrimitiveNode.doNull(arg0Value); } if ((JSGuards.isUndefined(arg0Value))) { return IsPrimitiveNode.doUndefined(arg0Value); } if (arg0Value instanceof Boolean) { boolean arg0Value_ = (boolean) arg0Value; return IsPrimitiveNode.doBoolean(arg0Value_); } if (arg0Value instanceof Integer) { int arg0Value_ = (int) arg0Value; return IsPrimitiveNode.doInt(arg0Value_); } if (arg0Value instanceof Long) { long arg0Value_ = (long) arg0Value; return IsPrimitiveNode.doLong(arg0Value_); } if (arg0Value instanceof SafeInteger) { SafeInteger arg0Value_ = (SafeInteger) arg0Value; return IsPrimitiveNode.doLargeInt(arg0Value_); } if (JSTypesGen.isImplicitDouble(arg0Value)) { double arg0Value_ = JSTypesGen.asImplicitDouble(arg0Value); return IsPrimitiveNode.doDouble(arg0Value_); } if (arg0Value instanceof Symbol) { Symbol arg0Value_ = (Symbol) arg0Value; return IsPrimitiveNode.doSymbol(arg0Value_); } if (arg0Value instanceof BigInt) { BigInt arg0Value_ = (BigInt) arg0Value; return IsPrimitiveNode.doBigInt(arg0Value_); } if (arg0Value instanceof TruffleString) { TruffleString arg0Value_ = (TruffleString) arg0Value; return IsPrimitiveNode.doString(arg0Value_); } if (arg0Value instanceof JSObject) { JSObject arg0Value_ = (JSObject) arg0Value; return IsPrimitiveNode.doIsObject(arg0Value_); } if ((JSGuards.isForeignObject(arg0Value))) { return IsPrimitiveNode.doForeignObject(arg0Value, (INTEROP_LIBRARY_.getUncached(arg0Value))); } throw newUnsupportedSpecializationException1(this, arg0Value); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy