com.oracle.graal.python.lib.PyFloatCheckExactNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.nodes.object.BuiltinClassProfiles.IsBuiltinObjectProfile;
import com.oracle.graal.python.nodes.object.BuiltinClassProfilesFactory.IsBuiltinObjectProfileNodeGen;
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.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.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
/**
* Debug Info:
* Specialization {@link PyFloatCheckExactNode#doDouble}
* Activation probability: 0.65000
* With/without class size: 11/0 bytes
* Specialization {@link PyFloatCheckExactNode#doGeneric}
* Activation probability: 0.35000
* With/without class size: 12/7 bytes
*
*/
@GeneratedBy(PyFloatCheckExactNode.class)
@SuppressWarnings("javadoc")
public final class PyFloatCheckExactNodeGen {
private static final Uncached UNCACHED = new Uncached();
@NeverDefault
public static PyFloatCheckExactNode getUncached() {
return PyFloatCheckExactNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#generic_isBuiltin__field1_}
*
*/
@NeverDefault
public static PyFloatCheckExactNode inline(@RequiredField(bits = 22, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyFloatCheckExactNodeGen.Inlined(target);
}
@GeneratedBy(PyFloatCheckExactNode.class)
@DenyReplace
private static final class Inlined extends PyFloatCheckExactNode {
/**
* State Info:
* 0: SpecializationActive {@link PyFloatCheckExactNode#doDouble}
* 1: SpecializationActive {@link PyFloatCheckExactNode#doGeneric}
* 2-21: InlinedCache
* Specialization: {@link PyFloatCheckExactNode#doGeneric}
* Parameter: {@link IsBuiltinObjectProfile} isBuiltin
* Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
*
*/
private final StateField state_0_;
private final ReferenceField generic_isBuiltin__field1_;
/**
* Source Info:
* Specialization: {@link PyFloatCheckExactNode#doGeneric}
* Parameter: {@link IsBuiltinObjectProfile} isBuiltin
* Inline method: {@link IsBuiltinObjectProfileNodeGen#inline}
*/
private final IsBuiltinObjectProfile generic_isBuiltin_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyFloatCheckExactNode.class);
this.state_0_ = target.getState(0, 22);
this.generic_isBuiltin__field1_ = target.getReference(1, Node.class);
this.generic_isBuiltin_ = IsBuiltinObjectProfileNodeGen.inline(InlineTarget.create(IsBuiltinObjectProfile.class, state_0_.subUpdater(2, 20), generic_isBuiltin__field1_));
}
@Override
public boolean execute(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyFloatCheckExactNode.doDouble(Double)] || SpecializationActive[PyFloatCheckExactNode.doGeneric(Node, Object, IsBuiltinObjectProfile)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyFloatCheckExactNode.doDouble(Double)] */ && arg1Value instanceof Double) {
Double arg1Value_ = (Double) arg1Value;
return PyFloatCheckExactNode.doDouble(arg1Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyFloatCheckExactNode.doGeneric(Node, Object, IsBuiltinObjectProfile)] */) {
assert InlineSupport.validate(arg0Value, this.state_0_, this.generic_isBuiltin__field1_);
return PyFloatCheckExactNode.doGeneric(arg0Value, arg1Value, this.generic_isBuiltin_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value);
}
private boolean executeAndSpecialize(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof Double) {
Double arg1Value_ = (Double) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[PyFloatCheckExactNode.doDouble(Double)] */;
this.state_0_.set(arg0Value, state_0);
return PyFloatCheckExactNode.doDouble(arg1Value_);
}
state_0 = state_0 | 0b10 /* add SpecializationActive[PyFloatCheckExactNode.doGeneric(Node, Object, IsBuiltinObjectProfile)] */;
this.state_0_.set(arg0Value, state_0);
assert InlineSupport.validate(arg0Value, this.state_0_, this.generic_isBuiltin__field1_);
return PyFloatCheckExactNode.doGeneric(arg0Value, arg1Value, this.generic_isBuiltin_);
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(PyFloatCheckExactNode.class)
@DenyReplace
private static final class Uncached extends PyFloatCheckExactNode {
@TruffleBoundary
@Override
public boolean execute(Node arg0Value, Object arg1Value) {
if (arg1Value instanceof Double) {
Double arg1Value_ = (Double) arg1Value;
return PyFloatCheckExactNode.doDouble(arg1Value_);
}
return PyFloatCheckExactNode.doGeneric(arg0Value, arg1Value, (IsBuiltinObjectProfile.getUncached()));
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy