com.oracle.truffle.js.nodes.array.JSArrayDeleteIndexNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.array;
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.nodes.ExplodeLoop;
import com.oracle.truffle.js.runtime.array.ScriptArray;
import com.oracle.truffle.js.runtime.objects.JSDynamicObject;
import java.lang.invoke.MethodHandles;
/**
* Debug Info:
* Specialization {@link JSArrayDeleteIndexNode#doCached}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link JSArrayDeleteIndexNode#doUncached}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(JSArrayDeleteIndexNode.class)
@SuppressWarnings("javadoc")
public final class JSArrayDeleteIndexNodeGen extends JSArrayDeleteIndexNode {
static final ReferenceField CACHED_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "cached_cache", CachedData.class);
/**
* State Info:
* 0: SpecializationActive {@link JSArrayDeleteIndexNode#doCached}
* 1: SpecializationActive {@link JSArrayDeleteIndexNode#doUncached}
*
*/
@CompilationFinal private int state_0_;
@UnsafeAccessedField @CompilationFinal private CachedData cached_cache;
private JSArrayDeleteIndexNodeGen(boolean strict) {
super(strict);
}
@ExplodeLoop
@Override
public boolean execute(JSDynamicObject arg0Value, ScriptArray arg1Value, long arg2Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[JSArrayDeleteIndexNode.doCached(JSDynamicObject, ScriptArray, long, ScriptArray)] || SpecializationActive[JSArrayDeleteIndexNode.doUncached(JSDynamicObject, ScriptArray, long)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSArrayDeleteIndexNode.doCached(JSDynamicObject, ScriptArray, long, ScriptArray)] */) {
CachedData s0_ = this.cached_cache;
while (s0_ != null) {
if ((s0_.cachedArrayType_.isInstance(arg1Value))) {
return doCached(arg0Value, arg1Value, arg2Value, s0_.cachedArrayType_);
}
s0_ = s0_.next_;
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSArrayDeleteIndexNode.doUncached(JSDynamicObject, ScriptArray, long)] */) {
return doUncached(arg0Value, arg1Value, arg2Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private boolean executeAndSpecialize(JSDynamicObject arg0Value, ScriptArray arg1Value, long arg2Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[JSArrayDeleteIndexNode.doUncached(JSDynamicObject, ScriptArray, long)] */) {
while (true) {
int count0_ = 0;
CachedData s0_ = CACHED_CACHE_UPDATER.getVolatile(this);
CachedData s0_original = s0_;
while (s0_ != null) {
if ((s0_.cachedArrayType_.isInstance(arg1Value))) {
break;
}
count0_++;
s0_ = s0_.next_;
}
if (s0_ == null) {
{
ScriptArray cachedArrayType__ = (arg1Value);
if ((cachedArrayType__.isInstance(arg1Value)) && count0_ < (5)) {
s0_ = new CachedData(s0_original);
s0_.cachedArrayType_ = cachedArrayType__;
if (!CACHED_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[JSArrayDeleteIndexNode.doCached(JSDynamicObject, ScriptArray, long, ScriptArray)] */;
this.state_0_ = state_0;
}
}
}
if (s0_ != null) {
return doCached(arg0Value, arg1Value, arg2Value, s0_.cachedArrayType_);
}
break;
}
}
this.cached_cache = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[JSArrayDeleteIndexNode.doCached(JSDynamicObject, ScriptArray, long, ScriptArray)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSArrayDeleteIndexNode.doUncached(JSDynamicObject, ScriptArray, long)] */;
this.state_0_ = state_0;
return doUncached(arg0Value, arg1Value, arg2Value);
}
@NeverDefault
public static JSArrayDeleteIndexNode create(boolean strict) {
return new JSArrayDeleteIndexNodeGen(strict);
}
@GeneratedBy(JSArrayDeleteIndexNode.class)
@DenyReplace
private static final class CachedData implements SpecializationDataNode {
@CompilationFinal final CachedData next_;
/**
* Source Info:
* Specialization: {@link JSArrayDeleteIndexNode#doCached}
* Parameter: {@link ScriptArray} cachedArrayType
*/
@CompilationFinal ScriptArray cachedArrayType_;
CachedData(CachedData next_) {
this.next_ = next_;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy