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

com.oracle.graal.python.lib.PyTraceBackPrintNodeGen 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.module.PythonModule;
import com.oracle.graal.python.builtins.objects.traceback.PTraceback;
import com.oracle.graal.python.builtins.objects.traceback.TracebackBuiltins.GetTracebackFrameNode;
import com.oracle.graal.python.builtins.objects.traceback.TracebackBuiltins.MaterializeTruffleStacktraceNode;
import com.oracle.graal.python.builtins.objects.traceback.TracebackBuiltinsFactory.MaterializeTruffleStacktraceNodeGen;
import com.oracle.graal.python.nodes.PGuards;
import com.oracle.graal.python.nodes.PRaiseNode;
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.strings.TruffleString.EqualNode;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
 *     Activation probability: 0.65000
 *     With/without class size: 32/25 bytes
 *   Specialization {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)}
 *     Activation probability: 0.35000
 *     With/without class size: 11/4 bytes
 * 
*/ @GeneratedBy(PyTraceBackPrintNode.class) @SuppressWarnings("javadoc") public final class PyTraceBackPrintNodeGen extends PyTraceBackPrintNode { private static final StateField STATE_0_PyTraceBackPrintNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link MaterializeTruffleStacktraceNode} materializeStNode
     *   Inline method: {@link MaterializeTruffleStacktraceNodeGen#inline}
*/ private static final MaterializeTruffleStacktraceNode INLINED_PRINT_TRACE_BACK0_MATERIALIZE_ST_NODE_ = MaterializeTruffleStacktraceNodeGen.inline(InlineTarget.create(MaterializeTruffleStacktraceNode.class, STATE_0_PyTraceBackPrintNode_UPDATER.subUpdater(2, 4), ReferenceField.create(MethodHandles.lookup(), "printTraceBack0_materializeStNode__field1_", Node.class), ReferenceField.create(MethodHandles.lookup(), "printTraceBack0_materializeStNode__field2_", Node.class), ReferenceField.create(MethodHandles.lookup(), "printTraceBack0_materializeStNode__field3_", Node.class))); /** * State Info:
     *   0: SpecializationActive {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   1: SpecializationActive {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)}
     *   2-5: InlinedCache
     *        Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *        Parameter: {@link MaterializeTruffleStacktraceNode} materializeStNode
     *        Inline method: {@link MaterializeTruffleStacktraceNodeGen#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link GetTracebackFrameNode} getTbFrameNode
*/ @Child private GetTracebackFrameNode printTraceBack0_getTbFrameNode_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link MaterializeTruffleStacktraceNode} materializeStNode
     *   Inline method: {@link MaterializeTruffleStacktraceNodeGen#inline}
     *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node printTraceBack0_materializeStNode__field1_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link MaterializeTruffleStacktraceNode} materializeStNode
     *   Inline method: {@link MaterializeTruffleStacktraceNodeGen#inline}
     *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node printTraceBack0_materializeStNode__field2_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link MaterializeTruffleStacktraceNode} materializeStNode
     *   Inline method: {@link MaterializeTruffleStacktraceNodeGen#inline}
     *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node printTraceBack0_materializeStNode__field3_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link PythonObjectFactory} factory
*/ @Child private PythonObjectFactory printTraceBack0_factory_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)}
     *   Parameter: {@link EqualNode} equalNode
*/ @Child private EqualNode printTraceBack0_equalNode_; /** * Source Info:
     *   Specialization: {@link PyTraceBackPrintNode#printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)}
     *   Parameter: {@link PRaiseNode} raiseNode
*/ @Child private PRaiseNode printTraceBack1_raiseNode_; private PyTraceBackPrintNodeGen() { } @Override public void execute(VirtualFrame frameValue, PythonModule arg0Value, Object arg1Value, Object arg2Value) { int state_0 = this.state_0_; if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)] || SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)] */ && arg2Value instanceof PTraceback) { PTraceback arg2Value_ = (PTraceback) arg2Value; { GetTracebackFrameNode getTbFrameNode__ = this.printTraceBack0_getTbFrameNode_; if (getTbFrameNode__ != null) { PythonObjectFactory factory__ = this.printTraceBack0_factory_; if (factory__ != null) { EqualNode equalNode__ = this.printTraceBack0_equalNode_; if (equalNode__ != null) { Node inliningTarget__ = (this); printTraceBack(frameValue, arg0Value, arg1Value, arg2Value_, inliningTarget__, getTbFrameNode__, INLINED_PRINT_TRACE_BACK0_MATERIALIZE_ST_NODE_, factory__, equalNode__); return; } } } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)] */) { { PRaiseNode raiseNode__ = this.printTraceBack1_raiseNode_; if (raiseNode__ != null) { if ((!(PGuards.isPTraceback(arg2Value)))) { printTraceBack(frameValue, arg0Value, arg1Value, arg2Value, raiseNode__); return; } } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value); return; } private void executeAndSpecialize(VirtualFrame frameValue, PythonModule arg0Value, Object arg1Value, Object arg2Value) { int state_0 = this.state_0_; { Node inliningTarget__ = null; if (arg2Value instanceof PTraceback) { PTraceback arg2Value_ = (PTraceback) arg2Value; inliningTarget__ = (this); GetTracebackFrameNode getTbFrameNode__ = this.insert((GetTracebackFrameNode.create())); Objects.requireNonNull(getTbFrameNode__, "Specialization 'printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)' cache 'getTbFrameNode' 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.printTraceBack0_getTbFrameNode_ = getTbFrameNode__; PythonObjectFactory factory__ = this.insert((PythonObjectFactory.create())); Objects.requireNonNull(factory__, "Specialization 'printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)' cache 'factory' 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.printTraceBack0_factory_ = factory__; EqualNode equalNode__ = this.insert((EqualNode.create())); Objects.requireNonNull(equalNode__, "Specialization 'printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)' cache 'equalNode' 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.printTraceBack0_equalNode_ = equalNode__; state_0 = state_0 | 0b1 /* add SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, PTraceback, Node, GetTracebackFrameNode, MaterializeTruffleStacktraceNode, PythonObjectFactory, EqualNode)] */; this.state_0_ = state_0; printTraceBack(frameValue, arg0Value, arg1Value, arg2Value_, inliningTarget__, getTbFrameNode__, INLINED_PRINT_TRACE_BACK0_MATERIALIZE_ST_NODE_, factory__, equalNode__); return; } } if ((!(PGuards.isPTraceback(arg2Value)))) { PRaiseNode raiseNode__ = this.insert((PRaiseNode.create())); Objects.requireNonNull(raiseNode__, "Specialization 'printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)' cache 'raiseNode' 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.printTraceBack1_raiseNode_ = raiseNode__; state_0 = state_0 | 0b10 /* add SpecializationActive[PyTraceBackPrintNode.printTraceBack(VirtualFrame, PythonModule, Object, Object, PRaiseNode)] */; this.state_0_ = state_0; printTraceBack(frameValue, arg0Value, arg1Value, arg2Value, raiseNode__); return; } throw new UnsupportedSpecializationException(this, new Node[] {null, null, null}, arg0Value, arg1Value, arg2Value); } @Override public NodeCost getCost() { int state_0 = this.state_0_; if ((state_0 & 0b11) == 0) { return NodeCost.UNINITIALIZED; } else { if (((state_0 & 0b11) & ((state_0 & 0b11) - 1)) == 0 /* is-single */) { return NodeCost.MONOMORPHIC; } } return NodeCost.POLYMORPHIC; } @NeverDefault public static PyTraceBackPrintNode create() { return new PyTraceBackPrintNodeGen(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy