All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.graal.python.lib.PyUnicodeReadCharNodeGen Maven / Gradle / Ivy

There is a newer version: 24.1.1
Show newest version
// 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.graal.python.nodes.util.CastToTruffleStringNode;
import com.oracle.graal.python.nodes.util.CastToTruffleStringNodeGen;
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;
import com.oracle.truffle.api.strings.TruffleString.CodePointAtIndexNode;
import com.oracle.truffle.api.strings.TruffleString.CodePointLengthNode;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyUnicodeReadCharNode#doGeneric}
 *     Activation probability: 1.00000
 *     With/without class size: 48/26 bytes
 * 
*/ @GeneratedBy(PyUnicodeReadCharNode.class) @SuppressWarnings("javadoc") public final class PyUnicodeReadCharNodeGen { private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PyUnicodeReadCharNode getUncached() { return PyUnicodeReadCharNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#castToStringNode__field1_} *
  • {@link Inlined#castToStringNode__field2_} *
  • {@link Inlined#castToStringNode__field3_} *
  • {@link Inlined#codePointLengthNode_} *
  • {@link Inlined#codePointAtIndexNode_} *
  • {@link Inlined#raiseNode__field1_} *
*/ @NeverDefault public static PyUnicodeReadCharNode inline(@RequiredField(bits = 10, 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) InlineTarget target) { return new PyUnicodeReadCharNodeGen.Inlined(target); } @GeneratedBy(PyUnicodeReadCharNode.class) @DenyReplace private static final class Inlined extends PyUnicodeReadCharNode { /** * State Info:
         *   0: SpecializationActive {@link PyUnicodeReadCharNode#doGeneric}
         *   1-8: InlinedCache
         *        Specialization: {@link PyUnicodeReadCharNode#doGeneric}
         *        Parameter: {@link CastToTruffleStringNode} castToStringNode
         *        Inline method: {@link CastToTruffleStringNodeGen#inline}
         *   9: InlinedCache
         *        Specialization: {@link PyUnicodeReadCharNode#doGeneric}
         *        Parameter: {@link Lazy} raiseNode
         *        Inline method: {@link LazyNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField castToStringNode__field1_; private final ReferenceField castToStringNode__field2_; private final ReferenceField castToStringNode__field3_; private final ReferenceField codePointLengthNode_; private final ReferenceField codePointAtIndexNode_; private final ReferenceField raiseNode__field1_; /** * Source Info:
         *   Specialization: {@link PyUnicodeReadCharNode#doGeneric}
         *   Parameter: {@link CastToTruffleStringNode} castToStringNode
         *   Inline method: {@link CastToTruffleStringNodeGen#inline}
*/ private final CastToTruffleStringNode castToStringNode_; /** * Source Info:
         *   Specialization: {@link PyUnicodeReadCharNode#doGeneric}
         *   Parameter: {@link Lazy} raiseNode
         *   Inline method: {@link LazyNodeGen#inline}
*/ private final Lazy raiseNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyUnicodeReadCharNode.class); this.state_0_ = target.getState(0, 10); this.castToStringNode__field1_ = target.getReference(1, Node.class); this.castToStringNode__field2_ = target.getReference(2, Node.class); this.castToStringNode__field3_ = target.getReference(3, Node.class); this.codePointLengthNode_ = target.getReference(4, CodePointLengthNode.class); this.codePointAtIndexNode_ = target.getReference(5, CodePointAtIndexNode.class); this.raiseNode__field1_ = target.getReference(6, Node.class); this.castToStringNode_ = CastToTruffleStringNodeGen.inline(InlineTarget.create(CastToTruffleStringNode.class, state_0_.subUpdater(1, 8), castToStringNode__field1_, castToStringNode__field2_, castToStringNode__field3_)); this.raiseNode_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(9, 1), raiseNode__field1_)); } @Override public int execute(Node arg0Value, Object arg1Value, long arg2Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyUnicodeReadCharNode.doGeneric(Node, Object, long, CastToTruffleStringNode, CodePointLengthNode, CodePointAtIndexNode, Lazy)] */) { { CodePointLengthNode codePointLengthNode__ = this.codePointLengthNode_.get(arg0Value); if (codePointLengthNode__ != null) { CodePointAtIndexNode codePointAtIndexNode__ = this.codePointAtIndexNode_.get(arg0Value); if (codePointAtIndexNode__ != null) { assert InlineSupport.validate(arg0Value, this.state_0_, this.castToStringNode__field1_, this.castToStringNode__field2_, this.castToStringNode__field3_, this.state_0_, this.raiseNode__field1_); return PyUnicodeReadCharNode.doGeneric(arg0Value, arg1Value, arg2Value, this.castToStringNode_, codePointLengthNode__, codePointAtIndexNode__, this.raiseNode_); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arg0Value, arg1Value, arg2Value); } private int executeAndSpecialize(Node arg0Value, Object arg1Value, long arg2Value) { int state_0 = this.state_0_.get(arg0Value); CodePointLengthNode codePointLengthNode__ = arg0Value.insert((CodePointLengthNode.create())); Objects.requireNonNull(codePointLengthNode__, "Specialization 'doGeneric(Node, Object, long, CastToTruffleStringNode, CodePointLengthNode, CodePointAtIndexNode, Lazy)' cache 'codePointLengthNode' 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.codePointLengthNode_.set(arg0Value, codePointLengthNode__); CodePointAtIndexNode codePointAtIndexNode__ = arg0Value.insert((CodePointAtIndexNode.create())); Objects.requireNonNull(codePointAtIndexNode__, "Specialization 'doGeneric(Node, Object, long, CastToTruffleStringNode, CodePointLengthNode, CodePointAtIndexNode, Lazy)' cache 'codePointAtIndexNode' 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.codePointAtIndexNode_.set(arg0Value, codePointAtIndexNode__); state_0 = state_0 | 0b1 /* add SpecializationActive[PyUnicodeReadCharNode.doGeneric(Node, Object, long, CastToTruffleStringNode, CodePointLengthNode, CodePointAtIndexNode, Lazy)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.castToStringNode__field1_, this.castToStringNode__field2_, this.castToStringNode__field3_, this.state_0_, this.raiseNode__field1_); return PyUnicodeReadCharNode.doGeneric(arg0Value, arg1Value, arg2Value, this.castToStringNode_, codePointLengthNode__, codePointAtIndexNode__, this.raiseNode_); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyUnicodeReadCharNode.class) @DenyReplace private static final class Uncached extends PyUnicodeReadCharNode { @TruffleBoundary @Override public int execute(Node arg0Value, Object arg1Value, long arg2Value) { return PyUnicodeReadCharNode.doGeneric(arg0Value, arg1Value, arg2Value, (CastToTruffleStringNode.getUncached()), (CodePointLengthNode.getUncached()), (CodePointAtIndexNode.getUncached()), (Lazy.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy