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

com.oracle.graal.python.lib.PyByteArrayCheckNodeGen 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.builtins.objects.bytes.PByteArray;
import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject;
import com.oracle.graal.python.nodes.classes.IsSubtypeNode;
import com.oracle.graal.python.nodes.object.GetClassNode;
import com.oracle.graal.python.nodes.object.GetClassNodeGen;
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 java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyByteArrayCheckNode#check(PByteArray)}
 *     Activation probability: 0.48333
 *     With/without class size: 9/0 bytes
 *   Specialization {@link PyByteArrayCheckNode#check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)}
 *     Activation probability: 0.33333
 *     With/without class size: 13/11 bytes
 *   Specialization {@link PyByteArrayCheckNode#check(Object)}
 *     Activation probability: 0.18333
 *     With/without class size: 6/0 bytes
 * 
*/ @GeneratedBy(PyByteArrayCheckNode.class) @SuppressWarnings({"javadoc", "unused"}) public final class PyByteArrayCheckNodeGen { private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PyByteArrayCheckNode getUncached() { return PyByteArrayCheckNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#check1_getClassNode__field1_} *
  • {@link Inlined#check1_isSubtypeNode_} *
*/ @NeverDefault public static PyByteArrayCheckNode inline(@RequiredField(bits = 20, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) { return new PyByteArrayCheckNodeGen.Inlined(target); } @GeneratedBy(PyByteArrayCheckNode.class) @DenyReplace private static final class Inlined extends PyByteArrayCheckNode { /** * State Info:
         *   0: SpecializationActive {@link PyByteArrayCheckNode#check(PByteArray)}
         *   1: SpecializationActive {@link PyByteArrayCheckNode#check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)}
         *   2: SpecializationActive {@link PyByteArrayCheckNode#check(Object)}
         *   3-19: InlinedCache
         *        Specialization: {@link PyByteArrayCheckNode#check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)}
         *        Parameter: {@link GetClassNode} getClassNode
         *        Inline method: {@link GetClassNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField check1_getClassNode__field1_; private final ReferenceField check1_isSubtypeNode_; /** * Source Info:
         *   Specialization: {@link PyByteArrayCheckNode#check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)}
         *   Parameter: {@link GetClassNode} getClassNode
         *   Inline method: {@link GetClassNodeGen#inline}
*/ private final GetClassNode check1_getClassNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyByteArrayCheckNode.class); this.state_0_ = target.getState(0, 20); this.check1_getClassNode__field1_ = target.getReference(1, Node.class); this.check1_isSubtypeNode_ = target.getReference(2, IsSubtypeNode.class); this.check1_getClassNode_ = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, state_0_.subUpdater(3, 17), check1_getClassNode__field1_)); } @SuppressWarnings("static-method") private boolean fallbackGuard_(int state_0, Node arg0Value, Object arg1Value) { if (!((state_0 & 0b1) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(PByteArray)] */) && arg1Value instanceof PByteArray) { return false; } if (!((state_0 & 0b10) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)] */) && arg1Value instanceof PythonAbstractNativeObject) { return false; } return true; } @Override public boolean execute(Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b111) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(PByteArray)] || SpecializationActive[PyByteArrayCheckNode.check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)] || SpecializationActive[PyByteArrayCheckNode.check(Object)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(PByteArray)] */ && arg1Value instanceof PByteArray) { PByteArray arg1Value_ = (PByteArray) arg1Value; return PyByteArrayCheckNode.check(arg1Value_); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)] */ && arg1Value instanceof PythonAbstractNativeObject) { PythonAbstractNativeObject arg1Value_ = (PythonAbstractNativeObject) arg1Value; { IsSubtypeNode isSubtypeNode__ = this.check1_isSubtypeNode_.get(arg0Value); if (isSubtypeNode__ != null) { assert InlineSupport.validate(arg0Value, this.state_0_, this.check1_getClassNode__field1_); return PyByteArrayCheckNode.check(arg0Value, arg1Value_, this.check1_getClassNode_, isSubtypeNode__); } } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PyByteArrayCheckNode.check(Object)] */) { if (fallbackGuard_(state_0, arg0Value, arg1Value)) { return PyByteArrayCheckNode.check(arg1Value); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arg0Value, arg1Value); } private boolean executeAndSpecialize(Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if (arg1Value instanceof PByteArray) { PByteArray arg1Value_ = (PByteArray) arg1Value; state_0 = state_0 | 0b1 /* add SpecializationActive[PyByteArrayCheckNode.check(PByteArray)] */; this.state_0_.set(arg0Value, state_0); return PyByteArrayCheckNode.check(arg1Value_); } if (arg1Value instanceof PythonAbstractNativeObject) { PythonAbstractNativeObject arg1Value_ = (PythonAbstractNativeObject) arg1Value; IsSubtypeNode isSubtypeNode__ = arg0Value.insert((IsSubtypeNode.create())); Objects.requireNonNull(isSubtypeNode__, "Specialization 'check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)' cache 'isSubtypeNode' 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.check1_isSubtypeNode_.set(arg0Value, isSubtypeNode__); state_0 = state_0 | 0b10 /* add SpecializationActive[PyByteArrayCheckNode.check(Node, PythonAbstractNativeObject, GetClassNode, IsSubtypeNode)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.check1_getClassNode__field1_); return PyByteArrayCheckNode.check(arg0Value, arg1Value_, this.check1_getClassNode_, isSubtypeNode__); } state_0 = state_0 | 0b100 /* add SpecializationActive[PyByteArrayCheckNode.check(Object)] */; this.state_0_.set(arg0Value, state_0); return PyByteArrayCheckNode.check(arg1Value); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyByteArrayCheckNode.class) @DenyReplace private static final class Uncached extends PyByteArrayCheckNode { @TruffleBoundary @Override public boolean execute(Node arg0Value, Object arg1Value) { if (arg1Value instanceof PByteArray) { PByteArray arg1Value_ = (PByteArray) arg1Value; return PyByteArrayCheckNode.check(arg1Value_); } if (arg1Value instanceof PythonAbstractNativeObject) { PythonAbstractNativeObject arg1Value_ = (PythonAbstractNativeObject) arg1Value; return PyByteArrayCheckNode.check(arg0Value, arg1Value_, (GetClassNode.getUncached()), (IsSubtypeNode.getUncached())); } return PyByteArrayCheckNode.check(arg1Value); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy