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

com.oracle.truffle.js.nodes.access.PrivateFieldGetNodeGen 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.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.TruffleObject;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.object.HiddenKey;
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.function.JSFunctionCallNode;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.builtins.JSFunctionObject;
import com.oracle.truffle.js.runtime.objects.Accessor;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PrivateFieldGetNode#doField}
 *     Activation probability: 0.27381
 *     With/without class size: 10/4 bytes
 *   Specialization {@link PrivateFieldGetNode#doField}
 *     Activation probability: 0.23095
 *     With/without class size: 7/0 bytes
 *   Specialization {@link PrivateFieldGetNode#doMethodJSFunction}
 *     Activation probability: 0.18810
 *     With/without class size: 6/0 bytes
 *   Specialization {@link PrivateFieldGetNode#doMethodGeneric}
 *     Activation probability: 0.14524
 *     With/without class size: 5/0 bytes
 *   Specialization {@link PrivateFieldGetNode#doAccessor}
 *     Activation probability: 0.10238
 *     With/without class size: 6/4 bytes
 *   Specialization {@link PrivateFieldGetNode#missing}
 *     Activation probability: 0.05952
 *     With/without class size: 4/0 bytes
 * 
*/ @GeneratedBy(PrivateFieldGetNode.class) @SuppressWarnings({"javadoc", "unused"}) public final class PrivateFieldGetNodeGen extends PrivateFieldGetNode { private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); static final ReferenceField FIELD0_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "field0_cache", Field0Data.class); /** * Source Info:
     *   Specialization: {@link PrivateFieldGetNode#doField}
     *   Parameter: {@link InlinedBranchProfile} errorBranch
     *   Inline method: {@link InlinedBranchProfile#inline}
*/ private static final InlinedBranchProfile INLINED_ERROR_BRANCH = InlinedBranchProfile.inline(InlineTarget.create(InlinedBranchProfile.class, STATE_0_UPDATER.subUpdater(6, 1))); private static final LibraryFactory DYNAMIC_OBJECT_LIBRARY_ = LibraryFactory.resolve(DynamicObjectLibrary.class); /** * State Info:
     *   0: SpecializationActive {@link PrivateFieldGetNode#doField}
     *   1: SpecializationActive {@link PrivateFieldGetNode#doField}
     *   2: SpecializationActive {@link PrivateFieldGetNode#doMethodJSFunction}
     *   3: SpecializationActive {@link PrivateFieldGetNode#doMethodGeneric}
     *   4: SpecializationActive {@link PrivateFieldGetNode#doAccessor}
     *   5: SpecializationActive {@link PrivateFieldGetNode#missing}
     *   6: InlinedCache
     *        Specialization: {@link PrivateFieldGetNode#doField}
     *        Parameter: {@link InlinedBranchProfile} errorBranch
     *        Inline method: {@link InlinedBranchProfile#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; @UnsafeAccessedField @Child private Field0Data field0_cache; /** * Source Info:
     *   Specialization: {@link PrivateFieldGetNode#doAccessor}
     *   Parameter: {@link JSFunctionCallNode} callNode
*/ @Child private JSFunctionCallNode accessor_callNode_; private PrivateFieldGetNodeGen(JavaScriptNode targetNode, JavaScriptNode keyNode, JSContext context) { super(targetNode, keyNode, context); } @SuppressWarnings("static-method") private boolean fallbackGuard_(int state_0, Object targetNodeValue, Object keyNodeValue) { if (targetNodeValue instanceof JSObject) { if (!((state_0 & 0b10) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) && keyNodeValue instanceof HiddenKey) { return false; } if (keyNodeValue instanceof TruffleObject) { TruffleObject keyNodeValue_ = (TruffleObject) keyNodeValue; if ((!(JSGuards.isUndefined(keyNodeValue_)))) { return false; } } if (!((state_0 & 0b10000) != 0 /* is SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */) && keyNodeValue instanceof Accessor) { return false; } } return true; } @ExplodeLoop @Override public Object executeWithTarget(VirtualFrame frameValue, Object targetNodeValue) { int state_0 = this.state_0_; Object keyNodeValue_ = super.keyNode.execute(frameValue); if ((state_0 & 0b111111) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] || SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] || SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.missing(Object, Object)] */) { if ((state_0 & 0b11111) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] || SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] || SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */ && targetNodeValue instanceof JSObject) { JSObject targetNodeValue_ = (JSObject) targetNodeValue; if ((state_0 & 0b11) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */ && keyNodeValue_ instanceof HiddenKey) { HiddenKey keyNodeValue__ = (HiddenKey) keyNodeValue_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) { Field0Data s0_ = this.field0_cache; while (s0_ != null) { if ((s0_.access_.accepts(targetNodeValue_))) { Node node__ = (this); return doField(targetNodeValue_, keyNodeValue__, node__, s0_.access_, INLINED_ERROR_BRANCH); } s0_ = s0_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) { return this.field1Boundary(state_0, targetNodeValue_, keyNodeValue__); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] */ && keyNodeValue_ instanceof JSFunctionObject) { JSFunctionObject keyNodeValue__ = (JSFunctionObject) keyNodeValue_; return doMethodJSFunction(targetNodeValue_, keyNodeValue__); } if ((state_0 & 0b1000) != 0 /* is SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] */ && keyNodeValue_ instanceof TruffleObject) { TruffleObject keyNodeValue__ = (TruffleObject) keyNodeValue_; if ((!(JSGuards.isUndefined(keyNodeValue__)))) { return doMethodGeneric(targetNodeValue_, keyNodeValue__); } } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */ && keyNodeValue_ instanceof Accessor) { Accessor keyNodeValue__ = (Accessor) keyNodeValue_; { JSFunctionCallNode callNode__ = this.accessor_callNode_; if (callNode__ != null) { return doAccessor(targetNodeValue_, keyNodeValue__, callNode__, INLINED_ERROR_BRANCH); } } } } if ((state_0 & 0b100000) != 0 /* is SpecializationActive[PrivateFieldGetNode.missing(Object, Object)] */) { if (fallbackGuard_(state_0, targetNodeValue, keyNodeValue_)) { return missing(targetNodeValue, keyNodeValue_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(targetNodeValue, keyNodeValue_); } @SuppressWarnings("static-method") @TruffleBoundary private Object field1Boundary(int state_0, JSObject targetNodeValue_, HiddenKey keyNodeValue__) { { Node node__ = (this); DynamicObjectLibrary access__ = (DYNAMIC_OBJECT_LIBRARY_.getUncached(targetNodeValue_)); return doField(targetNodeValue_, keyNodeValue__, node__, access__, INLINED_ERROR_BRANCH); } } @ExplodeLoop @Override public Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; Object targetNodeValue_ = super.targetNode.execute(frameValue); Object keyNodeValue_ = super.keyNode.execute(frameValue); if ((state_0 & 0b111111) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] || SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] || SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.missing(Object, Object)] */) { if ((state_0 & 0b11111) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] || SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] || SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */ && targetNodeValue_ instanceof JSObject) { JSObject targetNodeValue__ = (JSObject) targetNodeValue_; if ((state_0 & 0b11) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] || SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */ && keyNodeValue_ instanceof HiddenKey) { HiddenKey keyNodeValue__ = (HiddenKey) keyNodeValue_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) { Field0Data s0_ = this.field0_cache; while (s0_ != null) { if ((s0_.access_.accepts(targetNodeValue__))) { Node node__ = (this); return doField(targetNodeValue__, keyNodeValue__, node__, s0_.access_, INLINED_ERROR_BRANCH); } s0_ = s0_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) { return this.field1Boundary0(state_0, targetNodeValue__, keyNodeValue__); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] */ && keyNodeValue_ instanceof JSFunctionObject) { JSFunctionObject keyNodeValue__ = (JSFunctionObject) keyNodeValue_; return doMethodJSFunction(targetNodeValue__, keyNodeValue__); } if ((state_0 & 0b1000) != 0 /* is SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] */ && keyNodeValue_ instanceof TruffleObject) { TruffleObject keyNodeValue__ = (TruffleObject) keyNodeValue_; if ((!(JSGuards.isUndefined(keyNodeValue__)))) { return doMethodGeneric(targetNodeValue__, keyNodeValue__); } } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */ && keyNodeValue_ instanceof Accessor) { Accessor keyNodeValue__ = (Accessor) keyNodeValue_; { JSFunctionCallNode callNode__ = this.accessor_callNode_; if (callNode__ != null) { return doAccessor(targetNodeValue__, keyNodeValue__, callNode__, INLINED_ERROR_BRANCH); } } } } if ((state_0 & 0b100000) != 0 /* is SpecializationActive[PrivateFieldGetNode.missing(Object, Object)] */) { if (fallbackGuard_(state_0, targetNodeValue_, keyNodeValue_)) { return missing(targetNodeValue_, keyNodeValue_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(targetNodeValue_, keyNodeValue_); } @SuppressWarnings("static-method") @TruffleBoundary private Object field1Boundary0(int state_0, JSObject targetNodeValue__, HiddenKey keyNodeValue__) { { Node node__ = (this); DynamicObjectLibrary access__ = (DYNAMIC_OBJECT_LIBRARY_.getUncached(targetNodeValue__)); return doField(targetNodeValue__, keyNodeValue__, node__, access__, INLINED_ERROR_BRANCH); } } @Override public void executeVoid(VirtualFrame frameValue) { execute(frameValue); return; } private Object executeAndSpecialize(Object targetNodeValue, Object keyNodeValue) { int state_0 = this.state_0_; if (targetNodeValue instanceof JSObject) { JSObject targetNodeValue_ = (JSObject) targetNodeValue; if (keyNodeValue instanceof HiddenKey) { HiddenKey keyNodeValue_ = (HiddenKey) keyNodeValue; { Node node__ = null; if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */) { while (true) { int count0_ = 0; Field0Data s0_ = FIELD0_CACHE_UPDATER.getVolatile(this); Field0Data s0_original = s0_; while (s0_ != null) { if ((s0_.access_.accepts(targetNodeValue_))) { node__ = (this); break; } count0_++; s0_ = s0_.next_; } if (s0_ == null) { // assert (s0_.access_.accepts(targetNodeValue_)); if (count0_ < (3)) { s0_ = this.insert(new Field0Data(s0_original)); node__ = (this); DynamicObjectLibrary access__ = s0_.insert((DYNAMIC_OBJECT_LIBRARY_.create(targetNodeValue_))); Objects.requireNonNull(access__, "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."); s0_.access_ = access__; if (!FIELD0_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) { continue; } state_0 = state_0 | 0b1 /* add SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */; this.state_0_ = state_0; } } if (s0_ != null) { return doField(targetNodeValue_, keyNodeValue_, node__, s0_.access_, INLINED_ERROR_BRANCH); } break; } } } { DynamicObjectLibrary access__ = null; Node node__ = null; node__ = (this); access__ = (DYNAMIC_OBJECT_LIBRARY_.getUncached(targetNodeValue_)); this.field0_cache = null; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[PrivateFieldGetNode.doField(JSObject, HiddenKey, Node, DynamicObjectLibrary, InlinedBranchProfile)] */; this.state_0_ = state_0; return doField(targetNodeValue_, keyNodeValue_, node__, access__, INLINED_ERROR_BRANCH); } } if (((state_0 & 0b1000)) == 0 /* is-not SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] */ && keyNodeValue instanceof JSFunctionObject) { JSFunctionObject keyNodeValue_ = (JSFunctionObject) keyNodeValue; state_0 = state_0 | 0b100 /* add SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] */; this.state_0_ = state_0; return doMethodJSFunction(targetNodeValue_, keyNodeValue_); } if (keyNodeValue instanceof TruffleObject) { TruffleObject keyNodeValue_ = (TruffleObject) keyNodeValue; if ((!(JSGuards.isUndefined(keyNodeValue_)))) { state_0 = state_0 & 0xfffffffb /* remove SpecializationActive[PrivateFieldGetNode.doMethodJSFunction(JSObject, JSFunctionObject)] */; state_0 = state_0 | 0b1000 /* add SpecializationActive[PrivateFieldGetNode.doMethodGeneric(JSObject, TruffleObject)] */; this.state_0_ = state_0; return doMethodGeneric(targetNodeValue_, keyNodeValue_); } } if (keyNodeValue instanceof Accessor) { Accessor keyNodeValue_ = (Accessor) keyNodeValue; JSFunctionCallNode callNode__ = this.insert((JSFunctionCallNode.createCall())); Objects.requireNonNull(callNode__, "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.accessor_callNode_ = callNode__; state_0 = state_0 | 0b10000 /* add SpecializationActive[PrivateFieldGetNode.doAccessor(JSObject, Accessor, JSFunctionCallNode, InlinedBranchProfile)] */; this.state_0_ = state_0; return doAccessor(targetNodeValue_, keyNodeValue_, callNode__, INLINED_ERROR_BRANCH); } } state_0 = state_0 | 0b100000 /* add SpecializationActive[PrivateFieldGetNode.missing(Object, Object)] */; this.state_0_ = state_0; return missing(targetNodeValue, keyNodeValue); } @NeverDefault public static PrivateFieldGetNode create(JavaScriptNode targetNode, JavaScriptNode keyNode, JSContext context) { return new PrivateFieldGetNodeGen(targetNode, keyNode, context); } @GeneratedBy(PrivateFieldGetNode.class) @DenyReplace private static final class Field0Data extends Node implements SpecializationDataNode { @Child Field0Data next_; /** * Source Info:
         *   Specialization: {@link PrivateFieldGetNode#doField}
         *   Parameter: {@link DynamicObjectLibrary} access
*/ @Child DynamicObjectLibrary access_; Field0Data(Field0Data next_) { this.next_ = next_; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy