
com.oracle.truffle.js.builtins.helper.IsPristineObjectNodeGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of js-language Show documentation
Show all versions of js-language Show documentation
Graal JavaScript implementation
The newest version!
// CheckStyle: start generated
package com.oracle.truffle.js.builtins.helper;
import com.oracle.truffle.api.Assumption;
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.dsl.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.js.runtime.builtins.JSClass;
import com.oracle.truffle.js.runtime.objects.JSDynamicObject;
import java.lang.invoke.MethodHandles;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link IsPristineObjectNode#doCached}
* Activation probability: 0.48333
* With/without class size: 12/5 bytes
* Specialization {@link IsPristineObjectNode#doDynamic}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link IsPristineObjectNode#doAssumptionsInvalid}
* Activation probability: 0.18333
* With/without class size: 6/0 bytes
*
*/
@GeneratedBy(IsPristineObjectNode.class)
@SuppressWarnings({"javadoc", "unused"})
public final class IsPristineObjectNodeGen extends IsPristineObjectNode {
static final ReferenceField CACHED_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "cached_cache", CachedData.class);
/**
* State Info:
* 0: SpecializationActive {@link IsPristineObjectNode#doCached}
* 1: SpecializationActive {@link IsPristineObjectNode#doDynamic}
* 2: SpecializationActive {@link IsPristineObjectNode#doAssumptionsInvalid}
*
*/
@CompilationFinal private int state_0_;
@UnsafeAccessedField @CompilationFinal private CachedData cached_cache;
@CompilationFinal(dimensions = 1) private Assumption[] dynamic_assumption0_;
private IsPristineObjectNodeGen(JSClass jsClass, Shape initialPrototypeShape, Object... propertyKeys) {
super(jsClass, initialPrototypeShape, propertyKeys);
}
@Override
public boolean execute(JSDynamicObject arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[IsPristineObjectNode.doCached(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsPristineObjectNode.doDynamic(JSDynamicObject)] || SpecializationActive[IsPristineObjectNode.doAssumptionsInvalid(JSDynamicObject)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsPristineObjectNode.doCached(JSDynamicObject, Shape, boolean)] */) {
CachedData s0_ = this.cached_cache;
if (s0_ != null) {
if (!Assumption.isValidAssumption(s0_.assumption0_)) {
CompilerDirectives.transferToInterpreterAndInvalidate();
removeCached_(s0_);
return executeAndSpecialize(arg0Value);
}
if ((s0_.cachedShape_.check(arg0Value))) {
return doCached(arg0Value, s0_.cachedShape_, s0_.isInstanceAndDoesNotOverwriteProps_);
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsPristineObjectNode.doDynamic(JSDynamicObject)] */) {
if (!Assumption.isValidAssumption(this.dynamic_assumption0_)) {
CompilerDirectives.transferToInterpreterAndInvalidate();
removeDynamic_();
return executeAndSpecialize(arg0Value);
}
return doDynamic(arg0Value);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[IsPristineObjectNode.doAssumptionsInvalid(JSDynamicObject)] */) {
return doAssumptionsInvalid(arg0Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
@SuppressWarnings("unused")
private boolean executeAndSpecialize(JSDynamicObject arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[IsPristineObjectNode.doDynamic(JSDynamicObject)] */) {
while (true) {
int count0_ = 0;
CachedData s0_ = CACHED_CACHE_UPDATER.getVolatile(this);
CachedData s0_original = s0_;
while (s0_ != null) {
if ((s0_.cachedShape_.check(arg0Value)) && Assumption.isValidAssumption(s0_.assumption0_)) {
break;
}
count0_++;
s0_ = null;
break;
}
if (s0_ == null && count0_ < 1) {
{
Shape cachedShape__ = (arg0Value.getShape());
if ((cachedShape__.check(arg0Value))) {
Assumption[] assumption0 = (getPropertyFinalAssumptions());
if (Assumption.isValidAssumption(assumption0)) {
s0_ = new CachedData();
Objects.requireNonNull(cachedShape__, "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.");
s0_.cachedShape_ = cachedShape__;
s0_.isInstanceAndDoesNotOverwriteProps_ = (isInstanceAndDoesNotOverwriteProps(cachedShape__));
s0_.assumption0_ = assumption0;
if (!CACHED_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[IsPristineObjectNode.doCached(JSDynamicObject, Shape, boolean)] */;
this.state_0_ = state_0;
}
}
}
}
if (s0_ != null) {
return doCached(arg0Value, s0_.cachedShape_, s0_.isInstanceAndDoesNotOverwriteProps_);
}
break;
}
}
{
Assumption[] dynamic_assumption0 = (getPropertyFinalAssumptions());
if (Assumption.isValidAssumption(dynamic_assumption0)) {
this.dynamic_assumption0_ = dynamic_assumption0;
this.cached_cache = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[IsPristineObjectNode.doCached(JSDynamicObject, Shape, boolean)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[IsPristineObjectNode.doDynamic(JSDynamicObject)] */;
this.state_0_ = state_0;
return doDynamic(arg0Value);
}
}
state_0 = state_0 | 0b100 /* add SpecializationActive[IsPristineObjectNode.doAssumptionsInvalid(JSDynamicObject)] */;
this.state_0_ = state_0;
return doAssumptionsInvalid(arg0Value);
}
void removeCached_(CachedData s0_) {
this.state_0_ = state_0_ & 0xfffffffe /* remove SpecializationActive[IsPristineObjectNode.doCached(JSDynamicObject, Shape, boolean)] */;
this.cached_cache = null;
}
void removeDynamic_() {
this.state_0_ = state_0_ & 0xfffffffd /* remove SpecializationActive[IsPristineObjectNode.doDynamic(JSDynamicObject)] */;
}
@NeverDefault
public static IsPristineObjectNode create(JSClass jsClass, Shape initialPrototypeShape, Object... propertyKeys) {
return new IsPristineObjectNodeGen(jsClass, initialPrototypeShape, propertyKeys);
}
@GeneratedBy(IsPristineObjectNode.class)
@DenyReplace
private static final class CachedData implements SpecializationDataNode {
/**
* Source Info:
* Specialization: {@link IsPristineObjectNode#doCached}
* Parameter: {@link Shape} cachedShape
*/
@CompilationFinal Shape cachedShape_;
/**
* Source Info:
* Specialization: {@link IsPristineObjectNode#doCached}
* Parameter: boolean isInstanceAndDoesNotOverwriteProps
*/
@CompilationFinal boolean isInstanceAndDoesNotOverwriteProps_;
@CompilationFinal(dimensions = 1) Assumption[] assumption0_;
CachedData() {
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy