com.oracle.graal.python.nodes.bytecode.MakeFunctionNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.nodes.bytecode;
import com.oracle.graal.python.builtins.objects.function.Signature;
import com.oracle.graal.python.compiler.CodeUnit;
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.RootCallTarget;
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.frame.VirtualFrame;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.object.DynamicObjectLibrary;
import com.oracle.truffle.api.strings.TruffleString;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link MakeFunctionNode#makeFunction}
* Activation probability: 1.00000
* With/without class size: 28/8 bytes
*
*/
@GeneratedBy(MakeFunctionNode.class)
@SuppressWarnings("javadoc")
public final class MakeFunctionNodeGen extends MakeFunctionNode {
private static final LibraryFactory DYNAMIC_OBJECT_LIBRARY_ = LibraryFactory.resolve(DynamicObjectLibrary.class);
/**
* State Info:
* 0: SpecializationActive {@link MakeFunctionNode#makeFunction}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link MakeFunctionNode#makeFunction}
* Parameter: {@link PythonObjectFactory} factory
*/
@Child private PythonObjectFactory factory_;
/**
* Source Info:
* Specialization: {@link MakeFunctionNode#makeFunction}
* Parameter: {@link DynamicObjectLibrary} dylib
*/
@Child private DynamicObjectLibrary dylib_;
private MakeFunctionNodeGen(RootCallTarget callTarget, CodeUnit code, Signature signature, TruffleString doc) {
super(callTarget, code, signature, doc);
}
@Override
public int execute(VirtualFrame frameValue, Object arg0Value, int arg1Value, int arg2Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[MakeFunctionNode.makeFunction(VirtualFrame, Object, int, int, PythonObjectFactory, DynamicObjectLibrary)] */) {
{
PythonObjectFactory factory__ = this.factory_;
if (factory__ != null) {
DynamicObjectLibrary dylib__ = this.dylib_;
if (dylib__ != null) {
return makeFunction(frameValue, arg0Value, arg1Value, arg2Value, factory__, dylib__);
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value);
}
private int executeAndSpecialize(VirtualFrame frameValue, Object arg0Value, int arg1Value, int arg2Value) {
int state_0 = this.state_0_;
PythonObjectFactory factory__ = this.insert((PythonObjectFactory.create()));
Objects.requireNonNull(factory__, "Specialization 'makeFunction(VirtualFrame, Object, int, int, PythonObjectFactory, DynamicObjectLibrary)' cache 'factory' 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.factory_ = factory__;
DynamicObjectLibrary dylib__ = this.insert((DYNAMIC_OBJECT_LIBRARY_.createDispatched(1)));
Objects.requireNonNull(dylib__, "Specialization 'makeFunction(VirtualFrame, Object, int, int, PythonObjectFactory, DynamicObjectLibrary)' cache 'dylib' 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.dylib_ = dylib__;
state_0 = state_0 | 0b1 /* add SpecializationActive[MakeFunctionNode.makeFunction(VirtualFrame, Object, int, int, PythonObjectFactory, DynamicObjectLibrary)] */;
this.state_0_ = state_0;
return makeFunction(frameValue, arg0Value, arg1Value, arg2Value, factory__, dylib__);
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if (state_0 == 0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
@NeverDefault
public static MakeFunctionNode create(RootCallTarget callTarget, CodeUnit code, Signature signature, TruffleString doc) {
return new MakeFunctionNodeGen(callTarget, code, signature, doc);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy