All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.js.nodes.access.IsJSClassNodeGen 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.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.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.js.nodes.JavaScriptNode;
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 IsJSClassNode#doIsInstanceShape}
 *     Activation probability: 0.48333
 *     With/without class size: 14/5 bytes
 *   Specialization {@link IsJSClassNode#doIsInstanceObject}
 *     Activation probability: 0.33333
 *     With/without class size: 8/0 bytes
 *   Specialization {@link IsJSClassNode#doIsInstance}
 *     Activation probability: 0.18333
 *     With/without class size: 6/0 bytes
 * 
*/ @GeneratedBy(IsJSClassNode.class) @SuppressWarnings("javadoc") public final class IsJSClassNodeGen extends IsJSClassNode { static final ReferenceField IS_INSTANCE_SHAPE_CACHE_UPDATER = ReferenceField.create(MethodHandles.lookup(), "isInstanceShape_cache", IsInstanceShapeData.class); /** * State Info:
     *   0: SpecializationActive {@link IsJSClassNode#doIsInstanceShape}
     *   1: SpecializationActive {@link IsJSClassNode#doIsInstanceObject}
     *   2: SpecializationActive {@link IsJSClassNode#doIsInstance}
     * 
*/ @CompilationFinal private int state_0_; @UnsafeAccessedField @CompilationFinal private IsInstanceShapeData isInstanceShape_cache; private IsJSClassNodeGen(JSClass jsclass, JavaScriptNode operand) { super(jsclass, operand); } @ExplodeLoop @Override public boolean executeBoolean(Object operandNodeValue) { int state_0 = this.state_0_; if (state_0 != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] || SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { if ((state_0 & 0b11) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */ && operandNodeValue instanceof JSDynamicObject) { JSDynamicObject operandNodeValue_ = (JSDynamicObject) operandNodeValue; if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] */) { IsInstanceShapeData s0_ = this.isInstanceShape_cache; while (s0_ != null) { if ((s0_.cachedShape_.check(operandNodeValue_))) { return IsJSClassNode.doIsInstanceShape(operandNodeValue_, s0_.cachedShape_, s0_.cachedResult_); } s0_ = s0_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */) { return doIsInstanceObject(operandNodeValue_); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { return doIsInstance(operandNodeValue); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(operandNodeValue); } @ExplodeLoop @Override public Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; Object operandNodeValue_ = super.operandNode.execute(frameValue); if (state_0 != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] || SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { if ((state_0 & 0b11) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */ && operandNodeValue_ instanceof JSDynamicObject) { JSDynamicObject operandNodeValue__ = (JSDynamicObject) operandNodeValue_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] */) { IsInstanceShapeData s0_ = this.isInstanceShape_cache; while (s0_ != null) { if ((s0_.cachedShape_.check(operandNodeValue__))) { return IsJSClassNode.doIsInstanceShape(operandNodeValue__, s0_.cachedShape_, s0_.cachedResult_); } s0_ = s0_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */) { return doIsInstanceObject(operandNodeValue__); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { return doIsInstance(operandNodeValue_); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(operandNodeValue_); } @ExplodeLoop @Override public boolean executeBoolean(VirtualFrame frameValue) { int state_0 = this.state_0_; Object operandNodeValue_ = super.operandNode.execute(frameValue); if (state_0 != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] || SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { if ((state_0 & 0b11) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] || SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */ && operandNodeValue_ instanceof JSDynamicObject) { JSDynamicObject operandNodeValue__ = (JSDynamicObject) operandNodeValue_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] */) { IsInstanceShapeData s0_ = this.isInstanceShape_cache; while (s0_ != null) { if ((s0_.cachedShape_.check(operandNodeValue__))) { return IsJSClassNode.doIsInstanceShape(operandNodeValue__, s0_.cachedShape_, s0_.cachedResult_); } s0_ = s0_.next_; } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */) { return doIsInstanceObject(operandNodeValue__); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { return doIsInstance(operandNodeValue_); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(operandNodeValue_); } @Override public void executeVoid(VirtualFrame frameValue) { executeBoolean(frameValue); return; } @SuppressWarnings("unused") private boolean executeAndSpecialize(Object operandNodeValue) { int state_0 = this.state_0_; if (operandNodeValue instanceof JSDynamicObject) { JSDynamicObject operandNodeValue_ = (JSDynamicObject) operandNodeValue; if (((state_0 & 0b110)) == 0 /* is-not SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] && SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { while (true) { int count0_ = 0; IsInstanceShapeData s0_ = IS_INSTANCE_SHAPE_CACHE_UPDATER.getVolatile(this); IsInstanceShapeData s0_original = s0_; while (s0_ != null) { if ((s0_.cachedShape_.check(operandNodeValue_))) { break; } count0_++; s0_ = s0_.next_; } if (s0_ == null) { { Shape cachedShape__ = (operandNodeValue_.getShape()); if ((cachedShape__.check(operandNodeValue_)) && count0_ < (IsJSClassNode.MAX_SHAPE_COUNT)) { s0_ = new IsInstanceShapeData(s0_original); 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_.cachedResult_ = (doIsInstance(operandNodeValue_)); if (!IS_INSTANCE_SHAPE_CACHE_UPDATER.compareAndSet(this, s0_original, s0_)) { continue; } state_0 = state_0 | 0b1 /* add SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] */; this.state_0_ = state_0; } } } if (s0_ != null) { return IsJSClassNode.doIsInstanceShape(operandNodeValue_, s0_.cachedShape_, s0_.cachedResult_); } break; } } if (((state_0 & 0b100)) == 0 /* is-not SpecializationActive[IsJSClassNode.doIsInstance(Object)] */) { this.isInstanceShape_cache = null; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */; this.state_0_ = state_0; return doIsInstanceObject(operandNodeValue_); } } this.isInstanceShape_cache = null; state_0 = state_0 & 0xfffffffc /* remove SpecializationActive[IsJSClassNode.doIsInstanceShape(JSDynamicObject, Shape, boolean)], SpecializationActive[IsJSClassNode.doIsInstanceObject(JSDynamicObject)] */; state_0 = state_0 | 0b100 /* add SpecializationActive[IsJSClassNode.doIsInstance(Object)] */; this.state_0_ = state_0; return doIsInstance(operandNodeValue); } @NeverDefault public static IsJSClassNode create(JSClass jsclass, JavaScriptNode operand) { return new IsJSClassNodeGen(jsclass, operand); } @GeneratedBy(IsJSClassNode.class) @DenyReplace private static final class IsInstanceShapeData implements SpecializationDataNode { @CompilationFinal final IsInstanceShapeData next_; /** * Source Info:
         *   Specialization: {@link IsJSClassNode#doIsInstanceShape}
         *   Parameter: {@link Shape} cachedShape
*/ @CompilationFinal Shape cachedShape_; /** * Source Info:
         *   Specialization: {@link IsJSClassNode#doIsInstanceShape}
         *   Parameter: boolean cachedResult
*/ @CompilationFinal boolean cachedResult_; IsInstanceShapeData(IsInstanceShapeData next_) { this.next_ = next_; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy