com.oracle.truffle.js.nodes.cast.JSNumericToNumberNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.cast;
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.UnsupportedSpecializationException;
import com.oracle.truffle.js.runtime.BigInt;
import com.oracle.truffle.js.runtime.SafeInteger;
/**
* Debug Info:
* Specialization {@link JSNumericToNumberNode#doBigInt}
* Activation probability: 0.38500
* With/without class size: 8/0 bytes
* Specialization {@link JSNumericToNumberNode#doInt}
* Activation probability: 0.29500
* With/without class size: 7/0 bytes
* Specialization {@link JSNumericToNumberNode#doSafeInteger}
* Activation probability: 0.20500
* With/without class size: 6/0 bytes
* Specialization {@link JSNumericToNumberNode#doDouble}
* Activation probability: 0.11500
* With/without class size: 5/0 bytes
*
*/
@GeneratedBy(JSNumericToNumberNode.class)
@SuppressWarnings("javadoc")
public final class JSNumericToNumberNodeGen extends JSNumericToNumberNode {
/**
* State Info:
* 0: SpecializationActive {@link JSNumericToNumberNode#doBigInt}
* 1: SpecializationActive {@link JSNumericToNumberNode#doInt}
* 2: SpecializationActive {@link JSNumericToNumberNode#doSafeInteger}
* 3: SpecializationActive {@link JSNumericToNumberNode#doDouble}
*
*/
@CompilationFinal private int state_0_;
private JSNumericToNumberNodeGen() {
}
@Override
public Number executeNumeric(Object arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[JSNumericToNumberNode.doBigInt(BigInt)] || SpecializationActive[JSNumericToNumberNode.doInt(Integer)] || SpecializationActive[JSNumericToNumberNode.doSafeInteger(SafeInteger)] || SpecializationActive[JSNumericToNumberNode.doDouble(Double)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSNumericToNumberNode.doBigInt(BigInt)] */ && arg0Value instanceof BigInt) {
BigInt arg0Value_ = (BigInt) arg0Value;
return JSNumericToNumberNode.doBigInt(arg0Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSNumericToNumberNode.doInt(Integer)] */ && arg0Value instanceof Integer) {
Integer arg0Value_ = (Integer) arg0Value;
return JSNumericToNumberNode.doInt(arg0Value_);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSNumericToNumberNode.doSafeInteger(SafeInteger)] */ && arg0Value instanceof SafeInteger) {
SafeInteger arg0Value_ = (SafeInteger) arg0Value;
return JSNumericToNumberNode.doSafeInteger(arg0Value_);
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[JSNumericToNumberNode.doDouble(Double)] */ && arg0Value instanceof Double) {
Double arg0Value_ = (Double) arg0Value;
return JSNumericToNumberNode.doDouble(arg0Value_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Number executeAndSpecialize(Object arg0Value) {
int state_0 = this.state_0_;
if (arg0Value instanceof BigInt) {
BigInt arg0Value_ = (BigInt) arg0Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[JSNumericToNumberNode.doBigInt(BigInt)] */;
this.state_0_ = state_0;
return JSNumericToNumberNode.doBigInt(arg0Value_);
}
if (arg0Value instanceof Integer) {
Integer arg0Value_ = (Integer) arg0Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[JSNumericToNumberNode.doInt(Integer)] */;
this.state_0_ = state_0;
return JSNumericToNumberNode.doInt(arg0Value_);
}
if (arg0Value instanceof SafeInteger) {
SafeInteger arg0Value_ = (SafeInteger) arg0Value;
state_0 = state_0 | 0b100 /* add SpecializationActive[JSNumericToNumberNode.doSafeInteger(SafeInteger)] */;
this.state_0_ = state_0;
return JSNumericToNumberNode.doSafeInteger(arg0Value_);
}
if (arg0Value instanceof Double) {
Double arg0Value_ = (Double) arg0Value;
state_0 = state_0 | 0b1000 /* add SpecializationActive[JSNumericToNumberNode.doDouble(Double)] */;
this.state_0_ = state_0;
return JSNumericToNumberNode.doDouble(arg0Value_);
}
throw new UnsupportedSpecializationException(this, null, arg0Value);
}
@NeverDefault
public static JSNumericToNumberNode create() {
return new JSNumericToNumberNodeGen();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy