com.oracle.truffle.js.nodes.binary.JSAddConstantRightNumberNodeGen 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.DSLSupport;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
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.DenyReplace;
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.api.strings.TruffleString;
import com.oracle.truffle.js.nodes.JSTypes;
import com.oracle.truffle.js.nodes.JSTypesGen;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.cast.JSToNumberNode;
import com.oracle.truffle.js.nodes.cast.JSToPrimitiveNode;
import com.oracle.truffle.js.runtime.SafeInteger;
import com.oracle.truffle.js.runtime.builtins.JSOverloadedOperatorsObject;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.lang.invoke.MethodHandles.Lookup;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link JSAddConstantRightNumberNode#doIntTruncate}
* Activation probability: 0.21250
* With/without class size: 6/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doInt}
* Activation probability: 0.18750
* With/without class size: 6/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doIntOverflow}
* Activation probability: 0.16250
* With/without class size: 5/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doSafeInteger}
* Activation probability: 0.13750
* With/without class size: 5/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doDouble}
* Activation probability: 0.11250
* With/without class size: 5/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doStringNumber}
* Activation probability: 0.08750
* With/without class size: 5/0 bytes
* Specialization {@link JSAddConstantRightNumberNode#doOverloaded}
* Activation probability: 0.06250
* With/without class size: 5/4 bytes
* Specialization {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* Activation probability: 0.03750
* With/without class size: 5/9 bytes
*
*/
@GeneratedBy(JSAddConstantRightNumberNode.class)
@SuppressWarnings("javadoc")
public final class JSAddConstantRightNumberNodeGen extends JSAddConstantRightNumberNode {
private static final StateField PRIMITIVE_CONVERSION__J_S_ADD_CONSTANT_RIGHT_NUMBER_NODE_PRIMITIVE_CONVERSION_STATE_0_UPDATER = StateField.create(PrimitiveConversionData.lookup_(), "primitiveConversion_state_0_");
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* Parameter: {@link InlinedConditionProfile} profileA
* Inline method: {@link InlinedConditionProfile#inline}
*/
private static final InlinedConditionProfile INLINED_PRIMITIVE_CONVERSION_PROFILE_A_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, PRIMITIVE_CONVERSION__J_S_ADD_CONSTANT_RIGHT_NUMBER_NODE_PRIMITIVE_CONVERSION_STATE_0_UPDATER.subUpdater(0, 2)));
/**
* State Info:
* 0: SpecializationActive {@link JSAddConstantRightNumberNode#doIntTruncate}
* 1: SpecializationActive {@link JSAddConstantRightNumberNode#doInt}
* 2: SpecializationExcluded {@link JSAddConstantRightNumberNode#doInt}
* 3: SpecializationActive {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* 4: SpecializationActive {@link JSAddConstantRightNumberNode#doIntOverflow}
* 5: SpecializationExcluded {@link JSAddConstantRightNumberNode#doIntOverflow}
* 6: SpecializationActive {@link JSAddConstantRightNumberNode#doSafeInteger}
* 7: SpecializationExcluded {@link JSAddConstantRightNumberNode#doSafeInteger}
* 8: SpecializationActive {@link JSAddConstantRightNumberNode#doDouble}
* 9: SpecializationActive {@link JSAddConstantRightNumberNode#doStringNumber}
* 10: SpecializationActive {@link JSAddConstantRightNumberNode#doOverloaded}
* 11-13: ImplicitCast[type=double, index=0]
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doStringNumber}
* Parameter: {@link TruffleString} rightString
*/
@CompilationFinal private TruffleString rightString;
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doStringNumber}
* Parameter: {@link JSConcatStringsNode} createLazyString
*/
@Child private JSConcatStringsNode createLazyString;
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doOverloaded}
* Parameter: {@link JSOverloadedBinaryNode} overloadedOperatorNode
*/
@Child private JSOverloadedBinaryNode overloaded_overloadedOperatorNode_;
@Child private PrimitiveConversionData primitiveConversion_cache;
private JSAddConstantRightNumberNodeGen(JavaScriptNode left, Number rightValue, boolean truncate) {
super(left, rightValue, truncate);
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
if ((state_0 & 0b11101001000) == 0 /* only-active SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
return execute_int0(state_0, frameValue);
} else if ((state_0 & 0b11001011011) == 0 /* only-active SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
return execute_double1(state_0, frameValue);
} else {
return execute_generic2(state_0, frameValue);
}
}
private Object execute_int0(int state_0__, VirtualFrame frameValue) {
int state_0 = state_0__;
int operandNodeValue_;
try {
operandNodeValue_ = super.operandNode.executeInt(frameValue);
} catch (UnexpectedResultException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(ex.getResult());
}
if ((state_0 & 0b10011) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] || SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] || SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] */) {
assert DSLSupport.assertIdempotence((truncate));
assert DSLSupport.assertIdempotence((isInt));
return doIntTruncate(operandNodeValue_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */) {
assert DSLSupport.assertIdempotence((!(truncate)));
assert DSLSupport.assertIdempotence((isInt));
try {
return doInt(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xfffffffd /* remove SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */;
state_0 = state_0 | 0b100 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue_);
}
}
if ((state_0 & 0b10000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */) {
assert DSLSupport.assertIdempotence((!(truncate)));
assert DSLSupport.assertIdempotence((isInt));
try {
return doIntOverflow(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xffffffef /* remove SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */;
state_0 = state_0 | 0b100000 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(operandNodeValue_);
}
private Object execute_double1(int state_0__, VirtualFrame frameValue) {
int state_0 = state_0__;
int operandNodeValue_int = 0;
double operandNodeValue_;
try {
if ((state_0 & 0b11000000000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
operandNodeValue_ = super.operandNode.executeDouble(frameValue);
} else if ((state_0 & 0b10100000000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
operandNodeValue_int = super.operandNode.executeInt(frameValue);
operandNodeValue_ = JSTypes.intToDouble(operandNodeValue_int);
} else {
Object operandNodeValue__ = super.operandNode.execute(frameValue);
operandNodeValue_ = JSTypesGen.expectImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, operandNodeValue__);
}
} catch (UnexpectedResultException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(ex.getResult());
}
assert (state_0 & 0b100000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */;
return doDouble(operandNodeValue_);
}
private Object execute_generic2(int state_0__, VirtualFrame frameValue) {
int state_0 = state_0__;
Object operandNodeValue_ = super.operandNode.execute(frameValue);
if ((state_0 & 0b11101011011) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] || SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] || SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] || SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] || SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] || SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] || SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] || SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) {
if ((state_0 & 0b10011) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] || SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] || SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */ && operandNodeValue_ instanceof Integer) {
int operandNodeValue__ = (int) operandNodeValue_;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] */) {
assert DSLSupport.assertIdempotence((truncate));
assert DSLSupport.assertIdempotence((isInt));
return doIntTruncate(operandNodeValue__);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */) {
assert DSLSupport.assertIdempotence((!(truncate)));
assert DSLSupport.assertIdempotence((isInt));
try {
return doInt(operandNodeValue__);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xfffffffd /* remove SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */;
state_0 = state_0 | 0b100 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue__);
}
}
if ((state_0 & 0b10000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */) {
assert DSLSupport.assertIdempotence((!(truncate)));
assert DSLSupport.assertIdempotence((isInt));
try {
return doIntOverflow(operandNodeValue__);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xffffffef /* remove SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */;
state_0 = state_0 | 0b100000 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue__);
}
}
}
if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] */ && operandNodeValue_ instanceof SafeInteger) {
SafeInteger operandNodeValue__ = (SafeInteger) operandNodeValue_;
assert DSLSupport.assertIdempotence((isInt));
try {
return doSafeInteger(operandNodeValue__);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xffffffbf /* remove SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] */;
state_0 = state_0 | 0b10000000 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue__);
}
}
if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, operandNodeValue_)) {
double operandNodeValue__ = JSTypesGen.asImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, operandNodeValue_);
return doDouble(operandNodeValue__);
}
if ((state_0 & 0b1000000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] */ && operandNodeValue_ instanceof TruffleString) {
TruffleString operandNodeValue__ = (TruffleString) operandNodeValue_;
{
TruffleString rightString_ = this.rightString;
if (rightString_ != null) {
JSConcatStringsNode createLazyString_ = this.createLazyString;
if (createLazyString_ != null) {
return doStringNumber(operandNodeValue__, rightString_, createLazyString_);
}
}
}
}
if ((state_0 & 0b10000000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] */ && operandNodeValue_ instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject operandNodeValue__ = (JSOverloadedOperatorsObject) operandNodeValue_;
{
JSOverloadedBinaryNode overloadedOperatorNode__ = this.overloaded_overloadedOperatorNode_;
if (overloadedOperatorNode__ != null) {
return doOverloaded(operandNodeValue__, overloadedOperatorNode__);
}
}
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) {
PrimitiveConversionData s7_ = this.primitiveConversion_cache;
if (s7_ != null) {
{
TruffleString rightString_1 = this.rightString;
if (rightString_1 != null) {
JSConcatStringsNode createLazyString_1 = this.createLazyString;
if (createLazyString_1 != null) {
if ((!(hasOverloadedOperators(operandNodeValue_)))) {
Node node__ = (s7_);
return doPrimitiveConversion(operandNodeValue_, node__, s7_.toPrimitiveA_, s7_.toNumberA_, rightString_1, createLazyString_1, INLINED_PRIMITIVE_CONVERSION_PROFILE_A_);
}
}
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(operandNodeValue_);
}
@Override
public double executeDouble(VirtualFrame frameValue) throws UnexpectedResultException {
int state_0 = this.state_0_;
if ((state_0 & 0b10000011000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] || SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] || SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) {
return JSTypesGen.expectDouble(execute(frameValue));
}
int operandNodeValue_int = 0;
double operandNodeValue_;
try {
if ((state_0 & 0b11000000000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
operandNodeValue_ = super.operandNode.executeDouble(frameValue);
} else if ((state_0 & 0b10100000000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
operandNodeValue_int = super.operandNode.executeInt(frameValue);
operandNodeValue_ = JSTypes.intToDouble(operandNodeValue_int);
} else {
Object operandNodeValue__ = super.operandNode.execute(frameValue);
operandNodeValue_ = JSTypesGen.expectImplicitDouble((state_0 & 0b11100000000000) >>> 11 /* get-int ImplicitCast[type=double, index=0] */, operandNodeValue__);
}
} catch (UnexpectedResultException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return JSTypesGen.expectDouble(executeAndSpecialize(ex.getResult()));
}
if ((state_0 & 0b100000000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */) {
return doDouble(operandNodeValue_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return JSTypesGen.expectDouble(executeAndSpecialize(((state_0 & 0b10100000000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) ? (Object) operandNodeValue_int : (Object) operandNodeValue_)));
}
@Override
public int executeInt(VirtualFrame frameValue) throws UnexpectedResultException {
int state_0 = this.state_0_;
if ((state_0 & 0b10000011000) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] || SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] || SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) {
return JSTypesGen.expectInteger(execute(frameValue));
}
int operandNodeValue_;
try {
operandNodeValue_ = super.operandNode.executeInt(frameValue);
} catch (UnexpectedResultException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return JSTypesGen.expectInteger(executeAndSpecialize(ex.getResult()));
}
if ((state_0 & 0b11) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] || SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] */) {
assert DSLSupport.assertIdempotence((truncate));
assert DSLSupport.assertIdempotence((isInt));
return doIntTruncate(operandNodeValue_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */) {
assert DSLSupport.assertIdempotence((!(truncate)));
assert DSLSupport.assertIdempotence((isInt));
try {
return doInt(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xfffffffd /* remove SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */;
state_0 = state_0 | 0b100 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return JSTypesGen.expectInteger(executeAndSpecialize(operandNodeValue_));
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return JSTypesGen.expectInteger(executeAndSpecialize(operandNodeValue_));
}
@Override
public void executeVoid(VirtualFrame frameValue) {
int state_0 = this.state_0_;
try {
if ((state_0 & 0b11101011000) == 0 /* only-active SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
executeInt(frameValue);
return;
} else if ((state_0 & 0b11001011011) == 0 /* only-active SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */ && ((state_0 & 0b11101011011) != 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] && SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] && SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] && SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] && SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] && SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] && SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] && SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */)) {
executeDouble(frameValue);
return;
}
execute(frameValue);
return;
} catch (UnexpectedResultException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return;
}
}
private Object executeAndSpecialize(Object operandNodeValue) {
int state_0 = this.state_0_;
if (operandNodeValue instanceof Integer) {
int operandNodeValue_ = (int) operandNodeValue;
if ((truncate) && (isInt)) {
state_0 = state_0 | 0b1 /* add SpecializationActive[JSAddConstantRightNumberNode.doIntTruncate(int)] */;
this.state_0_ = state_0;
return doIntTruncate(operandNodeValue_);
}
if (((state_0 & 0b1000)) == 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */ && ((state_0 & 0b100)) == 0 /* is-not SpecializationExcluded */) {
if ((!(truncate)) && (isInt)) {
state_0 = state_0 | 0b10 /* add SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */;
this.state_0_ = state_0;
try {
return doInt(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xfffffffd /* remove SpecializationActive[JSAddConstantRightNumberNode.doInt(int)] */;
state_0 = state_0 | 0b100 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue_);
}
}
}
if (((state_0 & 0b100000)) == 0 /* is-not SpecializationExcluded */) {
if ((!(truncate)) && (isInt)) {
state_0 = state_0 | 0b10000 /* add SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */;
this.state_0_ = state_0;
try {
return doIntOverflow(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xffffffef /* remove SpecializationActive[JSAddConstantRightNumberNode.doIntOverflow(int)] */;
state_0 = state_0 | 0b100000 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue_);
}
}
}
}
if (((state_0 & 0b10000000)) == 0 /* is-not SpecializationExcluded */ && operandNodeValue instanceof SafeInteger) {
SafeInteger operandNodeValue_ = (SafeInteger) operandNodeValue;
if ((isInt)) {
state_0 = state_0 | 0b1000000 /* add SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] */;
this.state_0_ = state_0;
try {
return doSafeInteger(operandNodeValue_);
} catch (ArithmeticException ex) {
CompilerDirectives.transferToInterpreterAndInvalidate();
state_0 = this.state_0_;
state_0 = state_0 & 0xffffffbf /* remove SpecializationActive[JSAddConstantRightNumberNode.doSafeInteger(SafeInteger)] */;
state_0 = state_0 | 0b10000000 /* add SpecializationExcluded */;
this.state_0_ = state_0;
return executeAndSpecialize(operandNodeValue_);
}
}
}
if (((state_0 & 0b1000)) == 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */) {
int doubleCast0;
if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(operandNodeValue)) != 0) {
double operandNodeValue_ = JSTypesGen.asImplicitDouble(doubleCast0, operandNodeValue);
state_0 = (state_0 | (doubleCast0 << 11) /* set-int ImplicitCast[type=double, index=0] */);
state_0 = state_0 | 0b100000000 /* add SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)] */;
this.state_0_ = state_0;
return doDouble(operandNodeValue_);
}
}
if (((state_0 & 0b1000)) == 0 /* is-not SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */ && operandNodeValue instanceof TruffleString) {
TruffleString operandNodeValue_ = (TruffleString) operandNodeValue;
TruffleString rightString_;
TruffleString rightString__shared = this.rightString;
if (rightString__shared != null) {
rightString_ = rightString__shared;
} else {
rightString_ = (rightValueToString());
if (rightString_ == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.rightString == null) {
VarHandle.storeStoreFence();
this.rightString = rightString_;
}
JSConcatStringsNode createLazyString_;
JSConcatStringsNode createLazyString__shared = this.createLazyString;
if (createLazyString__shared != null) {
createLazyString_ = createLazyString__shared;
} else {
createLazyString_ = this.insert((JSConcatStringsNode.create()));
if (createLazyString_ == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.createLazyString == null) {
VarHandle.storeStoreFence();
this.createLazyString = createLazyString_;
}
state_0 = state_0 | 0b1000000000 /* add SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] */;
this.state_0_ = state_0;
return doStringNumber(operandNodeValue_, rightString_, createLazyString_);
}
if (operandNodeValue instanceof JSOverloadedOperatorsObject) {
JSOverloadedOperatorsObject operandNodeValue_ = (JSOverloadedOperatorsObject) operandNodeValue;
JSOverloadedBinaryNode overloadedOperatorNode__ = this.insert((JSOverloadedBinaryNode.createHintDefault(getOverloadedOperatorName())));
Objects.requireNonNull(overloadedOperatorNode__, "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.");
VarHandle.storeStoreFence();
this.overloaded_overloadedOperatorNode_ = overloadedOperatorNode__;
state_0 = state_0 | 0b10000000000 /* add SpecializationActive[JSAddConstantRightNumberNode.doOverloaded(JSOverloadedOperatorsObject, JSOverloadedBinaryNode)] */;
this.state_0_ = state_0;
return doOverloaded(operandNodeValue_, overloadedOperatorNode__);
}
{
Node node__ = null;
if ((!(hasOverloadedOperators(operandNodeValue)))) {
PrimitiveConversionData s7_ = this.insert(new PrimitiveConversionData());
node__ = (s7_);
JSToPrimitiveNode toPrimitiveA__ = s7_.insert((JSToPrimitiveNode.createHintDefault()));
Objects.requireNonNull(toPrimitiveA__, "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.");
s7_.toPrimitiveA_ = toPrimitiveA__;
JSToNumberNode toNumberA__ = s7_.insert((JSToNumberNode.create()));
Objects.requireNonNull(toNumberA__, "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.");
s7_.toNumberA_ = toNumberA__;
TruffleString rightString_1;
TruffleString rightString_1_shared = this.rightString;
if (rightString_1_shared != null) {
rightString_1 = rightString_1_shared;
} else {
rightString_1 = (rightValueToString());
if (rightString_1 == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.rightString == null) {
this.rightString = rightString_1;
}
JSConcatStringsNode createLazyString_1;
JSConcatStringsNode createLazyString_1_shared = this.createLazyString;
if (createLazyString_1_shared != null) {
createLazyString_1 = createLazyString_1_shared;
} else {
createLazyString_1 = s7_.insert((JSConcatStringsNode.create()));
if (createLazyString_1 == null) {
throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state.");
}
}
if (this.createLazyString == null) {
this.createLazyString = createLazyString_1;
}
VarHandle.storeStoreFence();
this.primitiveConversion_cache = s7_;
state_0 = state_0 & 0xfffffcfd /* remove SpecializationActive[JSAddConstantRightNumberNode.doInt(int)], SpecializationActive[JSAddConstantRightNumberNode.doDouble(double)], SpecializationActive[JSAddConstantRightNumberNode.doStringNumber(TruffleString, TruffleString, JSConcatStringsNode)] */;
state_0 = state_0 | 0b1000 /* add SpecializationActive[JSAddConstantRightNumberNode.doPrimitiveConversion(Object, Node, JSToPrimitiveNode, JSToNumberNode, TruffleString, JSConcatStringsNode, InlinedConditionProfile)] */;
this.state_0_ = state_0;
return doPrimitiveConversion(operandNodeValue, node__, toPrimitiveA__, toNumberA__, rightString_1, createLazyString_1, INLINED_PRIMITIVE_CONVERSION_PROFILE_A_);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {super.operandNode}, operandNodeValue);
}
@NeverDefault
public static JSAddConstantRightNumberNode create(JavaScriptNode left, Number rightValue, boolean truncate) {
return new JSAddConstantRightNumberNodeGen(left, rightValue, truncate);
}
@GeneratedBy(JSAddConstantRightNumberNode.class)
@DenyReplace
private static final class PrimitiveConversionData extends Node implements SpecializationDataNode {
/**
* State Info:
* 0-1: InlinedCache
* Specialization: {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* Parameter: {@link InlinedConditionProfile} profileA
* Inline method: {@link InlinedConditionProfile#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int primitiveConversion_state_0_;
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* Parameter: {@link JSToPrimitiveNode} toPrimitiveA
*/
@Child JSToPrimitiveNode toPrimitiveA_;
/**
* Source Info:
* Specialization: {@link JSAddConstantRightNumberNode#doPrimitiveConversion}
* Parameter: {@link JSToNumberNode} toNumberA
*/
@Child JSToNumberNode toNumberA_;
PrimitiveConversionData() {
}
private static Lookup lookup_() {
return MethodHandles.lookup();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy