com.oracle.graal.python.nodes.frame.WriteNameNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.nodes.frame;
import com.oracle.graal.python.builtins.objects.common.HashingCollectionNodes.SetItemNode;
import com.oracle.graal.python.lib.PyObjectSetItem;
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.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.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link WriteNameNode#writeGlobal}
* Activation probability: 0.48333
* With/without class size: 13/4 bytes
* Specialization {@link WriteNameNode#writeLocalsDict}
* Activation probability: 0.33333
* With/without class size: 10/4 bytes
* Specialization {@link WriteNameNode#writeLocal}
* Activation probability: 0.18333
* With/without class size: 7/4 bytes
*
*/
@GeneratedBy(WriteNameNode.class)
@SuppressWarnings("javadoc")
public final class WriteNameNodeGen extends WriteNameNode {
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link WriteNameNode#writeGlobal}
* 1: SpecializationActive {@link WriteNameNode#writeLocalsDict}
* 2: SpecializationActive {@link WriteNameNode#writeLocal}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link WriteNameNode#writeGlobal}
* Parameter: {@link WriteGlobalNode} writeGlobal
*/
@Child private WriteGlobalNode writeGlobal_writeGlobal_;
/**
* Source Info:
* Specialization: {@link WriteNameNode#writeLocalsDict}
* Parameter: {@link SetItemNode} setItem
*/
@Child private SetItemNode writeLocalsDict_setItem_;
/**
* Source Info:
* Specialization: {@link WriteNameNode#writeLocal}
* Parameter: {@link PyObjectSetItem} setItem
*/
@Child private PyObjectSetItem writeLocal_setItem_;
private WriteNameNodeGen() {
}
@Override
void executeImpl(VirtualFrame frameValue, TruffleString arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[WriteNameNode.writeGlobal(VirtualFrame, TruffleString, Object, WriteGlobalNode)] || SpecializationActive[WriteNameNode.writeLocalsDict(VirtualFrame, TruffleString, Object, SetItemNode)] || SpecializationActive[WriteNameNode.writeLocal(VirtualFrame, TruffleString, Object, PyObjectSetItem)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[WriteNameNode.writeGlobal(VirtualFrame, TruffleString, Object, WriteGlobalNode)] */) {
{
WriteGlobalNode writeGlobal__ = this.writeGlobal_writeGlobal_;
if (writeGlobal__ != null) {
if ((!(hasLocals(frameValue)))) {
WriteNameNode.writeGlobal(frameValue, arg0Value, arg1Value, writeGlobal__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[WriteNameNode.writeLocalsDict(VirtualFrame, TruffleString, Object, SetItemNode)] */) {
{
SetItemNode setItem__ = this.writeLocalsDict_setItem_;
if (setItem__ != null) {
if ((hasLocalsDict(frameValue))) {
WriteNameNode.writeLocalsDict(frameValue, arg0Value, arg1Value, setItem__);
return;
}
}
}
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[WriteNameNode.writeLocal(VirtualFrame, TruffleString, Object, PyObjectSetItem)] */) {
{
PyObjectSetItem setItem__1 = this.writeLocal_setItem_;
if (setItem__1 != null) {
if ((hasLocals(frameValue))) {
WriteNameNode.writeLocal(frameValue, arg0Value, arg1Value, setItem__1);
return;
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(frameValue, arg0Value, arg1Value);
return;
}
private void executeAndSpecialize(VirtualFrame frameValue, TruffleString arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if ((!(hasLocals(frameValue)))) {
WriteGlobalNode writeGlobal__ = this.insert((WriteGlobalNode.create()));
Objects.requireNonNull(writeGlobal__, "Specialization 'writeGlobal(VirtualFrame, TruffleString, Object, WriteGlobalNode)' cache 'writeGlobal' 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.writeGlobal_writeGlobal_ = writeGlobal__;
state_0 = state_0 | 0b1 /* add SpecializationActive[WriteNameNode.writeGlobal(VirtualFrame, TruffleString, Object, WriteGlobalNode)] */;
this.state_0_ = state_0;
WriteNameNode.writeGlobal(frameValue, arg0Value, arg1Value, writeGlobal__);
return;
}
if ((hasLocalsDict(frameValue))) {
SetItemNode setItem__ = this.insert((SetItemNode.create()));
Objects.requireNonNull(setItem__, "Specialization 'writeLocalsDict(VirtualFrame, TruffleString, Object, SetItemNode)' cache 'setItem' 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.writeLocalsDict_setItem_ = setItem__;
state_0 = state_0 | 0b10 /* add SpecializationActive[WriteNameNode.writeLocalsDict(VirtualFrame, TruffleString, Object, SetItemNode)] */;
this.state_0_ = state_0;
WriteNameNode.writeLocalsDict(frameValue, arg0Value, arg1Value, setItem__);
return;
}
if ((hasLocals(frameValue))) {
PyObjectSetItem setItem__1 = this.insert((PyObjectSetItem.create()));
Objects.requireNonNull(setItem__1, "Specialization 'writeLocal(VirtualFrame, TruffleString, Object, PyObjectSetItem)' cache 'setItem' 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.writeLocal_setItem_ = setItem__1;
state_0 = state_0 | 0b100 /* add SpecializationActive[WriteNameNode.writeLocal(VirtualFrame, TruffleString, Object, PyObjectSetItem)] */;
this.state_0_ = state_0;
WriteNameNode.writeLocal(frameValue, arg0Value, arg1Value, setItem__1);
return;
}
throw new UnsupportedSpecializationException(this, new Node[] {null, null}, arg0Value, arg1Value);
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if (state_0 == 0) {
return NodeCost.UNINITIALIZED;
} else {
if ((state_0 & (state_0 - 1)) == 0 /* is-single */) {
return NodeCost.MONOMORPHIC;
}
}
return NodeCost.POLYMORPHIC;
}
@NeverDefault
public static WriteNameNode create() {
return new WriteNameNodeGen();
}
@NeverDefault
public static WriteNameNode getUncached() {
return WriteNameNodeGen.UNCACHED;
}
@GeneratedBy(WriteNameNode.class)
@DenyReplace
private static final class Uncached extends WriteNameNode {
@Override
void executeImpl(VirtualFrame frameValue, TruffleString arg0Value, Object arg1Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
if ((!(hasLocals(frameValue)))) {
WriteNameNode.writeGlobal(frameValue, arg0Value, arg1Value, (WriteGlobalNode.getUncached()));
return;
}
if ((hasLocalsDict(frameValue))) {
WriteNameNode.writeLocalsDict(frameValue, arg0Value, arg1Value, (SetItemNode.getUncached()));
return;
}
if ((hasLocals(frameValue))) {
WriteNameNode.writeLocal(frameValue, arg0Value, arg1Value, (PyObjectSetItem.getUncached()));
return;
}
throw new UnsupportedSpecializationException(this, new Node[] {null, null}, arg0Value, arg1Value);
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy