com.oracle.truffle.js.nodes.access.IsJSDynamicObjectNodeGen 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.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.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
import com.oracle.truffle.js.nodes.JSGuards;
import java.lang.invoke.MethodHandles;
/**
* Debug Info:
* Specialization {@link IsJSDynamicObjectNode#isObjectCached}
* Activation probability: 0.65000
* With/without class size: 15/5 bytes
* Specialization {@link IsJSDynamicObjectNode#isObject}
* Activation probability: 0.35000
* With/without class size: 11/1 bytes
*
*/
@GeneratedBy(IsJSDynamicObjectNode.class)
@SuppressWarnings("javadoc")
public final class IsJSDynamicObjectNodeGen extends IsJSDynamicObjectNode {
private static final StateField STATE_0_IsJSDynamicObjectNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
static final ReferenceField IS_OBJECT_CACHED_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "isObjectCached_cache", IsObjectCachedData.class);
/**
* Source Info:
* Specialization: {@link IsJSDynamicObjectNode#isObject}
* Parameter: {@link InlinedConditionProfile} resultProfile
* Inline method: {@link InlinedConditionProfile#inline}
*/
private static final InlinedConditionProfile INLINED_IS_OBJECT_RESULT_PROFILE_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_IsJSDynamicObjectNode_UPDATER.subUpdater(2, 2)));
/**
* State Info:
* 0: SpecializationActive {@link IsJSDynamicObjectNode#isObjectCached}
* 1: SpecializationActive {@link IsJSDynamicObjectNode#isObject}
* 2-3: InlinedCache
* Specialization: {@link IsJSDynamicObjectNode#isObject}
* Parameter: {@link InlinedConditionProfile} resultProfile
* Inline method: {@link InlinedConditionProfile#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
@UnsafeAccessedField @CompilationFinal private IsObjectCachedData isObjectCached_cache;
private IsJSDynamicObjectNodeGen() {
}
@Override
public boolean executeBoolean(Object arg0Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b11) != 0 /* is SpecializationActive[IsJSDynamicObjectNode.isObjectCached(Object, Class<>, boolean)] || SpecializationActive[IsJSDynamicObjectNode.isObject(Object, InlinedConditionProfile)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsJSDynamicObjectNode.isObjectCached(Object, Class<>, boolean)] */) {
IsObjectCachedData s0_ = this.isObjectCached_cache;
if (s0_ != null) {
assert DSLSupport.assertIdempotence((s0_.cachedClass_ != null));
if ((CompilerDirectives.isExact(arg0Value, s0_.cachedClass_))) {
return IsJSDynamicObjectNode.isObjectCached(arg0Value, s0_.cachedClass_, s0_.cachedResult_);
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsJSDynamicObjectNode.isObject(Object, InlinedConditionProfile)] */) {
return isObject(arg0Value, INLINED_IS_OBJECT_RESULT_PROFILE_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private boolean executeAndSpecialize(Object arg0Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[IsJSDynamicObjectNode.isObject(Object, InlinedConditionProfile)] */) {
while (true) {
int count0_ = 0;
IsObjectCachedData s0_ = IS_OBJECT_CACHED_CACHE_UPDATER.getVolatile(this);
IsObjectCachedData s0_original = s0_;
while (s0_ != null) {
assert DSLSupport.assertIdempotence((s0_.cachedClass_ != null));
if ((CompilerDirectives.isExact(arg0Value, s0_.cachedClass_))) {
break;
}
count0_++;
s0_ = null;
break;
}
if (s0_ == null && count0_ < 1) {
{
Class> cachedClass__ = (JSGuards.getClassIfJSDynamicObject(arg0Value));
if ((cachedClass__ != null) && (CompilerDirectives.isExact(arg0Value, cachedClass__))) {
s0_ = new IsObjectCachedData();
s0_.cachedClass_ = cachedClass__;
s0_.cachedResult_ = (JSGuards.isJSDynamicObject(arg0Value));
if (!IS_OBJECT_CACHED_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) {
continue;
}
state_0 = state_0 | 0b1 /* add SpecializationActive[IsJSDynamicObjectNode.isObjectCached(Object, Class<>, boolean)] */;
this.state_0_ = state_0;
}
}
}
if (s0_ != null) {
return IsJSDynamicObjectNode.isObjectCached(arg0Value, s0_.cachedClass_, s0_.cachedResult_);
}
break;
}
}
this.isObjectCached_cache = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[IsJSDynamicObjectNode.isObjectCached(Object, Class<>, boolean)] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[IsJSDynamicObjectNode.isObject(Object, InlinedConditionProfile)] */;
this.state_0_ = state_0;
return isObject(arg0Value, INLINED_IS_OBJECT_RESULT_PROFILE_);
}
@NeverDefault
public static IsJSDynamicObjectNode create() {
return new IsJSDynamicObjectNodeGen();
}
@GeneratedBy(IsJSDynamicObjectNode.class)
@DenyReplace
private static final class IsObjectCachedData implements SpecializationDataNode {
/**
* Source Info:
* Specialization: {@link IsJSDynamicObjectNode#isObjectCached}
* Parameter: {@link Class} cachedClass
*/
@CompilationFinal Class> cachedClass_;
/**
* Source Info:
* Specialization: {@link IsJSDynamicObjectNode#isObjectCached}
* Parameter: boolean cachedResult
*/
@CompilationFinal boolean cachedResult_;
IsObjectCachedData() {
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy