com.oracle.graal.python.nodes.bytecode.GetYieldFromIterNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.nodes.bytecode;
import com.oracle.graal.python.builtins.objects.generator.PGenerator;
import com.oracle.graal.python.lib.PyObjectGetIter;
import com.oracle.graal.python.lib.PyObjectGetIterNodeGen;
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.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.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
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.MethodHandles;
/**
* Debug Info:
* Specialization {@link GetYieldFromIterNode#getGeneratorOrCoroutine}
* Activation probability: 0.65000
* With/without class size: 11/0 bytes
* Specialization {@link GetYieldFromIterNode#getGeneric}
* Activation probability: 0.35000
* With/without class size: 15/15 bytes
*
*/
@GeneratedBy(GetYieldFromIterNode.class)
@SuppressWarnings("javadoc")
public final class GetYieldFromIterNodeGen extends GetYieldFromIterNode {
private static final StateField STATE_0_GetYieldFromIterNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link PyObjectGetIter} getIter
* Inline method: {@link PyObjectGetIterNodeGen#inline}
*/
private static final PyObjectGetIter INLINED_GET_GENERIC_GET_ITER_ = PyObjectGetIterNodeGen.inline(InlineTarget.create(PyObjectGetIter.class, STATE_0_GetYieldFromIterNode_UPDATER.subUpdater(2, 2), ReferenceField.create(MethodHandles.lookup(), "getGeneric_getIter__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "getGeneric_getIter__field2_", Node.class)));
/**
* Source Info:
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link IsBuiltinObjectProfile} isCoro
* Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
*/
private static final IsBuiltinObjectProfile INLINED_GET_GENERIC_IS_CORO_ = IsBuiltinObjectProfileNodeGen.inline(InlineTarget.create(IsBuiltinObjectProfile.class, STATE_0_GetYieldFromIterNode_UPDATER.subUpdater(4, 20), ReferenceField.create(MethodHandles.lookup(), "getGeneric_isCoro__field1_", Node.class)));
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link GetYieldFromIterNode#getGeneratorOrCoroutine}
* 1: SpecializationActive {@link GetYieldFromIterNode#getGeneric}
* 2-3: InlinedCache
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link PyObjectGetIter} getIter
* Inline method: {@link PyObjectGetIterNodeGen#inline}
* 4-23: InlinedCache
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link IsBuiltinObjectProfile} isCoro
* Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link PyObjectGetIter} getIter
* Inline method: {@link PyObjectGetIterNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getGeneric_getIter__field1_;
/**
* Source Info:
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link PyObjectGetIter} getIter
* Inline method: {@link PyObjectGetIterNodeGen#inline}
* Inline field: {@link Node} field2
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getGeneric_getIter__field2_;
/**
* Source Info:
* Specialization: {@link GetYieldFromIterNode#getGeneric}
* Parameter: {@link IsBuiltinObjectProfile} isCoro
* Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node getGeneric_isCoro__field1_;
private GetYieldFromIterNodeGen() {
}
@Override
public Object execute(Frame frameValue, Object arg0Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b11) != 0 /* is SpecializationActive[GetYieldFromIterNode.getGeneratorOrCoroutine(PGenerator)] || SpecializationActive[GetYieldFromIterNode.getGeneric(Frame, Object, Node, PyObjectGetIter, IsBuiltinObjectProfile)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[GetYieldFromIterNode.getGeneratorOrCoroutine(PGenerator)] */ && arg0Value instanceof PGenerator) {
PGenerator arg0Value_ = (PGenerator) arg0Value;
return getGeneratorOrCoroutine(arg0Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[GetYieldFromIterNode.getGeneric(Frame, Object, Node, PyObjectGetIter, IsBuiltinObjectProfile)] */) {
{
Node inliningTarget__ = (this);
return getGeneric(frameValue, arg0Value, inliningTarget__, INLINED_GET_GENERIC_GET_ITER_, INLINED_GET_GENERIC_IS_CORO_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value);
}
private Object executeAndSpecialize(Frame frameValue, Object arg0Value) {
int state_0 = this.state_0_;
if (arg0Value instanceof PGenerator) {
PGenerator arg0Value_ = (PGenerator) arg0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[GetYieldFromIterNode.getGeneratorOrCoroutine(PGenerator)] */;
this.state_0_ = state_0;
return getGeneratorOrCoroutine(arg0Value_);
}
{
Node inliningTarget__ = null;
inliningTarget__ = (this);
state_0 = state_0 | 0b10 /* add SpecializationActive[GetYieldFromIterNode.getGeneric(Frame, Object, Node, PyObjectGetIter, IsBuiltinObjectProfile)] */;
this.state_0_ = state_0;
return getGeneric(frameValue, arg0Value, inliningTarget__, INLINED_GET_GENERIC_GET_ITER_, INLINED_GET_GENERIC_IS_CORO_);
}
}
@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 GetYieldFromIterNode create() {
return new GetYieldFromIterNodeGen();
}
@NeverDefault
public static GetYieldFromIterNode getUncached() {
return GetYieldFromIterNodeGen.UNCACHED;
}
@GeneratedBy(GetYieldFromIterNode.class)
@DenyReplace
private static final class Uncached extends GetYieldFromIterNode {
@Override
public Object execute(Frame frameValue, Object arg0Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
if (arg0Value instanceof PGenerator) {
PGenerator arg0Value_ = (PGenerator) arg0Value;
return getGeneratorOrCoroutine(arg0Value_);
}
return getGeneric(frameValue, arg0Value, (this), (PyObjectGetIter.getUncached()), (IsBuiltinObjectProfile.getUncached()));
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy