com.oracle.truffle.nfi.SignatureRootNodeFactory Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.nfi;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.EncapsulatingNodeReference;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.nfi.SignatureRootNode.AddArgumentNode;
import com.oracle.truffle.nfi.SignatureRootNode.ArgumentBuilderNode;
import com.oracle.truffle.nfi.SignatureRootNode.BuildSignatureNode;
import com.oracle.truffle.nfi.SignatureRootNode.GetArrayTypeNode;
import com.oracle.truffle.nfi.SignatureRootNode.GetEnvTypeNode;
import com.oracle.truffle.nfi.SignatureRootNode.GetSignatureTypeNode;
import com.oracle.truffle.nfi.SignatureRootNode.GetSimpleTypeNode;
import com.oracle.truffle.nfi.SignatureRootNode.GetTypeNode;
import com.oracle.truffle.nfi.SignatureRootNode.MakeVarargs;
import com.oracle.truffle.nfi.SignatureRootNode.SetRetTypeNode;
import com.oracle.truffle.nfi.backend.spi.NFIBackendLibrary;
import com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureBuilderLibrary;
import com.oracle.truffle.nfi.backend.spi.types.NativeSimpleType;
import com.oracle.truffle.nfi.backend.spi.util.ProfiledArrayBuilder.ArrayBuilderFactory;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;
@GeneratedBy(SignatureRootNode.class)
@SuppressWarnings({"javadoc", "unused"})
final class SignatureRootNodeFactory {
private static final LibraryFactory N_F_I_BACKEND_LIBRARY_ = LibraryFactory.resolve(NFIBackendLibrary.class);
private static final LibraryFactory N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_ = LibraryFactory.resolve(NFIBackendSignatureBuilderLibrary.class);
/**
* Debug Info:
* Specialization {@link BuildSignatureNode#doBuild}
* Activation probability: 0.65000
* With/without class size: 24/12 bytes
* Specialization {@link BuildSignatureNode#doBuild}
* Activation probability: 0.35000
* With/without class size: 12/8 bytes
*
*/
@GeneratedBy(BuildSignatureNode.class)
@SuppressWarnings("javadoc")
static final class BuildSignatureNodeGen extends BuildSignatureNode {
static final ReferenceField BUILD0_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "build0_cache", Build0Data.class);
/**
* State Info:
* 0: SpecializationActive {@link BuildSignatureNode#doBuild}
* 1: SpecializationActive {@link BuildSignatureNode#doBuild}
*
*/
@CompilationFinal private int state_0_;
@UnsafeAccessedField @Child private Build0Data build0_cache;
/**
* Source Info:
* Specialization: {@link BuildSignatureNode#doBuild}
* Parameter: {@link NFIBackendSignatureBuilderLibrary} sigBuilderLibrary
*/
@Child private NFIBackendSignatureBuilderLibrary build1_sigBuilderLibrary_;
/**
* Source Info:
* Specialization: {@link BuildSignatureNode#doBuild}
* Parameter: {@link ArrayBuilderFactory} factory
*/
@CompilationFinal private ArrayBuilderFactory build1_factory_;
private BuildSignatureNodeGen(ArgumentBuilderNode[] argBuilders) {
super(argBuilders);
}
@ExplodeLoop
@Override
Object execute(API arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] || SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */) {
Build0Data s0_ = this.build0_cache;
while (s0_ != null) {
if ((s0_.backendLibrary_.accepts(arg0Value.backend))) {
return doBuild(arg0Value, s0_.backendLibrary_, s0_.sigBuilderLibrary_, s0_.factory_);
}
s0_ = s0_.next_;
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */) {
{
NFIBackendSignatureBuilderLibrary sigBuilderLibrary__ = this.build1_sigBuilderLibrary_;
if (sigBuilderLibrary__ != null) {
ArrayBuilderFactory factory__ = this.build1_factory_;
if (factory__ != null) {
return this.build1Boundary(state_0, arg0Value, sigBuilderLibrary__, factory__);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object build1Boundary(int state_0, API arg0Value, NFIBackendSignatureBuilderLibrary sigBuilderLibrary__, ArrayBuilderFactory factory__) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendLibrary backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
return doBuild(arg0Value, backendLibrary__, sigBuilderLibrary__, factory__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(API arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */) {
while (true) {
int count0_ = 0;
Build0Data s0_ = BUILD0_CACHE_UPDATER.getVolatile(this);
Build0Data s0_original = s0_;
while (s0_ != null) {
if ((s0_.backendLibrary_.accepts(arg0Value.backend))) {
break;
}
count0_++;
s0_ = s0_.next_;
}
if (s0_ == null) {
// assert (s0_.backendLibrary_.accepts(arg0Value.backend));
if (count0_ < (3)) {
s0_ = this.insert(new Build0Data(s0_original));
NFIBackendLibrary backendLibrary__ = s0_.insert((N_F_I_BACKEND_LIBRARY_.create(arg0Value.backend)));
Objects.requireNonNull(backendLibrary__, "Specialization 'doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)' cache 'backendLibrary' 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'.");
s0_.backendLibrary_ = backendLibrary__;
NFIBackendSignatureBuilderLibrary sigBuilderLibrary__ = s0_.insert((N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.createDispatched(1)));
Objects.requireNonNull(sigBuilderLibrary__, "Specialization 'doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)' cache 'sigBuilderLibrary' 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'.");
s0_.sigBuilderLibrary_ = sigBuilderLibrary__;
ArrayBuilderFactory factory__ = (ArrayBuilderFactory.create());
Objects.requireNonNull(factory__, "Specialization 'doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)' 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'.");
s0_.factory_ = factory__;
if (!BUILD0_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */;
this.state_0_ = state_0;
}
}
if (s0_ != null) {
return doBuild(arg0Value, s0_.backendLibrary_, s0_.sigBuilderLibrary_, s0_.factory_);
}
break;
}
}
{
NFIBackendLibrary backendLibrary__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
NFIBackendSignatureBuilderLibrary sigBuilderLibrary__ = this.insert((N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.createDispatched(1)));
Objects.requireNonNull(sigBuilderLibrary__, "Specialization 'doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)' cache 'sigBuilderLibrary' 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.build1_sigBuilderLibrary_ = sigBuilderLibrary__;
ArrayBuilderFactory factory__ = (ArrayBuilderFactory.create());
Objects.requireNonNull(factory__, "Specialization 'doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)' 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.build1_factory_ = factory__;
this.build0_cache = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.BuildSignatureNode.doBuild(API, NFIBackendLibrary, NFIBackendSignatureBuilderLibrary, ArrayBuilderFactory)] */;
this.state_0_ = state_0;
return doBuild(arg0Value, backendLibrary__, sigBuilderLibrary__, factory__);
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 */) {
Build0Data s0_ = this.build0_cache;
if ((s0_ == null || s0_.next_ == null)) {
return NodeCost.MONOMORPHIC;
}
}
}
return NodeCost.POLYMORPHIC;
}
@NeverDefault
public static BuildSignatureNode create(ArgumentBuilderNode[] argBuilders) {
return new BuildSignatureNodeGen(argBuilders);
}
@GeneratedBy(BuildSignatureNode.class)
@DenyReplace
private static final class Build0Data extends Node {
@Child Build0Data next_;
/**
* Source Info:
* Specialization: {@link BuildSignatureNode#doBuild}
* Parameter: {@link NFIBackendLibrary} backendLibrary
*/
@Child NFIBackendLibrary backendLibrary_;
/**
* Source Info:
* Specialization: {@link BuildSignatureNode#doBuild}
* Parameter: {@link NFIBackendSignatureBuilderLibrary} sigBuilderLibrary
*/
@Child NFIBackendSignatureBuilderLibrary sigBuilderLibrary_;
/**
* Source Info:
* Specialization: {@link BuildSignatureNode#doBuild}
* Parameter: {@link ArrayBuilderFactory} factory
*/
@CompilationFinal ArrayBuilderFactory factory_;
Build0Data(Build0Data next_) {
this.next_ = next_;
}
@Override
public NodeCost getCost() {
return NodeCost.NONE;
}
}
}
/**
* Debug Info:
* Specialization {@link SetRetTypeNode#setRetType}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link SetRetTypeNode#setRetType}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(SetRetTypeNode.class)
@SuppressWarnings("javadoc")
static final class SetRetTypeNodeGen extends SetRetTypeNode {
/**
* State Info:
* 0: SpecializationActive {@link SetRetTypeNode#setRetType}
* 1: SpecializationActive {@link SetRetTypeNode#setRetType}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link SetRetTypeNode#setRetType}
* Parameter: {@link NFIBackendSignatureBuilderLibrary} sigBuilderLib
*/
@Child private NFIBackendSignatureBuilderLibrary setRetType0_sigBuilderLib_;
private SetRetTypeNodeGen(GetTypeNode retType) {
super(retType);
}
@Override
void execute(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] || SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.setRetType0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
setRetType(arg0Value, arg1Value, sigBuilderLib__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
this.setRetType1Boundary(state_0, arg0Value, arg1Value);
return;
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(arg0Value, arg1Value);
return;
}
@SuppressWarnings("static-method")
@TruffleBoundary
private void setRetType1Boundary(int state_0, API arg0Value, Object arg1Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
setRetType(arg0Value, arg1Value, sigBuilderLib__);
return;
}
} finally {
encapsulating_.set(prev_);
}
}
private void executeAndSpecialize(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
while (true) {
boolean SetRetType0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.setRetType0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
SetRetType0_duplicateFound_ = true;
}
}
}
if (!SetRetType0_duplicateFound_) {
// assert (this.setRetType0_sigBuilderLib_.accepts(arg1Value));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.insert((N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.create(arg1Value)));
Objects.requireNonNull(sigBuilderLib__, "Specialization 'setRetType(API, Object, NFIBackendSignatureBuilderLibrary)' cache 'sigBuilderLib' 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'.");
this.setRetType0_sigBuilderLib_ = sigBuilderLib__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
SetRetType0_duplicateFound_ = true;
}
}
if (SetRetType0_duplicateFound_) {
setRetType(arg0Value, arg1Value, this.setRetType0_sigBuilderLib_);
return;
}
break;
}
}
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
this.setRetType0_sigBuilderLib_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.SetRetTypeNode.setRetType(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
setRetType(arg0Value, arg1Value, sigBuilderLib__);
return;
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 SetRetTypeNode create(GetTypeNode retType) {
return new SetRetTypeNodeGen(retType);
}
}
/**
* Debug Info:
* Specialization {@link AddArgumentNode#addArgument}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link AddArgumentNode#addArgument}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(AddArgumentNode.class)
@SuppressWarnings("javadoc")
static final class AddArgumentNodeGen extends AddArgumentNode {
/**
* State Info:
* 0: SpecializationActive {@link AddArgumentNode#addArgument}
* 1: SpecializationActive {@link AddArgumentNode#addArgument}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link AddArgumentNode#addArgument}
* Parameter: {@link NFIBackendSignatureBuilderLibrary} sigBuilderLib
*/
@Child private NFIBackendSignatureBuilderLibrary addArgument0_sigBuilderLib_;
private AddArgumentNodeGen(GetTypeNode argType) {
super(argType);
}
@Override
void execute(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] || SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.addArgument0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
addArgument(arg0Value, arg1Value, sigBuilderLib__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
this.addArgument1Boundary(state_0, arg0Value, arg1Value);
return;
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(arg0Value, arg1Value);
return;
}
@SuppressWarnings("static-method")
@TruffleBoundary
private void addArgument1Boundary(int state_0, API arg0Value, Object arg1Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
addArgument(arg0Value, arg1Value, sigBuilderLib__);
return;
}
} finally {
encapsulating_.set(prev_);
}
}
private void executeAndSpecialize(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
while (true) {
boolean AddArgument0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.addArgument0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
AddArgument0_duplicateFound_ = true;
}
}
}
if (!AddArgument0_duplicateFound_) {
// assert (this.addArgument0_sigBuilderLib_.accepts(arg1Value));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.insert((N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.create(arg1Value)));
Objects.requireNonNull(sigBuilderLib__, "Specialization 'addArgument(API, Object, NFIBackendSignatureBuilderLibrary)' cache 'sigBuilderLib' 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'.");
this.addArgument0_sigBuilderLib_ = sigBuilderLib__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
AddArgument0_duplicateFound_ = true;
}
}
if (AddArgument0_duplicateFound_) {
addArgument(arg0Value, arg1Value, this.addArgument0_sigBuilderLib_);
return;
}
break;
}
}
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
this.addArgument0_sigBuilderLib_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.AddArgumentNode.addArgument(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
addArgument(arg0Value, arg1Value, sigBuilderLib__);
return;
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 AddArgumentNode create(GetTypeNode argType) {
return new AddArgumentNodeGen(argType);
}
}
/**
* Debug Info:
* Specialization {@link MakeVarargs#makeVarargs}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link MakeVarargs#makeVarargs}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(MakeVarargs.class)
@SuppressWarnings("javadoc")
static final class MakeVarargsNodeGen extends MakeVarargs {
/**
* State Info:
* 0: SpecializationActive {@link MakeVarargs#makeVarargs}
* 1: SpecializationActive {@link MakeVarargs#makeVarargs}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link MakeVarargs#makeVarargs}
* Parameter: {@link NFIBackendSignatureBuilderLibrary} sigBuilderLib
*/
@Child private NFIBackendSignatureBuilderLibrary makeVarargs0_sigBuilderLib_;
private MakeVarargsNodeGen() {
}
@Override
void execute(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] || SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.makeVarargs0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
makeVarargs(arg0Value, arg1Value, sigBuilderLib__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
this.makeVarargs1Boundary(state_0, arg0Value, arg1Value);
return;
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(arg0Value, arg1Value);
return;
}
@SuppressWarnings("static-method")
@TruffleBoundary
private void makeVarargs1Boundary(int state_0, API arg0Value, Object arg1Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
makeVarargs(arg0Value, arg1Value, sigBuilderLib__);
return;
}
} finally {
encapsulating_.set(prev_);
}
}
private void executeAndSpecialize(API arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
while (true) {
boolean MakeVarargs0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.makeVarargs0_sigBuilderLib_;
if (sigBuilderLib__ != null) {
if ((sigBuilderLib__.accepts(arg1Value))) {
MakeVarargs0_duplicateFound_ = true;
}
}
}
if (!MakeVarargs0_duplicateFound_) {
// assert (this.makeVarargs0_sigBuilderLib_.accepts(arg1Value));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */) {
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = this.insert((N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.create(arg1Value)));
Objects.requireNonNull(sigBuilderLib__, "Specialization 'makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)' cache 'sigBuilderLib' 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'.");
this.makeVarargs0_sigBuilderLib_ = sigBuilderLib__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
MakeVarargs0_duplicateFound_ = true;
}
}
if (MakeVarargs0_duplicateFound_) {
makeVarargs(arg0Value, arg1Value, this.makeVarargs0_sigBuilderLib_);
return;
}
break;
}
}
{
NFIBackendSignatureBuilderLibrary sigBuilderLib__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
sigBuilderLib__ = (N_F_I_BACKEND_SIGNATURE_BUILDER_LIBRARY_.getUncached(arg1Value));
this.makeVarargs0_sigBuilderLib_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.MakeVarargs.makeVarargs(API, Object, NFIBackendSignatureBuilderLibrary)] */;
this.state_0_ = state_0;
makeVarargs(arg0Value, arg1Value, sigBuilderLib__);
return;
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 MakeVarargs create() {
return new MakeVarargsNodeGen();
}
}
/**
* Debug Info:
* Specialization {@link GetSimpleTypeNode#getType}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link GetSimpleTypeNode#getType}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(GetSimpleTypeNode.class)
@SuppressWarnings("javadoc")
static final class GetSimpleTypeNodeGen extends GetSimpleTypeNode {
/**
* State Info:
* 0: SpecializationActive {@link GetSimpleTypeNode#getType}
* 1: SpecializationActive {@link GetSimpleTypeNode#getType}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link GetSimpleTypeNode#getType}
* Parameter: {@link NFIBackendLibrary} backendLibrary
*/
@Child private NFIBackendLibrary getType0_backendLibrary_;
private GetSimpleTypeNodeGen(NativeSimpleType type) {
super(type);
}
@Override
Object execute(API arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] || SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
{
NFIBackendLibrary backendLibrary__ = this.getType0_backendLibrary_;
if (backendLibrary__ != null) {
if ((backendLibrary__.accepts(arg0Value.backend))) {
return getType(arg0Value, backendLibrary__);
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
return this.getType1Boundary(state_0, arg0Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object getType1Boundary(int state_0, API arg0Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendLibrary backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
return getType(arg0Value, backendLibrary__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(API arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
while (true) {
boolean GetType0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backendLibrary__ = this.getType0_backendLibrary_;
if (backendLibrary__ != null) {
if ((backendLibrary__.accepts(arg0Value.backend))) {
GetType0_duplicateFound_ = true;
}
}
}
if (!GetType0_duplicateFound_) {
// assert (this.getType0_backendLibrary_.accepts(arg0Value.backend));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backendLibrary__ = this.insert((N_F_I_BACKEND_LIBRARY_.create(arg0Value.backend)));
Objects.requireNonNull(backendLibrary__, "Specialization 'getType(API, NFIBackendLibrary)' cache 'backendLibrary' 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'.");
this.getType0_backendLibrary_ = backendLibrary__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
GetType0_duplicateFound_ = true;
}
}
if (GetType0_duplicateFound_) {
return getType(arg0Value, this.getType0_backendLibrary_);
}
break;
}
}
{
NFIBackendLibrary backendLibrary__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
this.getType0_backendLibrary_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.GetSimpleTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
return getType(arg0Value, backendLibrary__);
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 GetSimpleTypeNode create(NativeSimpleType type) {
return new GetSimpleTypeNodeGen(type);
}
}
/**
* Debug Info:
* Specialization {@link GetArrayTypeNode#getType}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link GetArrayTypeNode#getType}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(GetArrayTypeNode.class)
@SuppressWarnings("javadoc")
static final class GetArrayTypeNodeGen extends GetArrayTypeNode {
/**
* State Info:
* 0: SpecializationActive {@link GetArrayTypeNode#getType}
* 1: SpecializationActive {@link GetArrayTypeNode#getType}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link GetArrayTypeNode#getType}
* Parameter: {@link NFIBackendLibrary} backendLibrary
*/
@Child private NFIBackendLibrary getType0_backendLibrary_;
private GetArrayTypeNodeGen(NativeSimpleType type) {
super(type);
}
@Override
Object execute(API arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] || SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
{
NFIBackendLibrary backendLibrary__ = this.getType0_backendLibrary_;
if (backendLibrary__ != null) {
if ((backendLibrary__.accepts(arg0Value.backend))) {
return getType(arg0Value, backendLibrary__);
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
return this.getType1Boundary(state_0, arg0Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object getType1Boundary(int state_0, API arg0Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendLibrary backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
return getType(arg0Value, backendLibrary__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(API arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
while (true) {
boolean GetType0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backendLibrary__ = this.getType0_backendLibrary_;
if (backendLibrary__ != null) {
if ((backendLibrary__.accepts(arg0Value.backend))) {
GetType0_duplicateFound_ = true;
}
}
}
if (!GetType0_duplicateFound_) {
// assert (this.getType0_backendLibrary_.accepts(arg0Value.backend));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backendLibrary__ = this.insert((N_F_I_BACKEND_LIBRARY_.create(arg0Value.backend)));
Objects.requireNonNull(backendLibrary__, "Specialization 'getType(API, NFIBackendLibrary)' cache 'backendLibrary' 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'.");
this.getType0_backendLibrary_ = backendLibrary__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
GetType0_duplicateFound_ = true;
}
}
if (GetType0_duplicateFound_) {
return getType(arg0Value, this.getType0_backendLibrary_);
}
break;
}
}
{
NFIBackendLibrary backendLibrary__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
backendLibrary__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
this.getType0_backendLibrary_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.GetArrayTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
return getType(arg0Value, backendLibrary__);
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 GetArrayTypeNode create(NativeSimpleType type) {
return new GetArrayTypeNodeGen(type);
}
}
/**
* Debug Info:
* Specialization {@link GetEnvTypeNode#getType}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link GetEnvTypeNode#getType}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(GetEnvTypeNode.class)
@SuppressWarnings("javadoc")
static final class GetEnvTypeNodeGen extends GetEnvTypeNode {
/**
* State Info:
* 0: SpecializationActive {@link GetEnvTypeNode#getType}
* 1: SpecializationActive {@link GetEnvTypeNode#getType}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link GetEnvTypeNode#getType}
* Parameter: {@link NFIBackendLibrary} backend
*/
@Child private NFIBackendLibrary getType0_backend_;
private GetEnvTypeNodeGen() {
}
@Override
Object execute(API arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] || SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
{
NFIBackendLibrary backend__ = this.getType0_backend_;
if (backend__ != null) {
if ((backend__.accepts(arg0Value.backend))) {
return getType(arg0Value, backend__);
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
return this.getType1Boundary(state_0, arg0Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object getType1Boundary(int state_0, API arg0Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendLibrary backend__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
return getType(arg0Value, backend__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(API arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
while (true) {
boolean GetType0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backend__ = this.getType0_backend_;
if (backend__ != null) {
if ((backend__.accepts(arg0Value.backend))) {
GetType0_duplicateFound_ = true;
}
}
}
if (!GetType0_duplicateFound_) {
// assert (this.getType0_backend_.accepts(arg0Value.backend));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backend__ = this.insert((N_F_I_BACKEND_LIBRARY_.create(arg0Value.backend)));
Objects.requireNonNull(backend__, "Specialization 'getType(API, NFIBackendLibrary)' cache 'backend' 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'.");
this.getType0_backend_ = backend__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
GetType0_duplicateFound_ = true;
}
}
if (GetType0_duplicateFound_) {
return getType(arg0Value, this.getType0_backend_);
}
break;
}
}
{
NFIBackendLibrary backend__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
backend__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
this.getType0_backend_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.GetEnvTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
return getType(arg0Value, backend__);
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 GetEnvTypeNode create() {
return new GetEnvTypeNodeGen();
}
}
/**
* Debug Info:
* Specialization {@link GetSignatureTypeNode#getType}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link GetSignatureTypeNode#getType}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(GetSignatureTypeNode.class)
@SuppressWarnings("javadoc")
static final class GetSignatureTypeNodeGen extends GetSignatureTypeNode {
/**
* State Info:
* 0: SpecializationActive {@link GetSignatureTypeNode#getType}
* 1: SpecializationActive {@link GetSignatureTypeNode#getType}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link GetSignatureTypeNode#getType}
* Parameter: {@link NFIBackendLibrary} backend
*/
@Child private NFIBackendLibrary getType0_backend_;
private GetSignatureTypeNodeGen(BuildSignatureNode buildSignature) {
super(buildSignature);
}
@Override
Object execute(API arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] || SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
{
NFIBackendLibrary backend__ = this.getType0_backend_;
if (backend__ != null) {
if ((backend__.accepts(arg0Value.backend))) {
return getType(arg0Value, backend__);
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
return this.getType1Boundary(state_0, arg0Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object getType1Boundary(int state_0, API arg0Value) {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
NFIBackendLibrary backend__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
return getType(arg0Value, backend__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(API arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
while (true) {
boolean GetType0_duplicateFound_ = false;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backend__ = this.getType0_backend_;
if (backend__ != null) {
if ((backend__.accepts(arg0Value.backend))) {
GetType0_duplicateFound_ = true;
}
}
}
if (!GetType0_duplicateFound_) {
// assert (this.getType0_backend_.accepts(arg0Value.backend));
if (((state_0 & 0b1)) == 0 /* is-not SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */) {
NFIBackendLibrary backend__ = this.insert((N_F_I_BACKEND_LIBRARY_.create(arg0Value.backend)));
Objects.requireNonNull(backend__, "Specialization 'getType(API, NFIBackendLibrary)' cache 'backend' 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'.");
this.getType0_backend_ = backend__;
state_0 = state_0 | 0b1 /* add SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
GetType0_duplicateFound_ = true;
}
}
if (GetType0_duplicateFound_) {
return getType(arg0Value, this.getType0_backend_);
}
break;
}
}
{
NFIBackendLibrary backend__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
backend__ = (N_F_I_BACKEND_LIBRARY_.getUncached(arg0Value.backend));
this.getType0_backend_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[SignatureRootNode.GetSignatureTypeNode.getType(API, NFIBackendLibrary)] */;
this.state_0_ = state_0;
return getType(arg0Value, backend__);
} finally {
encapsulating_.set(prev_);
}
}
}
}
@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 GetSignatureTypeNode create(BuildSignatureNode buildSignature) {
return new GetSignatureTypeNodeGen(buildSignature);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy