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

com.oracle.graal.python.lib.PySequenceContainsNodeGen 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.type.SpecialMethodSlot;
import com.oracle.graal.python.lib.PySequenceIterSearchNode.LazyPySequenceIterSeachNode;
import com.oracle.graal.python.lib.PySequenceIterSearchNodeGen.LazyPySequenceIterSeachNodeGen;
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.graal.python.nodes.object.BuiltinClassProfiles.IsBuiltinObjectProfile;
import com.oracle.graal.python.nodes.object.BuiltinClassProfilesFactory.IsBuiltinObjectProfileNodeGen;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.InlineSupport;
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.frame.Frame;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PySequenceContainsNode#contains}
 *     Activation probability: 1.00000
 *     With/without class size: 68/48 bytes
 * 
*/ @GeneratedBy(PySequenceContainsNode.class) @SuppressWarnings("javadoc") public final class PySequenceContainsNodeGen { private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PySequenceContainsNode getUncached() { return PySequenceContainsNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#state_1_} *
  • {@link Inlined#state_2_} *
  • {@link Inlined#getReceiverClass__field1_} *
  • {@link Inlined#lookupContains_} *
  • {@link Inlined#noContainsProfile__field1_} *
  • {@link Inlined#callContains_} *
  • {@link Inlined#iterSearch__field1_} *
  • {@link Inlined#isTrue__field2_} *
  • {@link Inlined#isTrue__field3_} *
  • {@link Inlined#isTrue__field4_} *
  • {@link Inlined#isTrue__field5_} *
  • {@link Inlined#isTrue__field6_} *
*/ @NeverDefault public static PySequenceContainsNode inline(@RequiredField(bits = 23, value = StateField.class)@RequiredField(bits = 20, value = StateField.class)@RequiredField(bits = 19, 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)@RequiredField(type = Object.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 PySequenceContainsNodeGen.Inlined(target); } @GeneratedBy(PySequenceContainsNode.class) @DenyReplace private static final class Inlined extends PySequenceContainsNode { /** * State Info:
         *   0: SpecializationActive {@link PySequenceContainsNode#contains}
         *   1-17: InlinedCache
         *        Specialization: {@link PySequenceContainsNode#contains}
         *        Parameter: {@link GetClassNode} getReceiverClass
         *        Inline method: {@link GetClassNodeGen#inline}
         *   18: InlinedCache
         *        Specialization: {@link PySequenceContainsNode#contains}
         *        Parameter: {@link LazyPySequenceIterSeachNode} iterSearch
         *        Inline method: {@link LazyPySequenceIterSeachNodeGen#inline}
         *   19-22: InlinedCache
         *        Specialization: {@link PySequenceContainsNode#contains}
         *        Parameter: {@link PyObjectIsTrueNode} isTrue
         *        Inline method: {@link PyObjectIsTrueNodeGen#inline}
         * 
*/ private final StateField state_0_; /** * State Info:
         *   0-19: InlinedCache
         *        Specialization: {@link PySequenceContainsNode#contains}
         *        Parameter: {@link IsBuiltinObjectProfile} noContainsProfile
         *        Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
         * 
*/ private final StateField state_1_; /** * State Info:
         *   0-18: InlinedCache
         *        Specialization: {@link PySequenceContainsNode#contains}
         *        Parameter: {@link PyObjectIsTrueNode} isTrue
         *        Inline method: {@link PyObjectIsTrueNodeGen#inline}
         * 
*/ private final StateField state_2_; private final ReferenceField getReceiverClass__field1_; private final ReferenceField lookupContains_; private final ReferenceField noContainsProfile__field1_; private final ReferenceField callContains_; private final ReferenceField iterSearch__field1_; private final ReferenceField isTrue__field2_; private final ReferenceField isTrue__field3_; private final ReferenceField isTrue__field4_; private final ReferenceField isTrue__field5_; private final ReferenceField isTrue__field6_; /** * Source Info:
         *   Specialization: {@link PySequenceContainsNode#contains}
         *   Parameter: {@link GetClassNode} getReceiverClass
         *   Inline method: {@link GetClassNodeGen#inline}
*/ private final GetClassNode getReceiverClass_; /** * Source Info:
         *   Specialization: {@link PySequenceContainsNode#contains}
         *   Parameter: {@link IsBuiltinObjectProfile} noContainsProfile
         *   Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
*/ private final IsBuiltinObjectProfile noContainsProfile_; /** * Source Info:
         *   Specialization: {@link PySequenceContainsNode#contains}
         *   Parameter: {@link LazyPySequenceIterSeachNode} iterSearch
         *   Inline method: {@link LazyPySequenceIterSeachNodeGen#inline}
*/ private final LazyPySequenceIterSeachNode iterSearch_; /** * Source Info:
         *   Specialization: {@link PySequenceContainsNode#contains}
         *   Parameter: {@link PyObjectIsTrueNode} isTrue
         *   Inline method: {@link PyObjectIsTrueNodeGen#inline}
*/ private final PyObjectIsTrueNode isTrue_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PySequenceContainsNode.class); this.state_0_ = target.getState(0, 23); this.state_1_ = target.getState(1, 20); this.state_2_ = target.getState(2, 19); this.getReceiverClass__field1_ = target.getReference(3, Node.class); this.lookupContains_ = target.getReference(4, LookupSpecialMethodSlotNode.class); this.noContainsProfile__field1_ = target.getReference(5, Node.class); this.callContains_ = target.getReference(6, CallBinaryMethodNode.class); this.iterSearch__field1_ = target.getReference(7, Node.class); this.isTrue__field2_ = target.getReference(8, Object.class); this.isTrue__field3_ = target.getReference(9, Node.class); this.isTrue__field4_ = target.getReference(10, Node.class); this.isTrue__field5_ = target.getReference(11, Node.class); this.isTrue__field6_ = target.getReference(12, Node.class); this.getReceiverClass_ = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, state_0_.subUpdater(1, 17), getReceiverClass__field1_)); this.noContainsProfile_ = IsBuiltinObjectProfileNodeGen.inline(InlineTarget.create(IsBuiltinObjectProfile.class, state_1_.subUpdater(0, 20), noContainsProfile__field1_)); this.iterSearch_ = LazyPySequenceIterSeachNodeGen.inline(InlineTarget.create(LazyPySequenceIterSeachNode.class, state_0_.subUpdater(18, 1), iterSearch__field1_)); this.isTrue_ = PyObjectIsTrueNodeGen.inline(InlineTarget.create(PyObjectIsTrueNode.class, state_2_.subUpdater(0, 19), state_0_.subUpdater(19, 4), isTrue__field2_, isTrue__field3_, isTrue__field4_, isTrue__field5_, isTrue__field6_)); } @Override public boolean execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b1) != 0 /* is SpecializationActive[PySequenceContainsNode.contains(Frame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, IsBuiltinObjectProfile, CallBinaryMethodNode, LazyPySequenceIterSeachNode, PyObjectIsTrueNode)] */) { { LookupSpecialMethodSlotNode lookupContains__ = this.lookupContains_.get(arg0Value); if (lookupContains__ != null) { CallBinaryMethodNode callContains__ = this.callContains_.get(arg0Value); if (callContains__ != null) { assert InlineSupport.validate(arg0Value, this.state_0_, this.getReceiverClass__field1_, this.state_1_, this.noContainsProfile__field1_, this.state_0_, this.iterSearch__field1_, this.state_2_, this.state_0_, this.isTrue__field2_, this.isTrue__field3_, this.isTrue__field4_, this.isTrue__field5_, this.isTrue__field6_); return PySequenceContainsNode.contains(frameValue, arg0Value, arg1Value, arg2Value, this.getReceiverClass_, lookupContains__, this.noContainsProfile_, callContains__, this.iterSearch_, this.isTrue_); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value); } private boolean executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) { int state_0 = this.state_0_.get(arg0Value); LookupSpecialMethodSlotNode lookupContains__ = arg0Value.insert((LookupSpecialMethodSlotNode.create(SpecialMethodSlot.Contains))); Objects.requireNonNull(lookupContains__, "Specialization 'contains(Frame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, IsBuiltinObjectProfile, CallBinaryMethodNode, LazyPySequenceIterSeachNode, PyObjectIsTrueNode)' cache 'lookupContains' 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.lookupContains_.set(arg0Value, lookupContains__); CallBinaryMethodNode callContains__ = arg0Value.insert((CallBinaryMethodNode.create())); Objects.requireNonNull(callContains__, "Specialization 'contains(Frame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, IsBuiltinObjectProfile, CallBinaryMethodNode, LazyPySequenceIterSeachNode, PyObjectIsTrueNode)' cache 'callContains' 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.callContains_.set(arg0Value, callContains__); state_0 = state_0 | 0b1 /* add SpecializationActive[PySequenceContainsNode.contains(Frame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, IsBuiltinObjectProfile, CallBinaryMethodNode, LazyPySequenceIterSeachNode, PyObjectIsTrueNode)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.getReceiverClass__field1_, this.state_1_, this.noContainsProfile__field1_, this.state_0_, this.iterSearch__field1_, this.state_2_, this.state_0_, this.isTrue__field2_, this.isTrue__field3_, this.isTrue__field4_, this.isTrue__field5_, this.isTrue__field6_); return PySequenceContainsNode.contains(frameValue, arg0Value, arg1Value, arg2Value, this.getReceiverClass_, lookupContains__, this.noContainsProfile_, callContains__, this.iterSearch_, this.isTrue_); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PySequenceContainsNode.class) @DenyReplace private static final class Uncached extends PySequenceContainsNode { @Override public boolean execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) { CompilerDirectives.transferToInterpreterAndInvalidate(); return PySequenceContainsNode.contains(frameValue, arg0Value, arg1Value, arg2Value, (GetClassNode.getUncached()), (LookupSpecialMethodSlotNode.getUncached(SpecialMethodSlot.Contains)), (IsBuiltinObjectProfile.getUncached()), (CallBinaryMethodNode.getUncached()), (LazyPySequenceIterSeachNodeGen.getUncached()), (PyObjectIsTrueNode.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }