com.oracle.graal.python.lib.PyLongAsDoubleNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.builtins.objects.ints.PInt;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
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.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
/**
* Debug Info:
* Specialization {@link PyLongAsDoubleNode#doBoolean}
* Activation probability: 0.32000
* With/without class size: 7/0 bytes
* Specialization {@link PyLongAsDoubleNode#doInt}
* Activation probability: 0.26000
* With/without class size: 7/0 bytes
* Specialization {@link PyLongAsDoubleNode#doLong}
* Activation probability: 0.20000
* With/without class size: 6/0 bytes
* Specialization {@link PyLongAsDoubleNode#doPInt}
* Activation probability: 0.14000
* With/without class size: 5/0 bytes
* Specialization {@link PyLongAsDoubleNode#fallback}
* Activation probability: 0.08000
* With/without class size: 4/0 bytes
*
*/
@GeneratedBy(PyLongAsDoubleNode.class)
@SuppressWarnings({"javadoc", "unused"})
public final class PyLongAsDoubleNodeGen {
private static final Uncached UNCACHED = new Uncached();
@NeverDefault
public static PyLongAsDoubleNode getUncached() {
return PyLongAsDoubleNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
*/
@NeverDefault
public static PyLongAsDoubleNode inline(@RequiredField(bits = 5, value = StateField.class) InlineTarget target) {
return new PyLongAsDoubleNodeGen.Inlined(target);
}
@GeneratedBy(PyLongAsDoubleNode.class)
@DenyReplace
private static final class Inlined extends PyLongAsDoubleNode {
/**
* State Info:
* 0: SpecializationActive {@link PyLongAsDoubleNode#doBoolean}
* 1: SpecializationActive {@link PyLongAsDoubleNode#doInt}
* 2: SpecializationActive {@link PyLongAsDoubleNode#doLong}
* 3: SpecializationActive {@link PyLongAsDoubleNode#doPInt}
* 4: SpecializationActive {@link PyLongAsDoubleNode#fallback}
*
*/
private final StateField state_0_;
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyLongAsDoubleNode.class);
this.state_0_ = target.getState(0, 5);
}
@SuppressWarnings("static-method")
private boolean fallbackGuard_(int state_0, Node arg0Value, Object arg1Value) {
if (!((state_0 & 0b1) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doBoolean(boolean)] */) && arg1Value instanceof Boolean) {
return false;
}
if (!((state_0 & 0b10) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doInt(int)] */) && arg1Value instanceof Integer) {
return false;
}
if (!((state_0 & 0b100) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doLong(long)] */) && arg1Value instanceof Long) {
return false;
}
if (!((state_0 & 0b1000) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doPInt(PInt)] */) && arg1Value instanceof PInt) {
return false;
}
return true;
}
@Override
public Object execute(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[PyLongAsDoubleNode.doBoolean(boolean)] || SpecializationActive[PyLongAsDoubleNode.doInt(int)] || SpecializationActive[PyLongAsDoubleNode.doLong(long)] || SpecializationActive[PyLongAsDoubleNode.doPInt(PInt)] || SpecializationActive[PyLongAsDoubleNode.fallback(Object)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doBoolean(boolean)] */ && arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
return PyLongAsDoubleNode.doBoolean(arg1Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doInt(int)] */ && arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return PyLongAsDoubleNode.doInt(arg1Value_);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doLong(long)] */ && arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
return PyLongAsDoubleNode.doLong(arg1Value_);
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[PyLongAsDoubleNode.doPInt(PInt)] */ && arg1Value instanceof PInt) {
PInt arg1Value_ = (PInt) arg1Value;
return doPInt(arg1Value_);
}
if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PyLongAsDoubleNode.fallback(Object)] */) {
if (fallbackGuard_(state_0, arg0Value, arg1Value)) {
return fallback(arg1Value);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value);
}
private Object executeAndSpecialize(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[PyLongAsDoubleNode.doBoolean(boolean)] */;
this.state_0_.set(arg0Value, state_0);
return PyLongAsDoubleNode.doBoolean(arg1Value_);
}
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[PyLongAsDoubleNode.doInt(int)] */;
this.state_0_.set(arg0Value, state_0);
return PyLongAsDoubleNode.doInt(arg1Value_);
}
if (arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
state_0 = state_0 | 0b100 /* add SpecializationActive[PyLongAsDoubleNode.doLong(long)] */;
this.state_0_.set(arg0Value, state_0);
return PyLongAsDoubleNode.doLong(arg1Value_);
}
if (arg1Value instanceof PInt) {
PInt arg1Value_ = (PInt) arg1Value;
state_0 = state_0 | 0b1000 /* add SpecializationActive[PyLongAsDoubleNode.doPInt(PInt)] */;
this.state_0_.set(arg0Value, state_0);
return doPInt(arg1Value_);
}
state_0 = state_0 | 0b10000 /* add SpecializationActive[PyLongAsDoubleNode.fallback(Object)] */;
this.state_0_.set(arg0Value, state_0);
return fallback(arg1Value);
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(PyLongAsDoubleNode.class)
@DenyReplace
private static final class Uncached extends PyLongAsDoubleNode {
@TruffleBoundary
@Override
public Object execute(Node arg0Value, Object arg1Value) {
if (arg1Value instanceof Boolean) {
boolean arg1Value_ = (boolean) arg1Value;
return PyLongAsDoubleNode.doBoolean(arg1Value_);
}
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return PyLongAsDoubleNode.doInt(arg1Value_);
}
if (arg1Value instanceof Long) {
long arg1Value_ = (long) arg1Value;
return PyLongAsDoubleNode.doLong(arg1Value_);
}
if (arg1Value instanceof PInt) {
PInt arg1Value_ = (PInt) arg1Value;
return doPInt(arg1Value_);
}
return fallback(arg1Value);
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy