com.oracle.truffle.js.nodes.access.CreateDataPropertyNodeGen 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.DSLSupport;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link CreateDataPropertyNode#doCached}
* Activation probability: 0.48333
* With/without class size: 13/4 bytes
* Specialization {@link CreateDataPropertyNode#doUncached}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link CreateDataPropertyNode#doNonObject}
* Activation probability: 0.18333
* With/without class size: 6/0 bytes
*
*/
@GeneratedBy(CreateDataPropertyNode.class)
@SuppressWarnings("javadoc")
public final class CreateDataPropertyNodeGen extends CreateDataPropertyNode {
/**
* State Info:
* 0: SpecializationActive {@link CreateDataPropertyNode#doCached}
* 1: SpecializationActive {@link CreateDataPropertyNode#doUncached}
* 2: SpecializationActive {@link CreateDataPropertyNode#doNonObject}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link CreateDataPropertyNode#doCached}
* Parameter: {@link PropertySetNode} propertyCache
*/
@Child private PropertySetNode cached_propertyCache_;
private CreateDataPropertyNodeGen(JSContext context, Object key, boolean enumerable) {
super(context, key, enumerable);
}
@Override
public void executeVoid(Object arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[CreateDataPropertyNode.doCached(Object, Object, PropertySetNode)] || SpecializationActive[CreateDataPropertyNode.doUncached(JSObject, Object)] || SpecializationActive[CreateDataPropertyNode.doNonObject(Object, Object)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[CreateDataPropertyNode.doCached(Object, Object, PropertySetNode)] */) {
{
PropertySetNode propertyCache__ = this.cached_propertyCache_;
if (propertyCache__ != null) {
assert DSLSupport.assertIdempotence((context.getPropertyCacheLimit() > 0));
if ((isObject.executeBoolean(arg0Value))) {
CreateDataPropertyNode.doCached(arg0Value, arg1Value, propertyCache__);
return;
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[CreateDataPropertyNode.doUncached(JSObject, Object)] */ && arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
assert DSLSupport.assertIdempotence((context.getPropertyCacheLimit() == 0));
doUncached(arg0Value_, arg1Value);
return;
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[CreateDataPropertyNode.doNonObject(Object, Object)] */) {
if ((!(JSGuards.isJSObject(arg0Value)))) {
doNonObject(arg0Value, arg1Value);
return;
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
executeAndSpecialize(arg0Value, arg1Value);
return;
}
private void executeAndSpecialize(Object arg0Value, Object arg1Value) {
int state_0 = this.state_0_;
if ((context.getPropertyCacheLimit() > 0) && (isObject.executeBoolean(arg0Value))) {
PropertySetNode propertyCache__ = this.insert((makeDefinePropertyCache()));
Objects.requireNonNull(propertyCache__, "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_propertyCache_ = propertyCache__;
state_0 = state_0 | 0b1 /* add SpecializationActive[CreateDataPropertyNode.doCached(Object, Object, PropertySetNode)] */;
this.state_0_ = state_0;
CreateDataPropertyNode.doCached(arg0Value, arg1Value, propertyCache__);
return;
}
if (arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
if ((context.getPropertyCacheLimit() == 0)) {
state_0 = state_0 | 0b10 /* add SpecializationActive[CreateDataPropertyNode.doUncached(JSObject, Object)] */;
this.state_0_ = state_0;
doUncached(arg0Value_, arg1Value);
return;
}
}
if ((!(JSGuards.isJSObject(arg0Value)))) {
state_0 = state_0 | 0b100 /* add SpecializationActive[CreateDataPropertyNode.doNonObject(Object, Object)] */;
this.state_0_ = state_0;
doNonObject(arg0Value, arg1Value);
return;
}
throw new UnsupportedSpecializationException(this, null, arg0Value, arg1Value);
}
@NeverDefault
public static CreateDataPropertyNode create(JSContext context, Object key, boolean enumerable) {
return new CreateDataPropertyNodeGen(context, key, enumerable);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy