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

com.oracle.graal.python.lib.PyExceptionInstanceCheckNodeGen 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.exception.PBaseException;
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 PyExceptionInstanceCheckNode#doManaged}
 *     Activation probability: 0.65000
 *     With/without class size: 11/0 bytes
 *   Specialization {@link PyExceptionInstanceCheckNode#doOther}
 *     Activation probability: 0.35000
 *     With/without class size: 13/11 bytes
 * 
*/ @GeneratedBy(PyExceptionInstanceCheckNode.class) @SuppressWarnings({"javadoc", "unused"}) public final class PyExceptionInstanceCheckNodeGen { private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PyExceptionInstanceCheckNode getUncached() { return PyExceptionInstanceCheckNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#fallback_getClassNode__field1_} *
  • {@link Inlined#fallback_isSubtypeNode_} *
*/ @NeverDefault public static PyExceptionInstanceCheckNode inline(@RequiredField(bits = 19, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) { return new PyExceptionInstanceCheckNodeGen.Inlined(target); } @GeneratedBy(PyExceptionInstanceCheckNode.class) @DenyReplace private static final class Inlined extends PyExceptionInstanceCheckNode { /** * State Info:
         *   0: SpecializationActive {@link PyExceptionInstanceCheckNode#doManaged}
         *   1: SpecializationActive {@link PyExceptionInstanceCheckNode#doOther}
         *   2-18: InlinedCache
         *        Specialization: {@link PyExceptionInstanceCheckNode#doOther}
         *        Parameter: {@link GetClassNode} getClassNode
         *        Inline method: {@link GetClassNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField fallback_getClassNode__field1_; private final ReferenceField fallback_isSubtypeNode_; /** * Source Info:
         *   Specialization: {@link PyExceptionInstanceCheckNode#doOther}
         *   Parameter: {@link GetClassNode} getClassNode
         *   Inline method: {@link GetClassNodeGen#inline}
*/ private final GetClassNode fallback_getClassNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyExceptionInstanceCheckNode.class); this.state_0_ = target.getState(0, 19); this.fallback_getClassNode__field1_ = target.getReference(1, Node.class); this.fallback_isSubtypeNode_ = target.getReference(2, IsSubtypeNode.class); this.fallback_getClassNode_ = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, state_0_.subUpdater(2, 17), fallback_getClassNode__field1_)); } @SuppressWarnings("static-method") private boolean fallbackGuard_(int state_0, Node arg0Value, Object arg1Value) { if (!((state_0 & 0b1) != 0 /* is SpecializationActive[PyExceptionInstanceCheckNode.doManaged(PBaseException)] */) && arg1Value instanceof PBaseException) { return false; } return true; } @Override public boolean execute(Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyExceptionInstanceCheckNode.doManaged(PBaseException)] || SpecializationActive[PyExceptionInstanceCheckNode.doOther(Node, Object, GetClassNode, IsSubtypeNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyExceptionInstanceCheckNode.doManaged(PBaseException)] */ && arg1Value instanceof PBaseException) { PBaseException arg1Value_ = (PBaseException) arg1Value; return PyExceptionInstanceCheckNode.doManaged(arg1Value_); } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyExceptionInstanceCheckNode.doOther(Node, Object, GetClassNode, IsSubtypeNode)] */) { { IsSubtypeNode isSubtypeNode__ = this.fallback_isSubtypeNode_.get(arg0Value); if (isSubtypeNode__ != null) { if (fallbackGuard_(state_0, arg0Value, arg1Value)) { assert InlineSupport.validate(arg0Value, this.state_0_, this.fallback_getClassNode__field1_); return PyExceptionInstanceCheckNode.doOther(arg0Value, arg1Value, this.fallback_getClassNode_, isSubtypeNode__); } } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arg0Value, arg1Value); } private boolean executeAndSpecialize(Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if (arg1Value instanceof PBaseException) { PBaseException arg1Value_ = (PBaseException) arg1Value; state_0 = state_0 | 0b1 /* add SpecializationActive[PyExceptionInstanceCheckNode.doManaged(PBaseException)] */; this.state_0_.set(arg0Value, state_0); return PyExceptionInstanceCheckNode.doManaged(arg1Value_); } IsSubtypeNode isSubtypeNode__ = arg0Value.insert((IsSubtypeNode.create())); Objects.requireNonNull(isSubtypeNode__, "Specialization 'doOther(Node, Object, 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.fallback_isSubtypeNode_.set(arg0Value, isSubtypeNode__); state_0 = state_0 | 0b10 /* add SpecializationActive[PyExceptionInstanceCheckNode.doOther(Node, Object, GetClassNode, IsSubtypeNode)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.fallback_getClassNode__field1_); return PyExceptionInstanceCheckNode.doOther(arg0Value, arg1Value, this.fallback_getClassNode_, isSubtypeNode__); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyExceptionInstanceCheckNode.class) @DenyReplace private static final class Uncached extends PyExceptionInstanceCheckNode { @TruffleBoundary @Override public boolean execute(Node arg0Value, Object arg1Value) { if (arg1Value instanceof PBaseException) { PBaseException arg1Value_ = (PBaseException) arg1Value; return PyExceptionInstanceCheckNode.doManaged(arg1Value_); } return PyExceptionInstanceCheckNode.doOther(arg0Value, arg1Value, (GetClassNode.getUncached()), (IsSubtypeNode.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy