com.oracle.graal.python.nodes.call.CallTargetInvokeNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.nodes.call;
import com.oracle.graal.python.builtins.objects.cell.PCell;
import com.oracle.graal.python.builtins.objects.function.PFunction;
import com.oracle.graal.python.builtins.objects.object.PythonObject;
import com.oracle.truffle.api.CallTarget;
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.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
import java.lang.invoke.MethodHandles;
/**
* Debug Info:
* Specialization {@link CallTargetInvokeNode#doNoClosure}
* Activation probability: 0.65000
* With/without class size: 14/0 bytes
* Specialization {@link CallTargetInvokeNode#doGeneric}
* Activation probability: 0.35000
* With/without class size: 9/0 bytes
*
*/
@GeneratedBy(CallTargetInvokeNode.class)
@SuppressWarnings("javadoc")
public final class CallTargetInvokeNodeGen extends CallTargetInvokeNode {
private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link CallTargetInvokeNode#doNoClosure}
* Parameter: {@link InlinedConditionProfile} generatorFunctionProfile
* Inline method: {@link InlinedConditionProfile#inline}
*/
private static final InlinedConditionProfile INLINED_GENERATOR_FUNCTION_PROFILE = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_UPDATER.subUpdater(2, 2)));
/**
* State Info:
* 0: SpecializationActive {@link CallTargetInvokeNode#doNoClosure}
* 1: SpecializationActive {@link CallTargetInvokeNode#doGeneric}
* 2-3: InlinedCache
* Specialization: {@link CallTargetInvokeNode#doNoClosure}
* Parameter: {@link InlinedConditionProfile} generatorFunctionProfile
* Inline method: {@link InlinedConditionProfile#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
private CallTargetInvokeNodeGen(CallTarget callTarget, boolean isBuiltin, boolean isGenerator) {
super(callTarget, isBuiltin, isGenerator);
}
@Override
public Object execute(VirtualFrame frameValue, PFunction arg0Value, PythonObject arg1Value, PCell[] arg2Value, Object[] arg3Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b11) != 0 /* is SpecializationActive[CallTargetInvokeNode.doNoClosure(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] || SpecializationActive[CallTargetInvokeNode.doGeneric(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[CallTargetInvokeNode.doNoClosure(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */) {
if ((arg1Value == null) && (arg2Value == null)) {
Node inliningTarget__ = (this);
return doNoClosure(frameValue, arg0Value, arg1Value, arg2Value, arg3Value, inliningTarget__, INLINED_GENERATOR_FUNCTION_PROFILE);
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[CallTargetInvokeNode.doGeneric(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */) {
{
Node inliningTarget__1 = (this);
return doGeneric(frameValue, arg0Value, arg1Value, arg2Value, arg3Value, inliningTarget__1, INLINED_GENERATOR_FUNCTION_PROFILE);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value, arg3Value);
}
private Object executeAndSpecialize(VirtualFrame frameValue, PFunction arg0Value, PythonObject arg1Value, PCell[] arg2Value, Object[] arg3Value) {
int state_0 = this.state_0_;
{
Node inliningTarget__ = null;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[CallTargetInvokeNode.doGeneric(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */) {
if ((arg1Value == null) && (arg2Value == null)) {
inliningTarget__ = (this);
state_0 = state_0 | 0b1 /* add SpecializationActive[CallTargetInvokeNode.doNoClosure(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */;
this.state_0_ = state_0;
return doNoClosure(frameValue, arg0Value, arg1Value, arg2Value, arg3Value, inliningTarget__, INLINED_GENERATOR_FUNCTION_PROFILE);
}
}
}
{
Node inliningTarget__1 = null;
inliningTarget__1 = (this);
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[CallTargetInvokeNode.doNoClosure(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[CallTargetInvokeNode.doGeneric(VirtualFrame, PFunction, PythonObject, PCell[], Object[], Node, InlinedConditionProfile)] */;
this.state_0_ = state_0;
return doGeneric(frameValue, arg0Value, arg1Value, arg2Value, arg3Value, inliningTarget__1, INLINED_GENERATOR_FUNCTION_PROFILE);
}
}
@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 CallTargetInvokeNode create(CallTarget callTarget, boolean isBuiltin, boolean isGenerator) {
return new CallTargetInvokeNodeGen(callTarget, isBuiltin, isGenerator);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy