com.oracle.truffle.js.nodes.array.JSArrayGetOwnPropertyNodeGen 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.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import com.oracle.truffle.js.runtime.array.ScriptArray;
import com.oracle.truffle.js.runtime.builtins.JSAbstractArray;
import com.oracle.truffle.js.runtime.builtins.JSArrayObject;
import com.oracle.truffle.js.runtime.objects.PropertyDescriptor;
/**
* Debug Info:
* Specialization {@link JSArrayGetOwnPropertyNode#doCached}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link JSArrayGetOwnPropertyNode#doUncached}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(JSArrayGetOwnPropertyNode.class)
@SuppressWarnings("javadoc")
public final class JSArrayGetOwnPropertyNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#cached_cache}
*
*/
@NeverDefault
public static JSArrayGetOwnPropertyNode inline(@RequiredField(bits = 2, value = StateField.class)@RequiredField(type = Object.class, value = ReferenceField.class) InlineTarget target) {
return new JSArrayGetOwnPropertyNodeGen.Inlined(target);
}
@GeneratedBy(JSArrayGetOwnPropertyNode.class)
@DenyReplace
private static final class Inlined extends JSArrayGetOwnPropertyNode implements UnadoptableNode {
/**
* State Info:
* 0: SpecializationActive {@link JSArrayGetOwnPropertyNode#doCached}
* 1: SpecializationActive {@link JSArrayGetOwnPropertyNode#doUncached}
*
*/
private final StateField state_0_;
private final ReferenceField cached_cache;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(JSArrayGetOwnPropertyNode.class);
this.state_0_ = target.getState(0, 2);
this.cached_cache = target.getReference(1, CachedData.class);
}
@ExplodeLoop
@Override
public PropertyDescriptor execute(Node arg0Value, JSArrayObject arg1Value, long arg2Value, boolean arg3Value, boolean arg4Value, boolean arg5Value, boolean arg6Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[JSArrayGetOwnPropertyNode.doCached(JSArrayObject, long, boolean, boolean, boolean, boolean, ScriptArray)] || SpecializationActive[JSArrayGetOwnPropertyNode.doUncached(JSArrayObject, long, boolean, boolean, boolean, boolean)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSArrayGetOwnPropertyNode.doCached(JSArrayObject, long, boolean, boolean, boolean, boolean, ScriptArray)] */) {
CachedData s0_ = this.cached_cache.get(arg0Value);
while (s0_ != null) {
if ((s0_.arrayType_.isInstance(JSAbstractArray.arrayGetArrayType(arg1Value)))) {
return JSArrayGetOwnPropertyNode.doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, s0_.arrayType_);
}
s0_ = s0_.next_;
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSArrayGetOwnPropertyNode.doUncached(JSArrayObject, long, boolean, boolean, boolean, boolean)] */) {
return JSArrayGetOwnPropertyNode.doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value);
}
private PropertyDescriptor executeAndSpecialize(Node arg0Value, JSArrayObject arg1Value, long arg2Value, boolean arg3Value, boolean arg4Value, boolean arg5Value, boolean arg6Value) {
int state_0 = this.state_0_.get(arg0Value);
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[JSArrayGetOwnPropertyNode.doUncached(JSArrayObject, long, boolean, boolean, boolean, boolean)] */) {
while (true) {
int count0_ = 0;
CachedData s0_ = this.cached_cache.getVolatile(arg0Value);
CachedData s0_original = s0_;
while (s0_ != null) {
if ((s0_.arrayType_.isInstance(JSAbstractArray.arrayGetArrayType(arg1Value)))) {
break;
}
count0_++;
s0_ = s0_.next_;
}
if (s0_ == null) {
{
ScriptArray arrayType__ = (JSAbstractArray.arrayGetArrayType(arg1Value));
if ((arrayType__.isInstance(JSAbstractArray.arrayGetArrayType(arg1Value))) && count0_ < (JSArrayGetOwnPropertyNode.MAX_TYPE_COUNT)) {
s0_ = new CachedData(s0_original);
s0_.arrayType_ = arrayType__;
if (!this.cached_cache.compareAndSet(arg0Value, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[JSArrayGetOwnPropertyNode.doCached(JSArrayObject, long, boolean, boolean, boolean, boolean, ScriptArray)] */;
this.state_0_.set(arg0Value, state_0);
}
}
}
if (s0_ != null) {
return JSArrayGetOwnPropertyNode.doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, s0_.arrayType_);
}
break;
}
}
this.cached_cache.set(arg0Value, null);
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[JSArrayGetOwnPropertyNode.doCached(JSArrayObject, long, boolean, boolean, boolean, boolean, ScriptArray)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSArrayGetOwnPropertyNode.doUncached(JSArrayObject, long, boolean, boolean, boolean, boolean)] */;
this.state_0_.set(arg0Value, state_0);
return JSArrayGetOwnPropertyNode.doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value);
}
}
@GeneratedBy(JSArrayGetOwnPropertyNode.class)
@DenyReplace
private static final class CachedData implements SpecializationDataNode {
@CompilationFinal final CachedData next_;
/**
* Source Info:
* Specialization: {@link JSArrayGetOwnPropertyNode#doCached}
* Parameter: {@link ScriptArray} arrayType
*/
@CompilationFinal ScriptArray arrayType_;
CachedData(CachedData next_) {
this.next_ = next_;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy