com.oracle.graal.python.lib.PyObjectDelItemNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.graal.python.nodes.attributes.LookupCallableSlotInMRONode;
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.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 java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link PyObjectDelItem#doWithFrame}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link PyObjectDelItem#doGeneric}
* Activation probability: 0.35000
* With/without class size: 11/4 bytes
*
*/
@GeneratedBy(PyObjectDelItem.class)
@SuppressWarnings({"javadoc", "unused"})
public final class PyObjectDelItemNodeGen extends PyObjectDelItem {
private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link GetClassNode} getClassNode
* Inline method: {@link GetClassNodeGen#inline}
*/
private static final GetClassNode INLINED_GETCLASS = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, STATE_0_UPDATER.subUpdater(2, 17), ReferenceField.create(MethodHandles.lookup(), "getclass_field1_", Node.class)));
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*/
private static final Lazy INLINED_RAISE_NODE = LazyNodeGen.inline(InlineTarget.create(Lazy.class, STATE_0_UPDATER.subUpdater(19, 1), ReferenceField.create(MethodHandles.lookup(), "raiseNode_field1_", Node.class)));
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link PyObjectDelItem#doWithFrame}
* 1: SpecializationActive {@link PyObjectDelItem#doGeneric}
* 2-18: InlinedCache
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link GetClassNode} getClassNode
* Inline method: {@link GetClassNodeGen#inline}
* 19: InlinedCache
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link GetClassNode} getClassNode
* Inline method: {@link GetClassNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getclass_field1_;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node raiseNode_field1_;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link CallBinaryMethodNode} callDelitem
*/
@Child private CallBinaryMethodNode callNode;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link LookupSpecialMethodSlotNode} lookupDelitem
*/
@Child private LookupSpecialMethodSlotNode withFrame_lookupDelitem_;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doGeneric}
* Parameter: {@link LookupCallableSlotInMRONode} lookupDelitem
*/
@Child private LookupCallableSlotInMRONode generic_lookupDelitem_;
private PyObjectDelItemNodeGen() {
}
@Override
public void execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] || SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */) {
{
LookupSpecialMethodSlotNode lookupDelitem__ = this.withFrame_lookupDelitem_;
if (lookupDelitem__ != null) {
CallBinaryMethodNode callNode_ = this.callNode;
if (callNode_ != null) {
PyObjectDelItem.doWithFrame((VirtualFrame) frameValue, this, arg1Value, arg2Value, INLINED_GETCLASS, lookupDelitem__, INLINED_RAISE_NODE, callNode_);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
{
LookupCallableSlotInMRONode lookupDelitem__1 = this.generic_lookupDelitem_;
if (lookupDelitem__1 != null) {
CallBinaryMethodNode callNode_1 = this.callNode;
if (callNode_1 != null) {
PyObjectDelItem.doGeneric(this, arg1Value, arg2Value, INLINED_GETCLASS, lookupDelitem__1, INLINED_RAISE_NODE, callNode_1);
return;
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value);
return;
}
private void executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
LookupSpecialMethodSlotNode lookupDelitem__ = this.insert((LookupSpecialMethodSlotNode.create(SpecialMethodSlot.DelItem)));
Objects.requireNonNull(lookupDelitem__, "Specialization 'doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)' cache 'lookupDelitem' 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.withFrame_lookupDelitem_ = lookupDelitem__;
CallBinaryMethodNode callNode_;
CallBinaryMethodNode callNode__shared = this.callNode;
if (callNode__shared != null) {
callNode_ = callNode__shared;
} else {
callNode_ = this.insert((CallBinaryMethodNode.create()));
if (callNode_ == null) {
throw new IllegalStateException("Specialization 'doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)' contains a shared cache with name 'callDelitem' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.callNode == null) {
VarHandle.storeStoreFence();
this.callNode = callNode_;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */;
this.state_0_ = state_0;
PyObjectDelItem.doWithFrame((VirtualFrame) frameValue, this, arg1Value, arg2Value, INLINED_GETCLASS, lookupDelitem__, INLINED_RAISE_NODE, callNode_);
return;
}
LookupCallableSlotInMRONode lookupDelitem__1 = this.insert((LookupCallableSlotInMRONode.create(SpecialMethodSlot.DelItem)));
Objects.requireNonNull(lookupDelitem__1, "Specialization 'doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)' cache 'lookupDelitem' 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.generic_lookupDelitem_ = lookupDelitem__1;
CallBinaryMethodNode callNode_1;
CallBinaryMethodNode callNode_1_shared = this.callNode;
if (callNode_1_shared != null) {
callNode_1 = callNode_1_shared;
} else {
callNode_1 = this.insert((CallBinaryMethodNode.create()));
if (callNode_1 == null) {
throw new IllegalStateException("Specialization 'doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)' contains a shared cache with name 'callDelitem' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.callNode == null) {
VarHandle.storeStoreFence();
this.callNode = callNode_1;
}
this.withFrame_lookupDelitem_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */;
this.state_0_ = state_0;
PyObjectDelItem.doGeneric(this, arg1Value, arg2Value, INLINED_GETCLASS, lookupDelitem__1, INLINED_RAISE_NODE, callNode_1);
return;
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if ((state_0 & 0b11) == 0) {
return NodeCost.UNINITIALIZED;
} else {
if (((state_0 & 0b11) & ((state_0 & 0b11) - 1)) == 0 /* is-single */) {
return NodeCost.MONOMORPHIC;
}
}
return NodeCost.POLYMORPHIC;
}
@NeverDefault
public static PyObjectDelItem create() {
return new PyObjectDelItemNodeGen();
}
@NeverDefault
public static PyObjectDelItem getUncached() {
return PyObjectDelItemNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#getclass_field1_}
*
- {@link Inlined#raiseNode_field1_}
*
- {@link Inlined#callNode}
*
- {@link Inlined#withFrame_lookupDelitem_}
*
- {@link Inlined#generic_lookupDelitem_}
*
*/
@NeverDefault
public static PyObjectDelItem inline(@RequiredField(bits = 20, 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 PyObjectDelItemNodeGen.Inlined(target);
}
@GeneratedBy(PyObjectDelItem.class)
@DenyReplace
private static final class Inlined extends PyObjectDelItem {
/**
* State Info:
* 0: SpecializationActive {@link PyObjectDelItem#doWithFrame}
* 1: SpecializationActive {@link PyObjectDelItem#doGeneric}
* 2-18: InlinedCache
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link GetClassNode} getClassNode
* Inline method: {@link GetClassNodeGen#inline}
* 19: InlinedCache
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*
*/
private final StateField state_0_;
private final ReferenceField getclass_field1_;
private final ReferenceField raiseNode_field1_;
private final ReferenceField callNode;
private final ReferenceField withFrame_lookupDelitem_;
private final ReferenceField generic_lookupDelitem_;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link GetClassNode} getClassNode
* Inline method: {@link GetClassNodeGen#inline}
*/
private final GetClassNode getclass;
/**
* Source Info:
* Specialization: {@link PyObjectDelItem#doWithFrame}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*/
private final Lazy raiseNode;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyObjectDelItem.class);
this.state_0_ = target.getState(0, 20);
this.getclass_field1_ = target.getReference(1, Node.class);
this.raiseNode_field1_ = target.getReference(2, Node.class);
this.callNode = target.getReference(3, CallBinaryMethodNode.class);
this.withFrame_lookupDelitem_ = target.getReference(4, LookupSpecialMethodSlotNode.class);
this.generic_lookupDelitem_ = target.getReference(5, LookupCallableSlotInMRONode.class);
this.getclass = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, state_0_.subUpdater(2, 17), getclass_field1_));
this.raiseNode = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(19, 1), raiseNode_field1_));
}
@Override
public void execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] || SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */) {
{
LookupSpecialMethodSlotNode lookupDelitem__ = this.withFrame_lookupDelitem_.get(arg0Value);
if (lookupDelitem__ != null) {
CallBinaryMethodNode callNode_ = this.callNode.get(arg0Value);
if (callNode_ != null) {
PyObjectDelItem.doWithFrame((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, this.getclass, lookupDelitem__, this.raiseNode, callNode_);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
{
LookupCallableSlotInMRONode lookupDelitem__1 = this.generic_lookupDelitem_.get(arg0Value);
if (lookupDelitem__1 != null) {
CallBinaryMethodNode callNode_1 = this.callNode.get(arg0Value);
if (callNode_1 != null) {
PyObjectDelItem.doGeneric(arg0Value, arg1Value, arg2Value, this.getclass, lookupDelitem__1, this.raiseNode, callNode_1);
return;
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value);
return;
}
private void executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_.get(arg0Value);
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */) {
LookupSpecialMethodSlotNode lookupDelitem__ = arg0Value.insert((LookupSpecialMethodSlotNode.create(SpecialMethodSlot.DelItem)));
Objects.requireNonNull(lookupDelitem__, "Specialization 'doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)' cache 'lookupDelitem' 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.withFrame_lookupDelitem_.set(arg0Value, lookupDelitem__);
CallBinaryMethodNode callNode_;
CallBinaryMethodNode callNode__shared = this.callNode.get(arg0Value);
if (callNode__shared != null) {
callNode_ = callNode__shared;
} else {
callNode_ = arg0Value.insert((CallBinaryMethodNode.create()));
if (callNode_ == null) {
throw new IllegalStateException("Specialization 'doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)' contains a shared cache with name 'callDelitem' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.callNode.get(arg0Value) == null) {
VarHandle.storeStoreFence();
this.callNode.set(arg0Value, callNode_);
}
state_0 = state_0 | 0b1 /* add SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */;
this.state_0_.set(arg0Value, state_0);
PyObjectDelItem.doWithFrame((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, this.getclass, lookupDelitem__, this.raiseNode, callNode_);
return;
}
LookupCallableSlotInMRONode lookupDelitem__1 = arg0Value.insert((LookupCallableSlotInMRONode.create(SpecialMethodSlot.DelItem)));
Objects.requireNonNull(lookupDelitem__1, "Specialization 'doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)' cache 'lookupDelitem' 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.generic_lookupDelitem_.set(arg0Value, lookupDelitem__1);
CallBinaryMethodNode callNode_1;
CallBinaryMethodNode callNode_1_shared = this.callNode.get(arg0Value);
if (callNode_1_shared != null) {
callNode_1 = callNode_1_shared;
} else {
callNode_1 = arg0Value.insert((CallBinaryMethodNode.create()));
if (callNode_1 == null) {
throw new IllegalStateException("Specialization 'doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)' contains a shared cache with name 'callDelitem' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.callNode.get(arg0Value) == null) {
VarHandle.storeStoreFence();
this.callNode.set(arg0Value, callNode_1);
}
this.withFrame_lookupDelitem_.set(arg0Value, null);
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PyObjectDelItem.doWithFrame(VirtualFrame, Node, Object, Object, GetClassNode, LookupSpecialMethodSlotNode, Lazy, CallBinaryMethodNode)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[PyObjectDelItem.doGeneric(Node, Object, Object, GetClassNode, LookupCallableSlotInMRONode, Lazy, CallBinaryMethodNode)] */;
this.state_0_.set(arg0Value, state_0);
PyObjectDelItem.doGeneric(arg0Value, arg1Value, arg2Value, this.getclass, lookupDelitem__1, this.raiseNode, callNode_1);
return;
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(PyObjectDelItem.class)
@DenyReplace
private static final class Uncached extends PyObjectDelItem {
@Override
public void execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
PyObjectDelItem.doGeneric(arg0Value, arg1Value, arg2Value, (GetClassNode.getUncached()), (LookupCallableSlotInMRONode.getUncached(SpecialMethodSlot.DelItem)), (Lazy.getUncached()), (CallBinaryMethodNode.getUncached()));
return;
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy