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

com.oracle.graal.python.lib.PySequenceGetItemNodeGen 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.cext.PythonAbstractNativeObject;
import com.oracle.graal.python.builtins.objects.cext.capi.ExternalFunctionNodes.ExternalFunctionInvokeNode;
import com.oracle.graal.python.builtins.objects.cext.capi.ExternalFunctionNodes.PExternalFunctionWrapper;
import com.oracle.graal.python.builtins.objects.cext.capi.transitions.CApiTransitions.PythonToNativeNode;
import com.oracle.graal.python.builtins.objects.cext.capi.transitions.CApiTransitionsFactory.PythonToNativeNodeGen;
import com.oracle.graal.python.builtins.objects.cext.common.CExtCommonNodes.ImportCExtSymbolNode;
import com.oracle.graal.python.builtins.objects.cext.common.CExtCommonNodesFactory.ImportCExtSymbolNodeGen;
import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
import com.oracle.graal.python.nodes.PGuards;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.graal.python.nodes.call.special.CallBinaryMethodNode;
import com.oracle.graal.python.nodes.call.special.LookupSpecialMethodSlotNode;
import com.oracle.graal.python.nodes.object.GetClassNode;
import com.oracle.graal.python.nodes.object.GetClassNodeGen;
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.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.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PySequenceGetItemNode#doGenericManaged}
 *     Activation probability: 0.65000
 *     With/without class size: 43/43 bytes
 *   Specialization {@link PySequenceGetItemNode#doNative}
 *     Activation probability: 0.35000
 *     With/without class size: 13/12 bytes
 * 
*/ @GeneratedBy(PySequenceGetItemNode.class) @SuppressWarnings("javadoc") public final class PySequenceGetItemNodeGen extends PySequenceGetItemNode { private static final StateField STATE_0_PySequenceGetItemNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); private static final StateField STATE_1_PySequenceGetItemNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_1_"); /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link GetClassNode} getClassNode
     *   Inline method: {@link GetClassNodeGen#inline}
*/ private static final GetClassNode INLINED_GENERIC_MANAGED_GET_CLASS_NODE_ = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, STATE_0_PySequenceGetItemNode_UPDATER.subUpdater(2, 17), ReferenceField.create(MethodHandles.lookup(), "genericManaged_getClassNode__field1_", Node.class))); /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PySequenceCheckNode} sequenceCheckNode
     *   Inline method: {@link PySequenceCheckNodeGen#inline}
*/ private static final PySequenceCheckNode INLINED_GENERIC_MANAGED_SEQUENCE_CHECK_NODE_ = PySequenceCheckNodeGen.inline(InlineTarget.create(PySequenceCheckNode.class, STATE_0_PySequenceGetItemNode_UPDATER.subUpdater(19, 6), ReferenceField.create(MethodHandles.lookup(), "genericManaged_sequenceCheckNode__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "genericManaged_sequenceCheckNode__field2_", Node.class))); /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PyMappingCheckNode} mappingCheckNode
     *   Inline method: {@link PyMappingCheckNodeGen#inline}
*/ private static final PyMappingCheckNode INLINED_GENERIC_MANAGED_MAPPING_CHECK_NODE_ = PyMappingCheckNodeGen.inline(InlineTarget.create(PyMappingCheckNode.class, STATE_1_PySequenceGetItemNode_UPDATER.subUpdater(0, 28), ReferenceField.create(MethodHandles.lookup(), "genericManaged_mappingCheckNode__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "genericManaged_mappingCheckNode__field2_", Node.class), ReferenceField.create(MethodHandles.lookup(), "genericManaged_mappingCheckNode__field3_", Node.class))); /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link Lazy} raise
     *   Inline method: {@link LazyNodeGen#inline}
*/ private static final Lazy INLINED_GENERIC_MANAGED_RAISE_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, STATE_0_PySequenceGetItemNode_UPDATER.subUpdater(25, 1), ReferenceField.create(MethodHandles.lookup(), "genericManaged_raise__field1_", Node.class))); /** * State Info:
     *   0: SpecializationActive {@link PySequenceGetItemNode#doGenericManaged}
     *   1: SpecializationActive {@link PySequenceGetItemNode#doNative}
     *   2-18: InlinedCache
     *        Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *        Parameter: {@link GetClassNode} getClassNode
     *        Inline method: {@link GetClassNodeGen#inline}
     *   19-24: InlinedCache
     *        Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *        Parameter: {@link PySequenceCheckNode} sequenceCheckNode
     *        Inline method: {@link PySequenceCheckNodeGen#inline}
     *   25: InlinedCache
     *        Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *        Parameter: {@link Lazy} raise
     *        Inline method: {@link LazyNodeGen#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * State Info:
     *   0-27: InlinedCache
     *        Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *        Parameter: {@link PyMappingCheckNode} mappingCheckNode
     *        Inline method: {@link PyMappingCheckNodeGen#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_1_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link GetClassNode} getClassNode
     *   Inline method: {@link GetClassNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_getClassNode__field1_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PySequenceCheckNode} sequenceCheckNode
     *   Inline method: {@link PySequenceCheckNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_sequenceCheckNode__field1_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PySequenceCheckNode} sequenceCheckNode
     *   Inline method: {@link PySequenceCheckNodeGen#inline}
     *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_sequenceCheckNode__field2_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PyMappingCheckNode} mappingCheckNode
     *   Inline method: {@link PyMappingCheckNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_mappingCheckNode__field1_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PyMappingCheckNode} mappingCheckNode
     *   Inline method: {@link PyMappingCheckNodeGen#inline}
     *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_mappingCheckNode__field2_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link PyMappingCheckNode} mappingCheckNode
     *   Inline method: {@link PyMappingCheckNodeGen#inline}
     *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_mappingCheckNode__field3_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link LookupSpecialMethodSlotNode} lookupGetItem
*/ @Child private LookupSpecialMethodSlotNode genericManaged_lookupGetItem_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link CallBinaryMethodNode} callGetItem
*/ @Child private CallBinaryMethodNode genericManaged_callGetItem_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doGenericManaged}
     *   Parameter: {@link Lazy} raise
     *   Inline method: {@link LazyNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node genericManaged_raise__field1_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doNative}
     *   Parameter: {@link PythonToNativeNode} toNativeNode
*/ @Child private PythonToNativeNode native_toNativeNode_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doNative}
     *   Parameter: {@link ImportCExtSymbolNode} importCExtSymbolNode
*/ @Child private ImportCExtSymbolNode native_importCExtSymbolNode_; /** * Source Info:
     *   Specialization: {@link PySequenceGetItemNode#doNative}
     *   Parameter: {@link ExternalFunctionInvokeNode} invokeNode
*/ @Child private ExternalFunctionInvokeNode native_invokeNode_; private PySequenceGetItemNodeGen() { } @Override public Object execute(Frame frameValue, Object arg0Value, int arg1Value) { int state_0 = this.state_0_; if ((state_0 & 0b11) != 0 /* is SpecializationActive[PySequenceGetItemNode.doGenericManaged(VirtualFrame, Object, int, Node, GetClassNode, PySequenceCheckNode, PyMappingCheckNode, LookupSpecialMethodSlotNode, CallBinaryMethodNode, Lazy)] || SpecializationActive[PySequenceGetItemNode.doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PySequenceGetItemNode.doGenericManaged(VirtualFrame, Object, int, Node, GetClassNode, PySequenceCheckNode, PyMappingCheckNode, LookupSpecialMethodSlotNode, CallBinaryMethodNode, Lazy)] */) { { LookupSpecialMethodSlotNode lookupGetItem__ = this.genericManaged_lookupGetItem_; if (lookupGetItem__ != null) { CallBinaryMethodNode callGetItem__ = this.genericManaged_callGetItem_; if (callGetItem__ != null) { if ((!(PGuards.isNativeObject(arg0Value)))) { Node inliningTarget__ = (this); return PySequenceGetItemNode.doGenericManaged((VirtualFrame) frameValue, arg0Value, arg1Value, inliningTarget__, INLINED_GENERIC_MANAGED_GET_CLASS_NODE_, INLINED_GENERIC_MANAGED_SEQUENCE_CHECK_NODE_, INLINED_GENERIC_MANAGED_MAPPING_CHECK_NODE_, lookupGetItem__, callGetItem__, INLINED_GENERIC_MANAGED_RAISE_); } } } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PySequenceGetItemNode.doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)] */ && arg0Value instanceof PythonAbstractNativeObject) { PythonAbstractNativeObject arg0Value_ = (PythonAbstractNativeObject) arg0Value; { PythonToNativeNode toNativeNode__ = this.native_toNativeNode_; if (toNativeNode__ != null) { ImportCExtSymbolNode importCExtSymbolNode__ = this.native_importCExtSymbolNode_; if (importCExtSymbolNode__ != null) { ExternalFunctionInvokeNode invokeNode__ = this.native_invokeNode_; if (invokeNode__ != null) { Node inliningTarget__1 = (this); return doNative((VirtualFrame) frameValue, arg0Value_, arg1Value, inliningTarget__1, toNativeNode__, importCExtSymbolNode__, invokeNode__); } } } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value); } private Object executeAndSpecialize(Frame frameValue, Object arg0Value, int arg1Value) { int state_0 = this.state_0_; { Node inliningTarget__ = null; if ((!(PGuards.isNativeObject(arg0Value)))) { inliningTarget__ = (this); LookupSpecialMethodSlotNode lookupGetItem__ = this.insert((LookupSpecialMethodSlotNode.create(SpecialMethodSlot.GetItem))); Objects.requireNonNull(lookupGetItem__, "Specialization 'doGenericManaged(VirtualFrame, Object, int, Node, GetClassNode, PySequenceCheckNode, PyMappingCheckNode, LookupSpecialMethodSlotNode, CallBinaryMethodNode, Lazy)' cache 'lookupGetItem' returned a 'null' 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 'null'."); VarHandle.storeStoreFence(); this.genericManaged_lookupGetItem_ = lookupGetItem__; CallBinaryMethodNode callGetItem__ = this.insert((CallBinaryMethodNode.create())); Objects.requireNonNull(callGetItem__, "Specialization 'doGenericManaged(VirtualFrame, Object, int, Node, GetClassNode, PySequenceCheckNode, PyMappingCheckNode, LookupSpecialMethodSlotNode, CallBinaryMethodNode, Lazy)' cache 'callGetItem' returned a 'null' 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 'null'."); VarHandle.storeStoreFence(); this.genericManaged_callGetItem_ = callGetItem__; state_0 = state_0 | 0b1 /* add SpecializationActive[PySequenceGetItemNode.doGenericManaged(VirtualFrame, Object, int, Node, GetClassNode, PySequenceCheckNode, PyMappingCheckNode, LookupSpecialMethodSlotNode, CallBinaryMethodNode, Lazy)] */; this.state_0_ = state_0; return PySequenceGetItemNode.doGenericManaged((VirtualFrame) frameValue, arg0Value, arg1Value, inliningTarget__, INLINED_GENERIC_MANAGED_GET_CLASS_NODE_, INLINED_GENERIC_MANAGED_SEQUENCE_CHECK_NODE_, INLINED_GENERIC_MANAGED_MAPPING_CHECK_NODE_, lookupGetItem__, callGetItem__, INLINED_GENERIC_MANAGED_RAISE_); } } { Node inliningTarget__1 = null; if (arg0Value instanceof PythonAbstractNativeObject) { PythonAbstractNativeObject arg0Value_ = (PythonAbstractNativeObject) arg0Value; inliningTarget__1 = (this); PythonToNativeNode toNativeNode__ = this.insert((PythonToNativeNodeGen.create())); Objects.requireNonNull(toNativeNode__, "Specialization 'doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)' cache 'toNativeNode' returned a 'null' 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 'null'."); VarHandle.storeStoreFence(); this.native_toNativeNode_ = toNativeNode__; ImportCExtSymbolNode importCExtSymbolNode__ = this.insert((ImportCExtSymbolNodeGen.create())); Objects.requireNonNull(importCExtSymbolNode__, "Specialization 'doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)' cache 'importCExtSymbolNode' returned a 'null' 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 'null'."); VarHandle.storeStoreFence(); this.native_importCExtSymbolNode_ = importCExtSymbolNode__; ExternalFunctionInvokeNode invokeNode__ = this.insert((ExternalFunctionInvokeNode.create(PExternalFunctionWrapper.GETITEM))); Objects.requireNonNull(invokeNode__, "Specialization 'doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)' cache 'invokeNode' returned a 'null' 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 'null'."); VarHandle.storeStoreFence(); this.native_invokeNode_ = invokeNode__; state_0 = state_0 | 0b10 /* add SpecializationActive[PySequenceGetItemNode.doNative(VirtualFrame, PythonAbstractNativeObject, int, Node, PythonToNativeNode, ImportCExtSymbolNode, ExternalFunctionInvokeNode)] */; this.state_0_ = state_0; return doNative((VirtualFrame) frameValue, arg0Value_, arg1Value, inliningTarget__1, toNativeNode__, importCExtSymbolNode__, invokeNode__); } } throw new UnsupportedSpecializationException(this, new Node[] {null, null}, arg0Value, arg1Value); } @Override public NodeCost getCost() { int state_0 = this.state_0_; if ((state_0 & 0b11) == 0) { return NodeCost.UNINITIALIZED; } else { int counter = 0; counter += Integer.bitCount((state_0 & 0b11)); if (counter == 1) { return NodeCost.MONOMORPHIC; } } return NodeCost.POLYMORPHIC; } @NeverDefault public static PySequenceGetItemNode create() { return new PySequenceGetItemNodeGen(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy