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

com.oracle.graal.python.lib.PyDictGetItemNodeGen Maven / Gradle / Ivy

There is a newer version: 24.1.1
Show newest version
// CheckStyle: start generated
package com.oracle.graal.python.lib;

import com.oracle.graal.python.builtins.objects.common.HashingStorageNodes.HashingStorageGetItem;
import com.oracle.graal.python.builtins.objects.common.HashingStorageNodesFactory.HashingStorageGetItemNodeGen;
import com.oracle.graal.python.builtins.objects.dict.PDict;
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.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.strings.TruffleString;
import java.lang.invoke.MethodHandles;

/**
 * Debug Info: 
 *   Specialization {@link PyDictGetItem#getString}
 *     Activation probability: 0.48333
 *     With/without class size: 11/0 bytes
 *   Specialization {@link PyDictGetItem#getItemCached}
 *     Activation probability: 0.33333
 *     With/without class size: 9/0 bytes
 *   Specialization {@link PyDictGetItem#getItem}
 *     Activation probability: 0.18333
 *     With/without class size: 6/0 bytes
 * 
*/ @GeneratedBy(PyDictGetItem.class) @SuppressWarnings({"javadoc", "unused"}) public final class PyDictGetItemNodeGen extends PyDictGetItem { private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
*/ private static final HashingStorageGetItem INLINED_GET_ITEM = HashingStorageGetItemNodeGen.inline(InlineTarget.create(HashingStorageGetItem.class, STATE_0_UPDATER.subUpdater(3, 8), ReferenceField.create(MethodHandles.lookup(), "getItem_field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "getItem_field2_", Node.class), ReferenceField.create(MethodHandles.lookup(), "getItem_field3_", Node.class), ReferenceField.create(MethodHandles.lookup(), "getItem_field4_", Node.class), ReferenceField.create(MethodHandles.lookup(), "getItem_field5_", Node.class))); private static final Uncached UNCACHED = new Uncached(); /** * State Info:
     *   0: SpecializationActive {@link PyDictGetItem#getString}
     *   1: SpecializationActive {@link PyDictGetItem#getItemCached}
     *   2: SpecializationActive {@link PyDictGetItem#getItem}
     *   3-10: InlinedCache
     *        Specialization: {@link PyDictGetItem#getString}
     *        Parameter: {@link HashingStorageGetItem} getItem
     *        Inline method: {@link HashingStorageGetItemNodeGen#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getItem_field1_; /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
     *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getItem_field2_; /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
     *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getItem_field3_; /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
     *   Inline field: {@link Node} field4
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getItem_field4_; /** * Source Info:
     *   Specialization: {@link PyDictGetItem#getString}
     *   Parameter: {@link HashingStorageGetItem} getItem
     *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
     *   Inline field: {@link Node} field5
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getItem_field5_; private PyDictGetItemNodeGen() { } @Override public Object execute(Frame frameValue, Node arg0Value, PDict arg1Value, Object arg2Value) { int state_0 = this.state_0_; if ((state_0 & 0b111) != 0 /* is SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */ && arg2Value instanceof TruffleString) { TruffleString arg2Value_ = (TruffleString) arg2Value; return PyDictGetItem.getString(this, arg1Value, arg2Value_, INLINED_GET_ITEM); } if ((state_0 & 0b110) != 0 /* is SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */) { return PyDictGetItem.getItemCached((VirtualFrame) frameValue, this, arg1Value, arg2Value, INLINED_GET_ITEM); } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { return PyDictGetItem.getItem(this, arg1Value, arg2Value, INLINED_GET_ITEM); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value); } private Object executeAndSpecialize(Frame frameValue, Node arg0Value, PDict arg1Value, Object arg2Value) { int state_0 = this.state_0_; if (((state_0 & 0b110)) == 0 /* is-not SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] && SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */ && arg2Value instanceof TruffleString) { TruffleString arg2Value_ = (TruffleString) arg2Value; state_0 = state_0 | 0b1 /* add SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */; this.state_0_ = state_0; return PyDictGetItem.getString(this, arg1Value, arg2Value_, INLINED_GET_ITEM); } if (((state_0 & 0b100)) == 0 /* is-not SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */; this.state_0_ = state_0; return PyDictGetItem.getItemCached((VirtualFrame) frameValue, this, arg1Value, arg2Value, INLINED_GET_ITEM); } state_0 = state_0 & 0xfffffffc /* remove SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)], SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */; state_0 = state_0 | 0b100 /* add SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */; this.state_0_ = state_0; return PyDictGetItem.getItem(this, arg1Value, arg2Value, INLINED_GET_ITEM); } @Override public NodeCost getCost() { int state_0 = this.state_0_; if ((state_0 & 0b111) == 0) { return NodeCost.UNINITIALIZED; } else { if (((state_0 & 0b111) & ((state_0 & 0b111) - 1)) == 0 /* is-single */) { return NodeCost.MONOMORPHIC; } } return NodeCost.POLYMORPHIC; } @NeverDefault public static PyDictGetItem create() { return new PyDictGetItemNodeGen(); } @NeverDefault public static PyDictGetItem getUncached() { return PyDictGetItemNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#getItem_field1_} *
  • {@link Inlined#getItem_field2_} *
  • {@link Inlined#getItem_field3_} *
  • {@link Inlined#getItem_field4_} *
  • {@link Inlined#getItem_field5_} *
*/ @NeverDefault public static PyDictGetItem inline(@RequiredField(bits = 11, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) { return new PyDictGetItemNodeGen.Inlined(target); } @GeneratedBy(PyDictGetItem.class) @DenyReplace private static final class Inlined extends PyDictGetItem { /** * State Info:
         *   0: SpecializationActive {@link PyDictGetItem#getString}
         *   1: SpecializationActive {@link PyDictGetItem#getItemCached}
         *   2: SpecializationActive {@link PyDictGetItem#getItem}
         *   3-10: InlinedCache
         *        Specialization: {@link PyDictGetItem#getString}
         *        Parameter: {@link HashingStorageGetItem} getItem
         *        Inline method: {@link HashingStorageGetItemNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField getItem_field1_; private final ReferenceField getItem_field2_; private final ReferenceField getItem_field3_; private final ReferenceField getItem_field4_; private final ReferenceField getItem_field5_; /** * Source Info:
         *   Specialization: {@link PyDictGetItem#getString}
         *   Parameter: {@link HashingStorageGetItem} getItem
         *   Inline method: {@link HashingStorageGetItemNodeGen#inline}
*/ private final HashingStorageGetItem getItem; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyDictGetItem.class); this.state_0_ = target.getState(0, 11); this.getItem_field1_ = target.getReference(1, Node.class); this.getItem_field2_ = target.getReference(2, Node.class); this.getItem_field3_ = target.getReference(3, Node.class); this.getItem_field4_ = target.getReference(4, Node.class); this.getItem_field5_ = target.getReference(5, Node.class); this.getItem = HashingStorageGetItemNodeGen.inline(InlineTarget.create(HashingStorageGetItem.class, state_0_.subUpdater(3, 8), getItem_field1_, getItem_field2_, getItem_field3_, getItem_field4_, getItem_field5_)); } @Override public Object execute(Frame frameValue, Node arg0Value, PDict arg1Value, Object arg2Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b111) != 0 /* is SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */ && arg2Value instanceof TruffleString) { TruffleString arg2Value_ = (TruffleString) arg2Value; return PyDictGetItem.getString(arg0Value, arg1Value, arg2Value_, this.getItem); } if ((state_0 & 0b110) != 0 /* is SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] || SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */) { return PyDictGetItem.getItemCached((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, this.getItem); } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { return PyDictGetItem.getItem(arg0Value, arg1Value, arg2Value, this.getItem); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value); } private Object executeAndSpecialize(Frame frameValue, Node arg0Value, PDict arg1Value, Object arg2Value) { int state_0 = this.state_0_.get(arg0Value); if (((state_0 & 0b110)) == 0 /* is-not SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] && SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */ && arg2Value instanceof TruffleString) { TruffleString arg2Value_ = (TruffleString) arg2Value; state_0 = state_0 | 0b1 /* add SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */; this.state_0_.set(arg0Value, state_0); return PyDictGetItem.getString(arg0Value, arg1Value, arg2Value_, this.getItem); } if (((state_0 & 0b100)) == 0 /* is-not SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */) { state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */; this.state_0_.set(arg0Value, state_0); return PyDictGetItem.getItemCached((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, this.getItem); } state_0 = state_0 & 0xfffffffc /* remove SpecializationActive[PyDictGetItem.getString(Node, PDict, TruffleString, HashingStorageGetItem)], SpecializationActive[PyDictGetItem.getItemCached(VirtualFrame, Node, PDict, Object, HashingStorageGetItem)] */; state_0 = state_0 | 0b100 /* add SpecializationActive[PyDictGetItem.getItem(Node, PDict, Object, HashingStorageGetItem)] */; this.state_0_.set(arg0Value, state_0); return PyDictGetItem.getItem(arg0Value, arg1Value, arg2Value, this.getItem); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyDictGetItem.class) @DenyReplace private static final class Uncached extends PyDictGetItem { @Override public Object execute(Frame frameValue, Node arg0Value, PDict arg1Value, Object arg2Value) { CompilerDirectives.transferToInterpreterAndInvalidate(); return PyDictGetItem.getItem(arg0Value, arg1Value, arg2Value, (HashingStorageGetItemNodeGen.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy