com.oracle.graal.python.lib.PyFloatFromStringNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.builtins.objects.buffer.BufferAcquireGenerateUncachedNode;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.graal.python.nodes.util.CastToJavaStringNode;
import com.oracle.graal.python.nodes.util.CastToJavaStringNodeGen;
import com.oracle.truffle.api.CompilerDirectives;
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.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;
import com.oracle.truffle.api.strings.TruffleString;
import com.oracle.truffle.api.strings.TruffleString.ToJavaStringNode;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link PyFloatFromString#doString}
* Activation probability: 0.65000
* With/without class size: 17/4 bytes
* Specialization {@link PyFloatFromString#doGeneric}
* Activation probability: 0.35000
* With/without class size: 12/8 bytes
*
*/
@GeneratedBy(PyFloatFromString.class)
@SuppressWarnings("javadoc")
public final class PyFloatFromStringNodeGen {
private static final Uncached UNCACHED = new Uncached();
@NeverDefault
public static PyFloatFromString getUncached() {
return PyFloatFromStringNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#state_1_}
*
- {@link Inlined#reprNode_field1_}
*
- {@link Inlined#reprNode_field2_}
*
- {@link Inlined#reprNode_field3_}
*
- {@link Inlined#reprNode_field4_}
*
- {@link Inlined#reprNode_field5_}
*
- {@link Inlined#reprNode_field6_}
*
- {@link Inlined#reprNode_field7_}
*
- {@link Inlined#reprNode_field8_}
*
- {@link Inlined#raiseNode_field1_}
*
- {@link Inlined#string_toJavaStringNode_}
*
- {@link Inlined#generic_acquireNode_}
*
- {@link Inlined#generic_cast_}
*
*/
@NeverDefault
public static PyFloatFromString inline(@RequiredField(bits = 3, value = StateField.class)@RequiredField(bits = 31, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyFloatFromStringNodeGen.Inlined(target);
}
@GeneratedBy(PyFloatFromString.class)
@DenyReplace
private static final class Inlined extends PyFloatFromString {
/**
* State Info:
* 0: SpecializationActive {@link PyFloatFromString#doString}
* 1: SpecializationActive {@link PyFloatFromString#doGeneric}
* 2: InlinedCache
* Specialization: {@link PyFloatFromString#doString}
* Parameter: {@link Lazy} raiseNode
* Inline method: {@link LazyNodeGen#inline}
*
*/
private final StateField state_0_;
/**
* State Info:
* 0-30: InlinedCache
* Specialization: {@link PyFloatFromString#doString}
* Parameter: {@link PyObjectReprAsTruffleStringNode} reprNode
* Inline method: {@link PyObjectReprAsTruffleStringNodeGen#inline}
*
*/
private final StateField state_1_;
private final ReferenceField reprNode_field1_;
private final ReferenceField reprNode_field2_;
private final ReferenceField reprNode_field3_;
private final ReferenceField reprNode_field4_;
private final ReferenceField reprNode_field5_;
private final ReferenceField reprNode_field6_;
private final ReferenceField reprNode_field7_;
private final ReferenceField reprNode_field8_;
private final ReferenceField raiseNode_field1_;
private final ReferenceField string_toJavaStringNode_;
private final ReferenceField generic_acquireNode_;
private final ReferenceField generic_cast_;
/**
* Source Info:
* Specialization: {@link PyFloatFromString#doString}
* Parameter: {@link PyObjectReprAsTruffleStringNode} reprNode
* Inline method: {@link PyObjectReprAsTruffleStringNodeGen#inline}
*/
private final PyObjectReprAsTruffleStringNode reprNode;
/**
* Source Info:
* Specialization: {@link PyFloatFromString#doString}
* Parameter: {@link Lazy} raiseNode
* Inline method: {@link LazyNodeGen#inline}
*/
private final Lazy raiseNode;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyFloatFromString.class);
this.state_0_ = target.getState(0, 3);
this.state_1_ = target.getState(1, 31);
this.reprNode_field1_ = target.getReference(2, Node.class);
this.reprNode_field2_ = target.getReference(3, Node.class);
this.reprNode_field3_ = target.getReference(4, Node.class);
this.reprNode_field4_ = target.getReference(5, Node.class);
this.reprNode_field5_ = target.getReference(6, Node.class);
this.reprNode_field6_ = target.getReference(7, Node.class);
this.reprNode_field7_ = target.getReference(8, Node.class);
this.reprNode_field8_ = target.getReference(9, Node.class);
this.raiseNode_field1_ = target.getReference(10, Node.class);
this.string_toJavaStringNode_ = target.getReference(11, ToJavaStringNode.class);
this.generic_acquireNode_ = target.getReference(12, BufferAcquireGenerateUncachedNode.class);
this.generic_cast_ = target.getReference(13, CastToJavaStringNode.class);
this.reprNode = PyObjectReprAsTruffleStringNodeGen.inline(InlineTarget.create(PyObjectReprAsTruffleStringNode.class, state_1_.subUpdater(0, 31), reprNode_field1_, reprNode_field2_, reprNode_field3_, reprNode_field4_, reprNode_field5_, reprNode_field6_, reprNode_field7_, reprNode_field8_));
this.raiseNode = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(2, 1), raiseNode_field1_));
}
@Override
public double execute(Frame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyFloatFromString.doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] || SpecializationActive[PyFloatFromString.doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyFloatFromString.doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */ && arg1Value instanceof TruffleString) {
TruffleString arg1Value_ = (TruffleString) arg1Value;
{
ToJavaStringNode toJavaStringNode__ = this.string_toJavaStringNode_.get(arg0Value);
if (toJavaStringNode__ != null) {
return PyFloatFromString.doString((VirtualFrame) frameValue, arg0Value, arg1Value_, toJavaStringNode__, this.reprNode, this.raiseNode);
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyFloatFromString.doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */) {
{
BufferAcquireGenerateUncachedNode acquireNode__ = this.generic_acquireNode_.get(arg0Value);
if (acquireNode__ != null) {
CastToJavaStringNode cast__ = this.generic_cast_.get(arg0Value);
if (cast__ != null) {
return PyFloatFromString.doGeneric((VirtualFrame) frameValue, arg0Value, arg1Value, acquireNode__, cast__, this.reprNode, this.raiseNode);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value);
}
@Override
public double execute(Frame frameValue, Node arg0Value, TruffleString arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyFloatFromString.doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] || SpecializationActive[PyFloatFromString.doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyFloatFromString.doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */) {
{
ToJavaStringNode toJavaStringNode__ = this.string_toJavaStringNode_.get(arg0Value);
if (toJavaStringNode__ != null) {
return PyFloatFromString.doString((VirtualFrame) frameValue, arg0Value, arg1Value, toJavaStringNode__, this.reprNode, this.raiseNode);
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyFloatFromString.doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */) {
{
BufferAcquireGenerateUncachedNode acquireNode__ = this.generic_acquireNode_.get(arg0Value);
if (acquireNode__ != null) {
CastToJavaStringNode cast__ = this.generic_cast_.get(arg0Value);
if (cast__ != null) {
return PyFloatFromString.doGeneric((VirtualFrame) frameValue, arg0Value, arg1Value, acquireNode__, cast__, this.reprNode, this.raiseNode);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value);
}
private double executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof TruffleString) {
TruffleString arg1Value_ = (TruffleString) arg1Value;
ToJavaStringNode toJavaStringNode__ = arg0Value.insert((ToJavaStringNode.create()));
Objects.requireNonNull(toJavaStringNode__, "Specialization 'doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)' cache 'toJavaStringNode' returned a 'null' 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 'null'.");
VarHandle.storeStoreFence();
this.string_toJavaStringNode_.set(arg0Value, toJavaStringNode__);
state_0 = state_0 | 0b1 /* add SpecializationActive[PyFloatFromString.doString(VirtualFrame, Node, TruffleString, ToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */;
this.state_0_.set(arg0Value, state_0);
return PyFloatFromString.doString((VirtualFrame) frameValue, arg0Value, arg1Value_, toJavaStringNode__, this.reprNode, this.raiseNode);
}
BufferAcquireGenerateUncachedNode acquireNode__ = arg0Value.insert((BufferAcquireGenerateUncachedNode.create(3)));
Objects.requireNonNull(acquireNode__, "Specialization 'doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)' cache 'acquireNode' returned a 'null' 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 'null'.");
VarHandle.storeStoreFence();
this.generic_acquireNode_.set(arg0Value, acquireNode__);
CastToJavaStringNode cast__ = arg0Value.insert((CastToJavaStringNodeGen.create()));
Objects.requireNonNull(cast__, "Specialization 'doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)' cache 'cast' returned a 'null' 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 'null'.");
VarHandle.storeStoreFence();
this.generic_cast_.set(arg0Value, cast__);
state_0 = state_0 | 0b10 /* add SpecializationActive[PyFloatFromString.doGeneric(VirtualFrame, Node, Object, BufferAcquireGenerateUncachedNode, CastToJavaStringNode, PyObjectReprAsTruffleStringNode, Lazy)] */;
this.state_0_.set(arg0Value, state_0);
return PyFloatFromString.doGeneric((VirtualFrame) frameValue, arg0Value, arg1Value, acquireNode__, cast__, this.reprNode, this.raiseNode);
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(PyFloatFromString.class)
@DenyReplace
private static final class Uncached extends PyFloatFromString {
@Override
public double execute(Frame frameValue, Node arg0Value, Object arg1Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
if (arg1Value instanceof TruffleString) {
TruffleString arg1Value_ = (TruffleString) arg1Value;
return PyFloatFromString.doString((VirtualFrame) frameValue, arg0Value, arg1Value_, (ToJavaStringNode.getUncached()), (PyObjectReprAsTruffleStringNodeGen.getUncached()), (Lazy.getUncached()));
}
return PyFloatFromString.doGeneric((VirtualFrame) frameValue, arg0Value, arg1Value, (BufferAcquireGenerateUncachedNode.getUncached(3)), (CastToJavaStringNode.getUncached()), (PyObjectReprAsTruffleStringNodeGen.getUncached()), (Lazy.getUncached()));
}
@Override
public double execute(Frame frameValue, Node arg0Value, TruffleString arg1Value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return PyFloatFromString.doString((VirtualFrame) frameValue, arg0Value, arg1Value, (ToJavaStringNode.getUncached()), (PyObjectReprAsTruffleStringNodeGen.getUncached()), (Lazy.getUncached()));
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy