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

com.oracle.graal.python.lib.PyUnicodeDecodeNodeGen 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.modules.CodecsModuleBuiltins.DecodeNode;
import com.oracle.graal.python.builtins.modules.CodecsModuleBuiltinsFactory.DecodeNodeFactory;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
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.InlineSupport;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.DSLSupport.SpecializationDataNode;
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.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
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.MethodHandles;
import java.lang.invoke.VarHandle;
import java.lang.invoke.MethodHandles.Lookup;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyUnicodeDecode#doFast}
 *     Activation probability: 0.65000
 *     With/without class size: 22/9 bytes
 *   Specialization {@link PyUnicodeDecode#doWithCall}
 *     Activation probability: 0.35000
 *     With/without class size: 30/58 bytes
 * 
*/ @GeneratedBy(PyUnicodeDecode.class) @SuppressWarnings("javadoc") public final class PyUnicodeDecodeNodeGen { private static final StateField WITH_CALL__PY_UNICODE_DECODE_WITH_CALL_STATE_0_UPDATER = StateField.create(WithCallData.lookup_(), "withCall_state_0_"); private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PyUnicodeDecode getUncached() { return PyUnicodeDecodeNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#fast_decodeNode_} *
  • {@link Inlined#fast_raiseNode__field1_} *
  • {@link Inlined#withCall_cache} *
*/ @NeverDefault public static PyUnicodeDecode inline(@RequiredField(bits = 3, value = StateField.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 PyUnicodeDecodeNodeGen.Inlined(target); } @GeneratedBy(PyUnicodeDecode.class) @DenyReplace private static final class Inlined extends PyUnicodeDecode { /** * State Info:
         *   0: SpecializationActive {@link PyUnicodeDecode#doFast}
         *   1: SpecializationActive {@link PyUnicodeDecode#doWithCall}
         *   2: InlinedCache
         *        Specialization: {@link PyUnicodeDecode#doFast}
         *        Parameter: {@link Lazy} raiseNode
         *        Inline method: {@link LazyNodeGen#inline}
         * 
*/ private final StateField state_0_; private final ReferenceField fast_decodeNode_; private final ReferenceField fast_raiseNode__field1_; private final ReferenceField withCall_cache; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doFast}
         *   Parameter: {@link Lazy} raiseNode
         *   Inline method: {@link LazyNodeGen#inline}
*/ private final Lazy fast_raiseNode_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
*/ private final PyObjectCallMethodObjArgs withCall_callNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyUnicodeDecode.class); this.state_0_ = target.getState(0, 3); this.fast_decodeNode_ = target.getReference(1, DecodeNode.class); this.fast_raiseNode__field1_ = target.getReference(2, Node.class); this.withCall_cache = target.getReference(3, WithCallData.class); this.fast_raiseNode_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(2, 1), fast_raiseNode__field1_)); this.withCall_callNode_ = PyObjectCallMethodObjArgsNodeGen.inline(InlineTarget.create(PyObjectCallMethodObjArgs.class, WITH_CALL__PY_UNICODE_DECODE_WITH_CALL_STATE_0_UPDATER.subUpdater(0, 10), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field1_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field2_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field3_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field4_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field5_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field6_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field7_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field8_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field9_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field10_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field11_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field12_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field13_", Node.class), ReferenceField.create(WithCallData.lookup_(), "withCall_callNode__field14_", Node.class))); } @Override public Object execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value, Object arg3Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b11) != 0 /* is SpecializationActive[PyUnicodeDecode.doFast(VirtualFrame, Node, Object, Object, Object, DecodeNode, Lazy)] || SpecializationActive[PyUnicodeDecode.doWithCall(Node, Object, Object, Object, PyObjectCallMethodObjArgs)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyUnicodeDecode.doFast(VirtualFrame, Node, Object, Object, Object, DecodeNode, Lazy)] */) { { DecodeNode decodeNode__ = this.fast_decodeNode_.get(arg0Value); if (decodeNode__ != null) { if ((((VirtualFrame) frameValue) != null)) { assert InlineSupport.validate(arg0Value, this.state_0_, this.fast_raiseNode__field1_); return PyUnicodeDecode.doFast((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, arg3Value, decodeNode__, this.fast_raiseNode_); } } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyUnicodeDecode.doWithCall(Node, Object, Object, Object, PyObjectCallMethodObjArgs)] */) { WithCallData s1_ = this.withCall_cache.get(arg0Value); if (s1_ != null) { return PyUnicodeDecode.doWithCall(s1_, arg1Value, arg2Value, arg3Value, this.withCall_callNode_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value, arg2Value, arg3Value); } private Object executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value, Object arg3Value) { int state_0 = this.state_0_.get(arg0Value); if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[PyUnicodeDecode.doWithCall(Node, Object, Object, Object, PyObjectCallMethodObjArgs)] */) { if ((((VirtualFrame) frameValue) != null)) { DecodeNode decodeNode__ = arg0Value.insert((DecodeNodeFactory.create())); Objects.requireNonNull(decodeNode__, "Specialization 'doFast(VirtualFrame, Node, Object, Object, Object, DecodeNode, Lazy)' cache 'decodeNode' 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.fast_decodeNode_.set(arg0Value, decodeNode__); state_0 = state_0 | 0b1 /* add SpecializationActive[PyUnicodeDecode.doFast(VirtualFrame, Node, Object, Object, Object, DecodeNode, Lazy)] */; this.state_0_.set(arg0Value, state_0); assert InlineSupport.validate(arg0Value, this.state_0_, this.fast_raiseNode__field1_); return PyUnicodeDecode.doFast((VirtualFrame) frameValue, arg0Value, arg1Value, arg2Value, arg3Value, decodeNode__, this.fast_raiseNode_); } } WithCallData s1_ = arg0Value.insert(new WithCallData()); VarHandle.storeStoreFence(); this.withCall_cache.set(arg0Value, s1_); this.fast_decodeNode_.set(arg0Value, null); state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PyUnicodeDecode.doFast(VirtualFrame, Node, Object, Object, Object, DecodeNode, Lazy)] */; state_0 = state_0 | 0b10 /* add SpecializationActive[PyUnicodeDecode.doWithCall(Node, Object, Object, Object, PyObjectCallMethodObjArgs)] */; this.state_0_.set(arg0Value, state_0); return PyUnicodeDecode.doWithCall(s1_, arg1Value, arg2Value, arg3Value, this.withCall_callNode_); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyUnicodeDecode.class) @DenyReplace private static final class WithCallData extends Node implements SpecializationDataNode { /** * State Info:
         *   0-9: InlinedCache
         *        Specialization: {@link PyUnicodeDecode#doWithCall}
         *        Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *        Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         * 
*/ @CompilationFinal @UnsafeAccessedField private int withCall_state_0_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field1_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field2_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field3_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field4
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field4_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field5
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field5_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field6
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field6_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field7
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field7_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field8
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field8_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field9
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field9_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field10
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field10_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field11
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field11_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field12
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field12_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field13
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field13_; /** * Source Info:
         *   Specialization: {@link PyUnicodeDecode#doWithCall}
         *   Parameter: {@link PyObjectCallMethodObjArgs} callNode
         *   Inline method: {@link PyObjectCallMethodObjArgsNodeGen#inline}
         *   Inline field: {@link Node} field14
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node withCall_callNode__field14_; WithCallData() { } @Override public NodeCost getCost() { return NodeCost.NONE; } private static Lookup lookup_() { return MethodHandles.lookup(); } } @GeneratedBy(PyUnicodeDecode.class) @DenyReplace private static final class Uncached extends PyUnicodeDecode { @Override public Object execute(Frame frameValue, Node arg0Value, Object arg1Value, Object arg2Value, Object arg3Value) { CompilerDirectives.transferToInterpreterAndInvalidate(); return PyUnicodeDecode.doWithCall(arg0Value, arg1Value, arg2Value, arg3Value, (PyObjectCallMethodObjArgs.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy