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

com.oracle.graal.python.lib.PyObjectDirNodeGen 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.list.PList;
import com.oracle.graal.python.builtins.objects.list.ListBuiltins.ListSortNode;
import com.oracle.graal.python.nodes.SpecialMethodNames;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.graal.python.nodes.builtins.ListNodes.ConstructListNode;
import com.oracle.graal.python.nodes.call.special.LookupAndCallUnaryNode;
import com.oracle.truffle.api.CompilerDirectives;
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.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyObjectDir#dir}
 *     Activation probability: 1.00000
 *     With/without class size: 40/17 bytes
 * 
*/ @GeneratedBy(PyObjectDir.class) @SuppressWarnings("javadoc") public final class PyObjectDirNodeGen { /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#sortNode_} *
  • {@link Inlined#constructListNode_} *
  • {@link Inlined#callDir_} *
  • {@link Inlined#raiseNode__field1_} *
*/ @NeverDefault public static PyObjectDir inline(@RequiredField(bits = 2, 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) InlineTarget target) { return new PyObjectDirNodeGen.Inlined(target); } @GeneratedBy(PyObjectDir.class) @DenyReplace private static final class Inlined extends PyObjectDir { /** * State Info:
         *   0: SpecializationActive {@link PyObjectDir#dir}
         *   1: InlinedCache
         *        Specialization: {@link PyObjectDir#dir}
         *        Parameter: {@link Lazy} raiseNode
         *        Inline method: {@link LazyNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField sortNode_; private final ReferenceField constructListNode_; private final ReferenceField callDir_; private final ReferenceField raiseNode__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectDir#dir}
         *   Parameter: {@link Lazy} raiseNode
         *   Inline method: {@link LazyNodeGen#inline}
*/ private final Lazy raiseNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyObjectDir.class); this.state_0_ = target.getState(0, 2); this.sortNode_ = target.getReference(1, ListSortNode.class); this.constructListNode_ = target.getReference(2, ConstructListNode.class); this.callDir_ = target.getReference(3, LookupAndCallUnaryNode.class); this.raiseNode__field1_ = target.getReference(4, Node.class); this.raiseNode_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(1, 1), raiseNode__field1_)); } @Override public PList execute(VirtualFrame frameValue, Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectDir.dir(VirtualFrame, Node, Object, ListSortNode, ConstructListNode, LookupAndCallUnaryNode, Lazy)] */) { { ListSortNode sortNode__ = this.sortNode_.get(arg0Value); if (sortNode__ != null) { ConstructListNode constructListNode__ = this.constructListNode_.get(arg0Value); if (constructListNode__ != null) { LookupAndCallUnaryNode callDir__ = this.callDir_.get(arg0Value); if (callDir__ != null) { assert InlineSupport.validate(arg0Value, this.state_0_, this.raiseNode__field1_); return PyObjectDir.dir(frameValue, arg0Value, arg1Value, sortNode__, constructListNode__, callDir__, this.raiseNode_); } } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value); } private PList executeAndSpecialize(VirtualFrame frameValue, Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); ListSortNode sortNode__ = arg0Value.insert((ListSortNode.create())); Objects.requireNonNull(sortNode__, "Specialization 'dir(VirtualFrame, Node, Object, ListSortNode, ConstructListNode, LookupAndCallUnaryNode, Lazy)' cache 'sortNode' 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.sortNode_.set(arg0Value, sortNode__); ConstructListNode constructListNode__ = arg0Value.insert((ConstructListNode.create())); Objects.requireNonNull(constructListNode__, "Specialization 'dir(VirtualFrame, Node, Object, ListSortNode, ConstructListNode, LookupAndCallUnaryNode, Lazy)' cache 'constructListNode' 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.constructListNode_.set(arg0Value, constructListNode__); LookupAndCallUnaryNode callDir__ = arg0Value.insert((LookupAndCallUnaryNode.create(SpecialMethodNames.T___DIR__))); Objects.requireNonNull(callDir__, "Specialization 'dir(VirtualFrame, Node, Object, ListSortNode, ConstructListNode, LookupAndCallUnaryNode, Lazy)' cache 'callDir' 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.callDir_.set(arg0Value, callDir__); state_0 = state_0 | 0b1 /* add SpecializationActive[PyObjectDir.dir(VirtualFrame, Node, Object, ListSortNode, ConstructListNode, LookupAndCallUnaryNode, Lazy)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.raiseNode__field1_); return PyObjectDir.dir(frameValue, arg0Value, arg1Value, sortNode__, constructListNode__, callDir__, this.raiseNode_); } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy