com.oracle.graal.python.lib.PyLongAsIntNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.InlineSupport;
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.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.frame.Frame;
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.NodeCost;
/**
* Debug Info:
* Specialization {@link PyLongAsIntNode#doInt}
* Activation probability: 0.65000
* With/without class size: 11/0 bytes
* Specialization {@link PyLongAsIntNode#doObject}
* Activation probability: 0.35000
* With/without class size: 13/9 bytes
*
*/
@GeneratedBy(PyLongAsIntNode.class)
@SuppressWarnings("javadoc")
public final class PyLongAsIntNodeGen {
private static final Uncached UNCACHED = new Uncached();
@NeverDefault
public static PyLongAsIntNode getUncached() {
return PyLongAsIntNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#object_pyLongAsLongAndOverflow__field1_}
*
- {@link Inlined#object_raiseNode__field1_}
*
*/
@NeverDefault
public static PyLongAsIntNode inline(@RequiredField(bits = 9, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyLongAsIntNodeGen.Inlined(target);
}
@GeneratedBy(PyLongAsIntNode.class)
@DenyReplace
private static final class Inlined extends PyLongAsIntNode {
/**
* State Info:
* 0: SpecializationActive {@link PyLongAsIntNode#doInt}
* 1: SpecializationActive {@link PyLongAsIntNode#doObject}
* 2-7: InlinedCache
* Specialization: {@link PyLongAsIntNode#doObject}
* Parameter: {@link PyLongAsLongAndOverflowNode} pyLongAsLongAndOverflow
* Inline method: {@link PyLongAsLongAndOverflowNodeGen#inline}
* 8: InlinedCache
* Specialization: {@link PyLongAsIntNode#doObject}
* Parameter: {@link Lazy} raiseNode
* Inline method: {@link LazyNodeGen#inline}
*
*/
private final StateField state_0_;
private final ReferenceField object_pyLongAsLongAndOverflow__field1_;
private final ReferenceField object_raiseNode__field1_;
/**
* Source Info:
* Specialization: {@link PyLongAsIntNode#doObject}
* Parameter: {@link PyLongAsLongAndOverflowNode} pyLongAsLongAndOverflow
* Inline method: {@link PyLongAsLongAndOverflowNodeGen#inline}
*/
private final PyLongAsLongAndOverflowNode object_pyLongAsLongAndOverflow_;
/**
* Source Info:
* Specialization: {@link PyLongAsIntNode#doObject}
* Parameter: {@link Lazy} raiseNode
* Inline method: {@link LazyNodeGen#inline}
*/
private final Lazy object_raiseNode_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyLongAsIntNode.class);
this.state_0_ = target.getState(0, 9);
this.object_pyLongAsLongAndOverflow__field1_ = target.getReference(1, Node.class);
this.object_raiseNode__field1_ = target.getReference(2, Node.class);
this.object_pyLongAsLongAndOverflow_ = PyLongAsLongAndOverflowNodeGen.inline(InlineTarget.create(PyLongAsLongAndOverflowNode.class, state_0_.subUpdater(2, 6), object_pyLongAsLongAndOverflow__field1_));
this.object_raiseNode_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(8, 1), object_raiseNode__field1_));
}
@Override
public int execute(Frame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyLongAsIntNode.doInt(int)] || SpecializationActive[PyLongAsIntNode.doObject(VirtualFrame, Node, Object, PyLongAsLongAndOverflowNode, Lazy)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyLongAsIntNode.doInt(int)] */ && arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return PyLongAsIntNode.doInt(arg1Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyLongAsIntNode.doObject(VirtualFrame, Node, Object, PyLongAsLongAndOverflowNode, Lazy)] */) {
assert InlineSupport.validate(arg0Value, this.state_0_, this.object_pyLongAsLongAndOverflow__field1_, this.state_0_, this.object_raiseNode__field1_);
return PyLongAsIntNode.doObject((VirtualFrame) frameValue, arg0Value, arg1Value, this.object_pyLongAsLongAndOverflow_, this.object_raiseNode_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value);
}
private int executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[PyLongAsIntNode.doInt(int)] */;
this.state_0_.set(arg0Value, state_0);
return PyLongAsIntNode.doInt(arg1Value_);
}
state_0 = state_0 | 0b10 /* add SpecializationActive[PyLongAsIntNode.doObject(VirtualFrame, Node, Object, PyLongAsLongAndOverflowNode, Lazy)] */;
this.state_0_.set(arg0Value, state_0);
assert InlineSupport.validate(arg0Value, this.state_0_, this.object_pyLongAsLongAndOverflow__field1_, this.state_0_, this.object_raiseNode__field1_);
return PyLongAsIntNode.doObject((VirtualFrame) frameValue, arg0Value, arg1Value, this.object_pyLongAsLongAndOverflow_, this.object_raiseNode_);
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(PyLongAsIntNode.class)
@DenyReplace
private static final class Uncached extends PyLongAsIntNode {
@Override
public int execute(Frame frameValue, Node arg0Value, Object arg1Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return PyLongAsIntNode.doInt(arg1Value_);
}
return PyLongAsIntNode.doObject((VirtualFrame) frameValue, arg0Value, arg1Value, (PyLongAsLongAndOverflowNodeGen.getUncached()), (Lazy.getUncached()));
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy