com.oracle.truffle.nfi.CallSignatureNodeFactory Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.nfi;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GenerateAOT;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.interop.ArityException;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.interop.UnsupportedTypeException;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.memory.MemoryFence;
import com.oracle.truffle.api.nodes.EncapsulatingNodeReference;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.IndirectCallNode;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.nodes.NodeUtil;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.truffle.nfi.CallSignatureNode.CachedCallSignatureNode;
import com.oracle.truffle.nfi.CallSignatureNode.OptimizedCallClosureNode;
import com.oracle.truffle.nfi.CallSignatureNode.OptimizedCallSignatureNode;
import com.oracle.truffle.nfi.ConvertTypeNode.ConvertFromNativeNode;
import com.oracle.truffle.nfi.ConvertTypeNode.ConvertToNativeNode;
import com.oracle.truffle.nfi.ConvertTypeNodeFactory.ConvertFromNativeNodeGen;
import com.oracle.truffle.nfi.ConvertTypeNodeFactory.ConvertToNativeNodeGen;
import com.oracle.truffle.nfi.NFISignature.ArgsCachedState;
import com.oracle.truffle.nfi.NFISignature.SignatureCachedState;
import com.oracle.truffle.nfi.NFIType.TypeCachedState;
import com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureLibrary;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@GeneratedBy(CallSignatureNode.class)
@SuppressWarnings("unused")
final class CallSignatureNodeFactory {
private static final LibraryFactory N_F_I_BACKEND_SIGNATURE_LIBRARY_ = LibraryFactory.resolve(NFIBackendSignatureLibrary.class);
private static final LibraryFactory INTEROP_LIBRARY_ = LibraryFactory.resolve(InteropLibrary.class);
@GeneratedBy(CachedCallSignatureNode.class)
static final class CachedCallSignatureNodeGen extends CachedCallSignatureNode implements GenerateAOT.Provider {
private static final Uncached UNCACHED = new Uncached();
@CompilationFinal private volatile int state_0_;
@CompilationFinal private volatile int exclude_;
@Child private OptimizedDirectData optimizedDirect_cache;
@Child private IndirectCallNode optimizedIndirect_call_;
@Child private SlowPathData slowPath_cache;
private CachedCallSignatureNodeGen() {
}
@ExplodeLoop
@Override
Object execute(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
int state_0 = this.state_0_;
if (CompilerDirectives.inInterpreter() && (state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
if ((state_0 & 0b1110) != 0 /* is-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) || doOptimizedIndirect(NFISignature, Object, Object[], IndirectCallNode) || doSlowPath(NFISignature, Object, Object[], BranchProfile, ConvertToNativeNode, ConvertFromNativeNode, NFIBackendSignatureLibrary) */) {
if ((state_0 & 0b10) != 0 /* is-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */) {
OptimizedDirectData s0_ = this.optimizedDirect_cache;
while (s0_ != null) {
assert (s0_.cachedState_ != null);
if ((arg0Value.cachedState == s0_.cachedState_)) {
return doOptimizedDirect(arg0Value, arg1Value, arg2Value, s0_.cachedState_, s0_.call_);
}
s0_ = s0_.next_;
}
}
if ((state_0 & 0b100) != 0 /* is-state_0 doOptimizedIndirect(NFISignature, Object, Object[], IndirectCallNode) */) {
if ((arg0Value.cachedState != null)) {
return doOptimizedIndirect(arg0Value, arg1Value, arg2Value, this.optimizedIndirect_call_);
}
}
if ((state_0 & 0b1000) != 0 /* is-state_0 doSlowPath(NFISignature, Object, Object[], BranchProfile, ConvertToNativeNode, ConvertFromNativeNode, NFIBackendSignatureLibrary) */) {
SlowPathData s2_ = this.slowPath_cache;
if (s2_ != null) {
if ((arg0Value.cachedState == null)) {
return doSlowPath(arg0Value, arg1Value, arg2Value, s2_.exception_, s2_.convertArg_, s2_.convertRet_, s2_.nativeLibrary_);
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private Object executeAndSpecialize(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
try {
if ((this.state_0_ & 0b1) != 0 /* is-state_0 AOT-prepared */) {
this.resetAOT_();
}
int state_0 = this.state_0_;
int exclude = this.exclude_;
if ((exclude) == 0 /* is-not-exclude doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */) {
int count0_ = 0;
OptimizedDirectData s0_ = this.optimizedDirect_cache;
if ((state_0 & 0b10) != 0 /* is-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */) {
while (s0_ != null) {
assert (s0_.cachedState_ != null);
if ((arg0Value.cachedState == s0_.cachedState_)) {
break;
}
s0_ = s0_.next_;
count0_++;
}
}
if (s0_ == null) {
{
SignatureCachedState cachedState__ = (arg0Value.cachedState);
if ((cachedState__ != null)) {
// assert (arg0Value.cachedState == cachedState__);
if (count0_ < (3)) {
s0_ = super.insert(new OptimizedDirectData(optimizedDirect_cache));
s0_.cachedState_ = cachedState__;
s0_.call_ = s0_.insertAccessor((cachedState__.createOptimizedSignatureCall()));
MemoryFence.storeStore();
this.optimizedDirect_cache = s0_;
this.state_0_ = state_0 = state_0 | 0b10 /* add-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */;
}
}
}
}
if (s0_ != null) {
lock.unlock();
hasLock = false;
return doOptimizedDirect(arg0Value, arg1Value, arg2Value, s0_.cachedState_, s0_.call_);
}
}
if ((arg0Value.cachedState != null)) {
this.optimizedIndirect_call_ = super.insert((IndirectCallNode.create()));
this.exclude_ = exclude = exclude | 0b1 /* add-exclude doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */;
this.optimizedDirect_cache = null;
state_0 = state_0 & 0xfffffffd /* remove-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */;
this.state_0_ = state_0 = state_0 | 0b100 /* add-state_0 doOptimizedIndirect(NFISignature, Object, Object[], IndirectCallNode) */;
lock.unlock();
hasLock = false;
return doOptimizedIndirect(arg0Value, arg1Value, arg2Value, this.optimizedIndirect_call_);
}
if ((arg0Value.cachedState == null)) {
SlowPathData s2_ = super.insert(new SlowPathData());
s2_.exception_ = (BranchProfile.create());
s2_.convertArg_ = s2_.insertAccessor((ConvertToNativeNodeGen.create()));
s2_.convertRet_ = s2_.insertAccessor((ConvertFromNativeNodeGen.create()));
s2_.nativeLibrary_ = s2_.insertAccessor((N_F_I_BACKEND_SIGNATURE_LIBRARY_.createDispatched(3)));
MemoryFence.storeStore();
this.slowPath_cache = s2_;
this.state_0_ = state_0 = state_0 | 0b1000 /* add-state_0 doSlowPath(NFISignature, Object, Object[], BranchProfile, ConvertToNativeNode, ConvertFromNativeNode, NFIBackendSignatureLibrary) */;
lock.unlock();
hasLock = false;
return doSlowPath(arg0Value, arg1Value, arg2Value, s2_.exception_, s2_.convertArg_, s2_.convertRet_, s2_.nativeLibrary_);
}
throw new UnsupportedSpecializationException(this, new Node[] {null, null, null}, arg0Value, arg1Value, arg2Value);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if ((state_0 & 0b1110) == 0) {
return NodeCost.UNINITIALIZED;
} else {
if (((state_0 & 0b1110) & ((state_0 & 0b1110) - 1)) == 0 /* is-single-state_0 */) {
OptimizedDirectData s0_ = this.optimizedDirect_cache;
if ((s0_ == null || s0_.next_ == null)) {
return NodeCost.MONOMORPHIC;
}
}
}
return NodeCost.POLYMORPHIC;
}
@Override
public void prepareForAOT(TruffleLanguage> language, RootNode root) {
assert !isAdoptable() || ((ReentrantLock) getLock()).isHeldByCurrentThread() : "During prepare AST lock must be held.";
int state_0 = this.state_0_;
if ((state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return;
}
this.optimizedIndirect_call_ = super.insert((IndirectCallNode.create()));
this.exclude_ = this.exclude_ | 0b1 /* add-exclude doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */;
this.optimizedDirect_cache = null;
state_0 = state_0 & 0xfffffffd /* remove-state_0 doOptimizedDirect(NFISignature, Object, Object[], SignatureCachedState, CallSignatureNode) */;
SlowPathData s2_ = super.insert(new SlowPathData());
s2_.exception_ = (BranchProfile.create());
s2_.convertArg_ = s2_.insertAccessor((ConvertToNativeNodeGen.create()));
s2_.convertRet_ = s2_.insertAccessor((ConvertFromNativeNodeGen.create()));
s2_.nativeLibrary_ = s2_.insertAccessor((N_F_I_BACKEND_SIGNATURE_LIBRARY_.createDispatched(3)));
s2_.exception_.disable();
MemoryFence.storeStore();
this.slowPath_cache = s2_;
assert NodeUtil.assertRecursion(s2_.convertArg_, 1);
((GenerateAOT.Provider) s2_.convertArg_).prepareForAOT(language, root);
assert NodeUtil.assertRecursion(s2_.convertRet_, 1);
((GenerateAOT.Provider) s2_.convertRet_).prepareForAOT(language, root);
if (s2_.nativeLibrary_ instanceof GenerateAOT.Provider) {
assert NodeUtil.assertRecursion(s2_.nativeLibrary_, 1);
((GenerateAOT.Provider) s2_.nativeLibrary_).prepareForAOT(language, root);
}
this.state_0_ = state_0 = state_0 | 0b1101 /* add-state_0 AOT-prepared, doOptimizedIndirect(NFISignature, Object, Object[], IndirectCallNode), doSlowPath(NFISignature, Object, Object[], BranchProfile, ConvertToNativeNode, ConvertFromNativeNode, NFIBackendSignatureLibrary) */;
}
private void resetAOT_() {
int state_0 = this.state_0_;
if (((state_0 & 0b1)) == 0 /* is-not-state_0 AOT-prepared */) {
return;
}
if ((state_0 & 0b1000) != 0 /* is-state_0 doSlowPath(NFISignature, Object, Object[], BranchProfile, ConvertToNativeNode, ConvertFromNativeNode, NFIBackendSignatureLibrary) */) {
this.slowPath_cache.exception_.reset();
}
this.state_0_ = 0;
this.exclude_ = 0;
this.slowPath_cache = null;
}
public static CachedCallSignatureNode create() {
return new CachedCallSignatureNodeGen();
}
public static CachedCallSignatureNode getUncached() {
return CachedCallSignatureNodeGen.UNCACHED;
}
@GeneratedBy(CachedCallSignatureNode.class)
private static final class OptimizedDirectData extends Node {
@Child OptimizedDirectData next_;
@CompilationFinal SignatureCachedState cachedState_;
@Child CallSignatureNode call_;
OptimizedDirectData(OptimizedDirectData next_) {
this.next_ = next_;
}
@Override
public NodeCost getCost() {
return NodeCost.NONE;
}
T insertAccessor(T node) {
return super.insert(node);
}
}
@GeneratedBy(CachedCallSignatureNode.class)
private static final class SlowPathData extends Node {
@CompilationFinal BranchProfile exception_;
@Child ConvertToNativeNode convertArg_;
@Child ConvertFromNativeNode convertRet_;
@Child NFIBackendSignatureLibrary nativeLibrary_;
SlowPathData() {
}
@Override
public NodeCost getCost() {
return NodeCost.NONE;
}
T insertAccessor(T node) {
return super.insert(node);
}
}
@GeneratedBy(CachedCallSignatureNode.class)
private static final class Uncached extends CachedCallSignatureNode {
@TruffleBoundary
@Override
Object execute(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
if ((arg0Value.cachedState != null)) {
return doOptimizedIndirect(arg0Value, arg1Value, arg2Value, (IndirectCallNode.getUncached()));
}
if ((arg0Value.cachedState == null)) {
return doSlowPath(arg0Value, arg1Value, arg2Value, (BranchProfile.getUncached()), (ConvertToNativeNodeGen.getUncached()), (ConvertFromNativeNodeGen.getUncached()), (N_F_I_BACKEND_SIGNATURE_LIBRARY_.getUncached()));
}
throw new UnsupportedSpecializationException(this, new Node[] {null, null, null}, arg0Value, arg1Value, arg2Value);
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
@GeneratedBy(OptimizedCallSignatureNode.class)
static final class OptimizedCallSignatureNodeGen extends OptimizedCallSignatureNode implements GenerateAOT.Provider {
@CompilationFinal private volatile int state_0_;
@CompilationFinal private BranchProfile exception_;
@Child private NFIBackendSignatureLibrary backendLibrary_;
private OptimizedCallSignatureNodeGen(TypeCachedState retType, ArgsCachedState argsState) {
super(retType, argsState);
}
@Override
Object execute(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
int state_0 = this.state_0_;
if (CompilerDirectives.inInterpreter() && (state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
if ((state_0 & 0b10) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, NFIBackendSignatureLibrary) */) {
return doCall(arg0Value, arg1Value, arg2Value, this.exception_, this.backendLibrary_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private Object executeAndSpecialize(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
try {
if ((this.state_0_ & 0b1) != 0 /* is-state_0 AOT-prepared */) {
this.resetAOT_();
}
int state_0 = this.state_0_;
this.exception_ = (BranchProfile.create());
this.backendLibrary_ = super.insert((N_F_I_BACKEND_SIGNATURE_LIBRARY_.createDispatched(1)));
this.state_0_ = state_0 = state_0 | 0b10 /* add-state_0 doCall(NFISignature, Object, Object[], BranchProfile, NFIBackendSignatureLibrary) */;
lock.unlock();
hasLock = false;
return doCall(arg0Value, arg1Value, arg2Value, this.exception_, this.backendLibrary_);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if ((state_0 & 0b10) == 0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
@Override
public void prepareForAOT(TruffleLanguage> language, RootNode root) {
assert !isAdoptable() || ((ReentrantLock) getLock()).isHeldByCurrentThread() : "During prepare AST lock must be held.";
int state_0 = this.state_0_;
if ((state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return;
}
this.exception_ = (BranchProfile.create());
this.backendLibrary_ = super.insert((N_F_I_BACKEND_SIGNATURE_LIBRARY_.createDispatched(1)));
this.exception_.disable();
if (this.backendLibrary_ instanceof GenerateAOT.Provider) {
assert NodeUtil.assertRecursion(this.backendLibrary_, 1);
((GenerateAOT.Provider) this.backendLibrary_).prepareForAOT(language, root);
}
this.state_0_ = state_0 = state_0 | 0b11 /* add-state_0 AOT-prepared, doCall(NFISignature, Object, Object[], BranchProfile, NFIBackendSignatureLibrary) */;
}
private void resetAOT_() {
int state_0 = this.state_0_;
if (((state_0 & 0b1)) == 0 /* is-not-state_0 AOT-prepared */) {
return;
}
if ((state_0 & 0b10) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, NFIBackendSignatureLibrary) */) {
this.exception_.reset();
}
this.state_0_ = 0;
this.backendLibrary_ = null;
}
public static OptimizedCallSignatureNode create(TypeCachedState retType, ArgsCachedState argsState) {
return new OptimizedCallSignatureNodeGen(retType, argsState);
}
}
@GeneratedBy(OptimizedCallClosureNode.class)
static final class OptimizedCallClosureNodeGen extends OptimizedCallClosureNode implements GenerateAOT.Provider {
@CompilationFinal private volatile int state_0_;
@CompilationFinal private volatile int exclude_;
@CompilationFinal private BranchProfile call0_exception_;
@Child private InteropLibrary call0_interop_;
@CompilationFinal private BranchProfile call1_exception_;
private OptimizedCallClosureNodeGen(TypeCachedState retType, ArgsCachedState argsState) {
super(retType, argsState);
}
@Override
Object execute(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
int state_0 = this.state_0_;
if (CompilerDirectives.inInterpreter() && (state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
if ((state_0 & 0b110) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) || doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
if ((state_0 & 0b10) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
if ((this.call0_interop_.accepts(arg1Value))) {
return doCall(arg0Value, arg1Value, arg2Value, this.call0_exception_, this.call0_interop_);
}
}
if ((state_0 & 0b100) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
return this.call1Boundary(state_0, arg0Value, arg1Value, arg2Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
@SuppressWarnings("static-method")
@TruffleBoundary
private Object call1Boundary(int state_0, NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
{
InteropLibrary call1_interop__ = (INTEROP_LIBRARY_.getUncached(arg1Value));
return doCall(arg0Value, arg1Value, arg2Value, this.call1_exception_, call1_interop__);
}
} finally {
encapsulating_.set(prev_);
}
}
private Object executeAndSpecialize(NFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
try {
if ((this.state_0_ & 0b1) != 0 /* is-state_0 AOT-prepared */) {
this.resetAOT_();
}
int state_0 = this.state_0_;
int exclude = this.exclude_;
if ((exclude) == 0 /* is-not-exclude doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
boolean Call0_duplicateFound_ = false;
if ((state_0 & 0b10) != 0 /* is-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
if ((this.call0_interop_.accepts(arg1Value))) {
Call0_duplicateFound_ = true;
}
}
if (!Call0_duplicateFound_) {
// assert (this.call0_interop_.accepts(arg1Value));
if (((state_0 & 0b10)) == 0 /* is-not-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */) {
this.call0_exception_ = (BranchProfile.create());
this.call0_interop_ = super.insert((INTEROP_LIBRARY_.create(arg1Value)));
this.state_0_ = state_0 = state_0 | 0b10 /* add-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */;
Call0_duplicateFound_ = true;
}
}
if (Call0_duplicateFound_) {
lock.unlock();
hasLock = false;
return doCall(arg0Value, arg1Value, arg2Value, this.call0_exception_, this.call0_interop_);
}
}
{
InteropLibrary call1_interop__ = null;
{
EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
Node prev_ = encapsulating_.set(this);
try {
this.call1_exception_ = (BranchProfile.create());
call1_interop__ = (INTEROP_LIBRARY_.getUncached(arg1Value));
this.exclude_ = exclude = exclude | 0b1 /* add-exclude doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */;
state_0 = state_0 & 0xfffffffd /* remove-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */;
this.state_0_ = state_0 = state_0 | 0b100 /* add-state_0 doCall(NFISignature, Object, Object[], BranchProfile, InteropLibrary) */;
lock.unlock();
hasLock = false;
return doCall(arg0Value, arg1Value, arg2Value, this.call1_exception_, call1_interop__);
} finally {
encapsulating_.set(prev_);
}
}
}
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if ((state_0 & 0b110) == 0) {
return NodeCost.UNINITIALIZED;
} else {
if (((state_0 & 0b110) & ((state_0 & 0b110) - 1)) == 0 /* is-single-state_0 */) {
return NodeCost.MONOMORPHIC;
}
}
return NodeCost.POLYMORPHIC;
}
@Override
public void prepareForAOT(TruffleLanguage> language, RootNode root) {
assert !isAdoptable() || ((ReentrantLock) getLock()).isHeldByCurrentThread() : "During prepare AST lock must be held.";
int state_0 = this.state_0_;
if ((state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
return;
}
this.state_0_ = state_0 = state_0 | 0b1 /* add-state_0 AOT-prepared */;
}
private void resetAOT_() {
int state_0 = this.state_0_;
if (((state_0 & 0b1)) == 0 /* is-not-state_0 AOT-prepared */) {
return;
}
this.state_0_ = 0;
this.exclude_ = 0;
}
public static OptimizedCallClosureNode create(TypeCachedState retType, ArgsCachedState argsState) {
return new OptimizedCallClosureNodeGen(retType, argsState);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy