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

com.oracle.truffle.js.nodes.binary.JSOrNodeGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.nodes.binary;

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.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.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.cast.JSToBooleanNode;
import com.oracle.truffle.js.nodes.cast.JSToBooleanNodeGen;
import java.lang.invoke.MethodHandles;

/**
 * Debug Info: 
 *   Specialization {@link JSOrNode#doBoolean}
 *     Activation probability: 0.65000
 *     With/without class size: 14/0 bytes
 *   Specialization {@link JSOrNode#doGeneric}
 *     Activation probability: 0.35000
 *     With/without class size: 12/6 bytes
 * 
*/ @GeneratedBy(JSOrNode.class) @SuppressWarnings("javadoc") public final class JSOrNodeGen extends JSOrNode { private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); private static final StateField STATE_0_JSOrNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); /** * Source Info:
     *   Specialization: {@link JSOrNode#doBoolean}
     *   Parameter: {@link InlinedConditionProfile} canShortCircuit
     *   Inline method: {@link InlinedConditionProfile#inline}
*/ private static final InlinedConditionProfile INLINED_CAN_SHORT_CIRCUIT = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_UPDATER.subUpdater(2, 2))); /** * Source Info:
     *   Specialization: {@link JSOrNode#doGeneric}
     *   Parameter: {@link JSToBooleanNode} toBoolean
     *   Inline method: {@link JSToBooleanNodeGen#inline}
*/ private static final JSToBooleanNode INLINED_GENERIC_TO_BOOLEAN_ = JSToBooleanNodeGen.inline(InlineTarget.create(JSToBooleanNode.class, STATE_0_JSOrNode_UPDATER.subUpdater(4, 15), ReferenceField.create(MethodHandles.lookup(), "generic_toBoolean__field1_", Node.class))); /** * State Info:
     *   0: SpecializationActive {@link JSOrNode#doBoolean}
     *   1: SpecializationActive {@link JSOrNode#doGeneric}
     *   2-3: InlinedCache
     *        Specialization: {@link JSOrNode#doBoolean}
     *        Parameter: {@link InlinedConditionProfile} canShortCircuit
     *        Inline method: {@link InlinedConditionProfile#inline}
     *   4-18: InlinedCache
     *        Specialization: {@link JSOrNode#doGeneric}
     *        Parameter: {@link JSToBooleanNode} toBoolean
     *        Inline method: {@link JSToBooleanNodeGen#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * Source Info:
     *   Specialization: {@link JSOrNode#doGeneric}
     *   Parameter: {@link JSToBooleanNode} toBoolean
     *   Inline method: {@link JSToBooleanNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node generic_toBoolean__field1_; private JSOrNodeGen(JavaScriptNode left, JavaScriptNode right) { super(left, right); } @Override protected Object executeEvaluated(VirtualFrame frameValue, Object leftNodeValue) { int state_0 = this.state_0_; if ((state_0 & 0b11) != 0 /* is SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] || SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */ && leftNodeValue instanceof Boolean) { boolean leftNodeValue_ = (boolean) leftNodeValue; return doBoolean(frameValue, leftNodeValue_, INLINED_CAN_SHORT_CIRCUIT); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */) { return doGeneric(frameValue, leftNodeValue, INLINED_GENERIC_TO_BOOLEAN_, INLINED_CAN_SHORT_CIRCUIT); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, leftNodeValue); } @Override public Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; if ((state_0 & 0b10) == 0 /* only-active SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] && SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */)) { return execute_boolean0(state_0, frameValue); } else { return execute_generic1(state_0, frameValue); } } private Object execute_boolean0(int state_0__, VirtualFrame frameValue) { int state_0 = state_0__; boolean leftNodeValue_; try { leftNodeValue_ = super.leftNode.executeBoolean(frameValue); } catch (UnexpectedResultException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, ex.getResult()); } assert (state_0 & 0b1) != 0 /* is SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */; return doBoolean(frameValue, leftNodeValue_, INLINED_CAN_SHORT_CIRCUIT); } private Object execute_generic1(int state_0__, VirtualFrame frameValue) { int state_0 = state_0__; Object leftNodeValue_ = super.leftNode.execute(frameValue); if ((state_0 & 0b11) != 0 /* is SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] || SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */ && leftNodeValue_ instanceof Boolean) { boolean leftNodeValue__ = (boolean) leftNodeValue_; return doBoolean(frameValue, leftNodeValue__, INLINED_CAN_SHORT_CIRCUIT); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */) { return doGeneric(frameValue, leftNodeValue_, INLINED_GENERIC_TO_BOOLEAN_, INLINED_CAN_SHORT_CIRCUIT); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, leftNodeValue_); } @Override public void executeVoid(VirtualFrame frameValue) { execute(frameValue); return; } private Object executeAndSpecialize(VirtualFrame frameValue, Object leftNodeValue) { int state_0 = this.state_0_; if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */ && leftNodeValue instanceof Boolean) { boolean leftNodeValue_ = (boolean) leftNodeValue; state_0 = state_0 | 0b1 /* add SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */; this.state_0_ = state_0; return doBoolean(frameValue, leftNodeValue_, INLINED_CAN_SHORT_CIRCUIT); } state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[JSOrNode.doBoolean(VirtualFrame, boolean, InlinedConditionProfile)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[JSOrNode.doGeneric(VirtualFrame, Object, JSToBooleanNode, InlinedConditionProfile)] */; this.state_0_ = state_0; return doGeneric(frameValue, leftNodeValue, INLINED_GENERIC_TO_BOOLEAN_, INLINED_CAN_SHORT_CIRCUIT); } @NeverDefault public static JSOrNode create(JavaScriptNode left, JavaScriptNode right) { return new JSOrNodeGen(left, right); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy