com.oracle.truffle.js.nodes.access.DeclareGlobalFunctionNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.access;
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.strings.TruffleString;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.builtins.JSGlobalObject;
import com.oracle.truffle.js.runtime.objects.JSDynamicObject;
import com.oracle.truffle.js.runtime.objects.PropertyDescriptor;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link DeclareGlobalFunctionNode#doCached}
* Activation probability: 0.48333
* With/without class size: 13/4 bytes
* Specialization {@link DeclareGlobalFunctionNode#doUncached}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link DeclareGlobalFunctionNode#doGeneric}
* Activation probability: 0.18333
* With/without class size: 6/0 bytes
*
*/
@GeneratedBy(DeclareGlobalFunctionNode.class)
@SuppressWarnings({"javadoc", "unused"})
public final class DeclareGlobalFunctionNodeGen extends DeclareGlobalFunctionNode {
/**
* State Info:
* 0: SpecializationActive {@link DeclareGlobalFunctionNode#doCached}
* 1: SpecializationActive {@link DeclareGlobalFunctionNode#doUncached}
* 2: SpecializationActive {@link DeclareGlobalFunctionNode#doGeneric}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link DeclareGlobalFunctionNode#doCached}
* Parameter: {@link PropertySetNode} cache
*/
@Child private PropertySetNode cached_cache_;
private DeclareGlobalFunctionNodeGen(TruffleString varName, boolean configurable) {
super(varName, configurable);
}
@SuppressWarnings("static-method")
private boolean fallbackGuard_(int state_0, JSDynamicObject arg0Value, Object arg1Value, PropertyDescriptor arg2Value, JSContext arg3Value) {
if (!((state_0 & 0b10) != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] */) && arg0Value instanceof JSGlobalObject) {
return false;
}
return true;
}
@Override
protected void executeVoid(JSDynamicObject arg0Value, Object arg1Value, PropertyDescriptor arg2Value, JSContext arg3Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doCached(JSGlobalObject, Object, PropertyDescriptor, JSContext, PropertySetNode)] || SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] || SpecializationActive[DeclareGlobalFunctionNode.doGeneric(JSDynamicObject, Object, PropertyDescriptor, JSContext)] */) {
if ((state_0 & 0b11) != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doCached(JSGlobalObject, Object, PropertyDescriptor, JSContext, PropertySetNode)] || SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] */ && arg0Value instanceof JSGlobalObject) {
JSGlobalObject arg0Value_ = (JSGlobalObject) arg0Value;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doCached(JSGlobalObject, Object, PropertyDescriptor, JSContext, PropertySetNode)] */) {
{
PropertySetNode cache__ = this.cached_cache_;
if (cache__ != null) {
if ((arg3Value.getPropertyCacheLimit() > 0) && (arg2Value == null)) {
doCached(arg0Value_, arg1Value, arg2Value, arg3Value, cache__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] */) {
doUncached(arg0Value_, arg1Value, arg2Value, arg3Value);
return;
}
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[DeclareGlobalFunctionNode.doGeneric(JSDynamicObject, Object, PropertyDescriptor, JSContext)] */) {
if (fallbackGuard_(state_0, arg0Value, arg1Value, arg2Value, arg3Value)) {
doGeneric(arg0Value, arg1Value, arg2Value, arg3Value);
return;
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value);
return;
}
private void executeAndSpecialize(JSDynamicObject arg0Value, Object arg1Value, PropertyDescriptor arg2Value, JSContext arg3Value) {
int state_0 = this.state_0_;
if (arg0Value instanceof JSGlobalObject) {
JSGlobalObject arg0Value_ = (JSGlobalObject) arg0Value;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] */) {
if ((arg3Value.getPropertyCacheLimit() > 0) && (arg2Value == null)) {
PropertySetNode cache__ = this.insert((makeDefineOwnPropertyCache(arg3Value)));
Objects.requireNonNull(cache__, "A specialization cache returned a 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 the default value.");
VarHandle.storeStoreFence();
this.cached_cache_ = cache__;
state_0 = state_0 | 0b1 /* add SpecializationActive[DeclareGlobalFunctionNode.doCached(JSGlobalObject, Object, PropertyDescriptor, JSContext, PropertySetNode)] */;
this.state_0_ = state_0;
doCached(arg0Value_, arg1Value, arg2Value, arg3Value, cache__);
return;
}
}
this.cached_cache_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[DeclareGlobalFunctionNode.doCached(JSGlobalObject, Object, PropertyDescriptor, JSContext, PropertySetNode)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[DeclareGlobalFunctionNode.doUncached(JSGlobalObject, Object, PropertyDescriptor, JSContext)] */;
this.state_0_ = state_0;
doUncached(arg0Value_, arg1Value, arg2Value, arg3Value);
return;
}
state_0 = state_0 | 0b100 /* add SpecializationActive[DeclareGlobalFunctionNode.doGeneric(JSDynamicObject, Object, PropertyDescriptor, JSContext)] */;
this.state_0_ = state_0;
doGeneric(arg0Value, arg1Value, arg2Value, arg3Value);
return;
}
@NeverDefault
public static DeclareGlobalFunctionNode create(TruffleString varName, boolean configurable) {
return new DeclareGlobalFunctionNodeGen(varName, configurable);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy