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

com.oracle.graal.python.lib.PyObjectHashNodeGen 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.str.PString;
import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
import com.oracle.graal.python.nodes.PGuards;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
import com.oracle.graal.python.nodes.attributes.LookupCallableSlotInMRONode;
import com.oracle.graal.python.nodes.call.special.CallUnaryMethodNode;
import com.oracle.graal.python.nodes.call.special.MaybeBindDescriptorNode;
import com.oracle.graal.python.nodes.call.special.MaybeBindDescriptorNodeGen;
import com.oracle.graal.python.nodes.object.GetClassNode;
import com.oracle.graal.python.nodes.object.GetClassNodeGen;
import com.oracle.graal.python.nodes.object.GetClassNode.GetPythonObjectClassNode;
import com.oracle.graal.python.nodes.object.GetClassNodeGen.GetPythonObjectClassNodeGen;
import com.oracle.graal.python.nodes.util.CastToTruffleStringNode;
import com.oracle.graal.python.nodes.util.CastToTruffleStringNodeGen;
import com.oracle.graal.python.nodes.util.CastUnsignedToJavaLongHashNode;
import com.oracle.graal.python.nodes.util.CastUnsignedToJavaLongHashNodeGen;
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.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 com.oracle.truffle.api.strings.TruffleString;
import com.oracle.truffle.api.strings.TruffleString.HashCodeNode;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.lang.invoke.MethodHandles.Lookup;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PyObjectHashNode#hash(TruffleString, HashCodeNode)}
 *     Activation probability: 0.23929
 *     With/without class size: 6/0 bytes
 *   Specialization {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
 *     Activation probability: 0.20714
 *     With/without class size: 13/26 bytes
 *   Specialization {@link PyObjectHashNode#hash(boolean)}
 *     Activation probability: 0.17500
 *     With/without class size: 6/0 bytes
 *   Specialization {@link PyObjectHashNode#hash(int)}
 *     Activation probability: 0.14286
 *     With/without class size: 5/0 bytes
 *   Specialization {@link PyObjectHashNode#hash(long)}
 *     Activation probability: 0.11071
 *     With/without class size: 5/0 bytes
 *   Specialization {@link PyObjectHashNode#hash(double)}
 *     Activation probability: 0.07857
 *     With/without class size: 4/0 bytes
 *   Specialization {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
 *     Activation probability: 0.04643
 *     With/without class size: 6/29 bytes
 * 
*/ @GeneratedBy(PyObjectHashNode.class) @SuppressWarnings("javadoc") public final class PyObjectHashNodeGen { private static final StateField HASH1__PY_OBJECT_HASH_NODE_HASH1_STATE_0_UPDATER = StateField.create(Hash1Data.lookup_(), "hash1_state_0_"); private static final StateField FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_0_UPDATER = StateField.create(FallbackData.lookup_(), "fallback_state_0_"); private static final StateField FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_1_UPDATER = StateField.create(FallbackData.lookup_(), "fallback_state_1_"); private static final Uncached UNCACHED = new Uncached(); @NeverDefault public static PyObjectHashNode getUncached() { return PyObjectHashNodeGen.UNCACHED; } /** * Required Fields:
    *
  • {@link Inlined#state_0_} *
  • {@link Inlined#hashCodeNode} *
  • {@link Inlined#hash1_cache} *
  • {@link Inlined#fallback_cache} *
*/ @NeverDefault public static PyObjectHashNode inline(@RequiredField(bits = 7, 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 PyObjectHashNodeGen.Inlined(target); } @GeneratedBy(PyObjectHashNode.class) @DenyReplace private static final class Inlined extends PyObjectHashNode { /** * State Info:
         *   0: SpecializationActive {@link PyObjectHashNode#hash(TruffleString, HashCodeNode)}
         *   1: SpecializationActive {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   2: SpecializationActive {@link PyObjectHashNode#hash(boolean)}
         *   3: SpecializationActive {@link PyObjectHashNode#hash(int)}
         *   4: SpecializationActive {@link PyObjectHashNode#hash(long)}
         *   5: SpecializationActive {@link PyObjectHashNode#hash(double)}
         *   6: SpecializationActive {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         * 
*/ private final StateField state_0_; private final ReferenceField hashCodeNode; private final ReferenceField hash1_cache; private final ReferenceField fallback_cache; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link GetPythonObjectClassNode} getClassNode
         *   Inline method: {@link GetPythonObjectClassNodeGen#inline}
*/ private final GetPythonObjectClassNode hash1_getClassNode_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link CastToTruffleStringNode} cast
         *   Inline method: {@link CastToTruffleStringNodeGen#inline}
*/ private final CastToTruffleStringNode hash1_cast_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link GetClassNode} getClassNode
         *   Inline method: {@link GetClassNodeGen#inline}
*/ private final GetClassNode fallback_getClassNode_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link MaybeBindDescriptorNode} bindDescriptorNode
         *   Inline method: {@link MaybeBindDescriptorNodeGen#inline}
*/ private final MaybeBindDescriptorNode fallback_bindDescriptorNode_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link CastUnsignedToJavaLongHashNode} cast
         *   Inline method: {@link CastUnsignedToJavaLongHashNodeGen#inline}
*/ private final CastUnsignedToJavaLongHashNode fallback_cast_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link Lazy} raiseNode
         *   Inline method: {@link LazyNodeGen#inline}
*/ private final Lazy fallback_raiseNode_; @SuppressWarnings("unchecked") private Inlined(InlineTarget target) { assert target.getTargetClass().isAssignableFrom(PyObjectHashNode.class); this.state_0_ = target.getState(0, 7); this.hashCodeNode = target.getReference(1, HashCodeNode.class); this.hash1_cache = target.getReference(2, Hash1Data.class); this.fallback_cache = target.getReference(3, FallbackData.class); this.hash1_getClassNode_ = GetPythonObjectClassNodeGen.inline(InlineTarget.create(GetPythonObjectClassNode.class, HASH1__PY_OBJECT_HASH_NODE_HASH1_STATE_0_UPDATER.subUpdater(2, 4), ReferenceField.create(Hash1Data.lookup_(), "hash1_getClassNode__field1_", Object.class), ReferenceField.create(Hash1Data.lookup_(), "hash1_getClassNode__field2_", Node.class), ReferenceField.create(Hash1Data.lookup_(), "hash1_getClassNode__field3_", Node.class))); this.hash1_cast_ = CastToTruffleStringNodeGen.inline(InlineTarget.create(CastToTruffleStringNode.class, HASH1__PY_OBJECT_HASH_NODE_HASH1_STATE_0_UPDATER.subUpdater(6, 8), ReferenceField.create(Hash1Data.lookup_(), "hash1_cast__field1_", Node.class), ReferenceField.create(Hash1Data.lookup_(), "hash1_cast__field2_", Node.class), ReferenceField.create(Hash1Data.lookup_(), "hash1_cast__field3_", Node.class))); this.fallback_getClassNode_ = GetClassNodeGen.inline(InlineTarget.create(GetClassNode.class, FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_0_UPDATER.subUpdater(0, 17), ReferenceField.create(FallbackData.lookup_(), "fallback_getClassNode__field1_", Node.class))); this.fallback_bindDescriptorNode_ = MaybeBindDescriptorNodeGen.inline(InlineTarget.create(MaybeBindDescriptorNode.class, FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_0_UPDATER.subUpdater(17, 6), ReferenceField.create(FallbackData.lookup_(), "fallback_bindDescriptorNode__field1_", Node.class))); this.fallback_cast_ = CastUnsignedToJavaLongHashNodeGen.inline(InlineTarget.create(CastUnsignedToJavaLongHashNode.class, FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_0_UPDATER.subUpdater(23, 9), ReferenceField.create(FallbackData.lookup_(), "fallback_cast__field1_", Node.class))); this.fallback_raiseNode_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, FALLBACK__PY_OBJECT_HASH_NODE_FALLBACK_STATE_1_UPDATER.subUpdater(0, 1), ReferenceField.create(FallbackData.lookup_(), "fallback_raiseNode__field1_", Node.class))); } @SuppressWarnings("static-method") private boolean fallbackGuard_(int state_0, Node arg0Value, Object arg1Value) { if (!((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] */) && arg1Value instanceof TruffleString) { return false; } if (arg1Value instanceof PString) { Hash1Data s1_ = this.hash1_cache.get(arg0Value); PString arg1Value_ = (PString) arg1Value; if ((s1_ == null || ((s1_.hash1_state_0_ & 0b1)) == 0 /* is-not GuardActive[specialization=PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode), guardIndex=0] */ || (PGuards.cannotBeOverridden(arg1Value_, s1_, this.hash1_getClassNode_)))) { return false; } } if (!((state_0 & 0b100) != 0 /* is SpecializationActive[PyObjectHashNode.hash(boolean)] */) && arg1Value instanceof Boolean) { return false; } if (!((state_0 & 0b1000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(int)] */) && arg1Value instanceof Integer) { return false; } if (!((state_0 & 0b10000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(long)] */) && arg1Value instanceof Long) { return false; } if (!((state_0 & 0b100000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(double)] */) && arg1Value instanceof Double) { return false; } return true; } @Override public long execute(Frame frameValue, Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if (state_0 != 0 /* is SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] || SpecializationActive[PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)] || SpecializationActive[PyObjectHashNode.hash(boolean)] || SpecializationActive[PyObjectHashNode.hash(int)] || SpecializationActive[PyObjectHashNode.hash(long)] || SpecializationActive[PyObjectHashNode.hash(double)] || SpecializationActive[PyObjectHashNode.hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] */ && arg1Value instanceof TruffleString) { TruffleString arg1Value_ = (TruffleString) arg1Value; { HashCodeNode hashCodeNode_ = this.hashCodeNode.get(arg0Value); if (hashCodeNode_ != null) { return PyObjectHashNode.hash(arg1Value_, hashCodeNode_); } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)] */ && arg1Value instanceof PString) { PString arg1Value_ = (PString) arg1Value; Hash1Data s1_ = this.hash1_cache.get(arg0Value); if (s1_ != null) { if ((s1_.hash1_state_0_ & 0b10) != 0 /* is SpecializationCachesInitialized */) { HashCodeNode hashCodeNode_1 = this.hashCodeNode.get(arg0Value); if (hashCodeNode_1 != null) { if ((PGuards.cannotBeOverridden(arg1Value_, s1_, this.hash1_getClassNode_))) { return PyObjectHashNode.hash(s1_, arg1Value_, this.hash1_getClassNode_, this.hash1_cast_, hashCodeNode_1); } } } } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PyObjectHashNode.hash(boolean)] */ && arg1Value instanceof Boolean) { boolean arg1Value_ = (boolean) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if ((state_0 & 0b1000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(int)] */ && arg1Value instanceof Integer) { int arg1Value_ = (int) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(long)] */ && arg1Value instanceof Long) { long arg1Value_ = (long) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if ((state_0 & 0b100000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(double)] */ && arg1Value instanceof Double) { double arg1Value_ = (double) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)] */) { FallbackData s6_ = this.fallback_cache.get(arg0Value); if (s6_ != null) { if (fallbackGuard_(state_0, arg0Value, arg1Value)) { return PyObjectHashNode.hash((VirtualFrame) frameValue, s6_, arg1Value, this.fallback_getClassNode_, s6_.lookupHash_, this.fallback_bindDescriptorNode_, s6_.callHash_, this.fallback_cast_, this.fallback_raiseNode_); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value); } @Override public long execute(Frame frameValue, Node arg0Value, TruffleString arg1Value) { int state_0 = this.state_0_.get(arg0Value); if ((state_0 & 0b1000001) != 0 /* is SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] || SpecializationActive[PyObjectHashNode.hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] */) { { HashCodeNode hashCodeNode_ = this.hashCodeNode.get(arg0Value); if (hashCodeNode_ != null) { return PyObjectHashNode.hash(arg1Value, hashCodeNode_); } } } if ((state_0 & 0b1000000) != 0 /* is SpecializationActive[PyObjectHashNode.hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)] */) { FallbackData s6_ = this.fallback_cache.get(arg0Value); if (s6_ != null) { if (fallbackGuard_(state_0, arg0Value, arg1Value)) { return PyObjectHashNode.hash((VirtualFrame) frameValue, s6_, arg1Value, this.fallback_getClassNode_, s6_.lookupHash_, this.fallback_bindDescriptorNode_, s6_.callHash_, this.fallback_cast_, this.fallback_raiseNode_); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(frameValue, arg0Value, arg1Value); } private long executeAndSpecialize(Frame frameValue, Node arg0Value, Object arg1Value) { int state_0 = this.state_0_.get(arg0Value); if (arg1Value instanceof TruffleString) { TruffleString arg1Value_ = (TruffleString) arg1Value; HashCodeNode hashCodeNode_; HashCodeNode hashCodeNode__shared = this.hashCodeNode.get(arg0Value); if (hashCodeNode__shared != null) { hashCodeNode_ = hashCodeNode__shared; } else { hashCodeNode_ = arg0Value.insert((HashCodeNode.create())); if (hashCodeNode_ == null) { throw new IllegalStateException("Specialization 'hash(TruffleString, HashCodeNode)' contains a shared cache with name 'hashCodeNode' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.hashCodeNode.get(arg0Value) == null) { VarHandle.storeStoreFence(); this.hashCodeNode.set(arg0Value, hashCodeNode_); } state_0 = state_0 | 0b1 /* add SpecializationActive[PyObjectHashNode.hash(TruffleString, HashCodeNode)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash(arg1Value_, hashCodeNode_); } if (arg1Value instanceof PString) { PString arg1Value_ = (PString) arg1Value; while (true) { int count1_ = 0; Hash1Data s1_ = this.hash1_cache.getVolatile(arg0Value); Hash1Data s1_original = s1_; while (s1_ != null) { if ((s1_.hash1_state_0_ & 0b10) != 0 /* is SpecializationCachesInitialized */) { HashCodeNode hashCodeNode_1 = this.hashCodeNode.get(arg0Value); if (hashCodeNode_1 != null) { if ((PGuards.cannotBeOverridden(arg1Value_, s1_, this.hash1_getClassNode_))) { break; } } } if ((s1_.hash1_state_0_ & 0b10) != 0 /* is SpecializationCachesInitialized */) { count1_++; } s1_ = null; break; } if (s1_ == null && count1_ < 1) { { s1_ = arg0Value.insert(new Hash1Data()); if (((s1_.hash1_state_0_ & 0b1)) == 0 /* is-not GuardActive[specialization=PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode), guardIndex=0] */) { s1_.hash1_state_0_ = s1_.hash1_state_0_ | 0b1 /* add GuardActive[specialization=PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode), guardIndex=0] */; if (!this.hash1_cache.compareAndSet(arg0Value, s1_original, s1_)) { continue; } s1_original = s1_; s1_ = arg0Value.insert(new Hash1Data(s1_)); } if ((PGuards.cannotBeOverridden(arg1Value_, s1_, this.hash1_getClassNode_))) { HashCodeNode hashCodeNode_1; HashCodeNode hashCodeNode_1_shared = this.hashCodeNode.get(arg0Value); if (hashCodeNode_1_shared != null) { hashCodeNode_1 = hashCodeNode_1_shared; } else { hashCodeNode_1 = s1_.insert((HashCodeNode.create())); if (hashCodeNode_1 == null) { throw new IllegalStateException("Specialization 'hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)' contains a shared cache with name 'hashCodeNode' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.hashCodeNode.get(arg0Value) == null) { this.hashCodeNode.set(arg0Value, hashCodeNode_1); } s1_.hash1_state_0_ = s1_.hash1_state_0_ | 0b10 /* add SpecializationCachesInitialized */; if (!this.hash1_cache.compareAndSet(arg0Value, s1_original, s1_)) { continue; } state_0 = state_0 | 0b10 /* add SpecializationActive[PyObjectHashNode.hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)] */; this.state_0_.set(arg0Value, state_0); } else { s1_ = null; } } } if (s1_ != null) { return PyObjectHashNode.hash(s1_, arg1Value_, this.hash1_getClassNode_, this.hash1_cast_, this.hashCodeNode.get(arg0Value)); } break; } } if (arg1Value instanceof Boolean) { boolean arg1Value_ = (boolean) arg1Value; state_0 = state_0 | 0b100 /* add SpecializationActive[PyObjectHashNode.hash(boolean)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Integer) { int arg1Value_ = (int) arg1Value; state_0 = state_0 | 0b1000 /* add SpecializationActive[PyObjectHashNode.hash(int)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Long) { long arg1Value_ = (long) arg1Value; state_0 = state_0 | 0b10000 /* add SpecializationActive[PyObjectHashNode.hash(long)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Double) { double arg1Value_ = (double) arg1Value; state_0 = state_0 | 0b100000 /* add SpecializationActive[PyObjectHashNode.hash(double)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash(arg1Value_); } FallbackData s6_ = arg0Value.insert(new FallbackData()); LookupCallableSlotInMRONode lookupHash__ = s6_.insert((LookupCallableSlotInMRONode.create(SpecialMethodSlot.Hash))); Objects.requireNonNull(lookupHash__, "Specialization 'hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)' cache 'lookupHash' 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'."); s6_.lookupHash_ = lookupHash__; CallUnaryMethodNode callHash__ = s6_.insert((CallUnaryMethodNode.create())); Objects.requireNonNull(callHash__, "Specialization 'hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)' cache 'callHash' 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'."); s6_.callHash_ = callHash__; VarHandle.storeStoreFence(); this.fallback_cache.set(arg0Value, s6_); state_0 = state_0 | 0b1000000 /* add SpecializationActive[PyObjectHashNode.hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)] */; this.state_0_.set(arg0Value, state_0); return PyObjectHashNode.hash((VirtualFrame) frameValue, s6_, arg1Value, this.fallback_getClassNode_, lookupHash__, this.fallback_bindDescriptorNode_, callHash__, this.fallback_cast_, this.fallback_raiseNode_); } @Override public boolean isAdoptable() { return false; } } @GeneratedBy(PyObjectHashNode.class) @DenyReplace private static final class Hash1Data extends Node implements SpecializationDataNode { /** * State Info:
         *   0: GuardActive[guardIndex=0] {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   1: SpecializationCachesInitialized {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   2-5: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *        Parameter: {@link GetPythonObjectClassNode} getClassNode
         *        Inline method: {@link GetPythonObjectClassNodeGen#inline}
         *   6-13: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *        Parameter: {@link CastToTruffleStringNode} cast
         *        Inline method: {@link CastToTruffleStringNodeGen#inline}
         * 
*/ @CompilationFinal @UnsafeAccessedField private int hash1_state_0_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link GetPythonObjectClassNode} getClassNode
         *   Inline method: {@link GetPythonObjectClassNodeGen#inline}
         *   Inline field: {@link Object} field1
*/ @CompilationFinal @UnsafeAccessedField @SuppressWarnings("unused") private Object hash1_getClassNode__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link GetPythonObjectClassNode} getClassNode
         *   Inline method: {@link GetPythonObjectClassNodeGen#inline}
         *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node hash1_getClassNode__field2_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link GetPythonObjectClassNode} getClassNode
         *   Inline method: {@link GetPythonObjectClassNodeGen#inline}
         *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node hash1_getClassNode__field3_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link CastToTruffleStringNode} cast
         *   Inline method: {@link CastToTruffleStringNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node hash1_cast__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link CastToTruffleStringNode} cast
         *   Inline method: {@link CastToTruffleStringNodeGen#inline}
         *   Inline field: {@link Node} field2
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node hash1_cast__field2_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(Node, PString, GetPythonObjectClassNode, CastToTruffleStringNode, HashCodeNode)}
         *   Parameter: {@link CastToTruffleStringNode} cast
         *   Inline method: {@link CastToTruffleStringNodeGen#inline}
         *   Inline field: {@link Node} field3
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node hash1_cast__field3_; Hash1Data() { } Hash1Data(Hash1Data delegate) { this.hash1_state_0_ = delegate.hash1_state_0_; this.hash1_getClassNode__field1_ = delegate.hash1_getClassNode__field1_; this.hash1_getClassNode__field2_ = delegate.hash1_getClassNode__field2_; this.hash1_getClassNode__field3_ = delegate.hash1_getClassNode__field3_; this.hash1_cast__field1_ = delegate.hash1_cast__field1_; this.hash1_cast__field2_ = delegate.hash1_cast__field2_; this.hash1_cast__field3_ = delegate.hash1_cast__field3_; } @Override public NodeCost getCost() { return NodeCost.NONE; } private static Lookup lookup_() { return MethodHandles.lookup(); } } @GeneratedBy(PyObjectHashNode.class) @DenyReplace private static final class FallbackData extends Node implements SpecializationDataNode { /** * State Info:
         *   0-16: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *        Parameter: {@link GetClassNode} getClassNode
         *        Inline method: {@link GetClassNodeGen#inline}
         *   17-22: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *        Parameter: {@link MaybeBindDescriptorNode} bindDescriptorNode
         *        Inline method: {@link MaybeBindDescriptorNodeGen#inline}
         *   23-31: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *        Parameter: {@link CastUnsignedToJavaLongHashNode} cast
         *        Inline method: {@link CastUnsignedToJavaLongHashNodeGen#inline}
         * 
*/ @CompilationFinal @UnsafeAccessedField private int fallback_state_0_; /** * State Info:
         *   0: InlinedCache
         *        Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *        Parameter: {@link Lazy} raiseNode
         *        Inline method: {@link LazyNodeGen#inline}
         * 
*/ @CompilationFinal @UnsafeAccessedField private int fallback_state_1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link GetClassNode} getClassNode
         *   Inline method: {@link GetClassNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node fallback_getClassNode__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link LookupCallableSlotInMRONode} lookupHash
*/ @Child LookupCallableSlotInMRONode lookupHash_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link MaybeBindDescriptorNode} bindDescriptorNode
         *   Inline method: {@link MaybeBindDescriptorNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node fallback_bindDescriptorNode__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link CallUnaryMethodNode} callHash
*/ @Child CallUnaryMethodNode callHash_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link CastUnsignedToJavaLongHashNode} cast
         *   Inline method: {@link CastUnsignedToJavaLongHashNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node fallback_cast__field1_; /** * Source Info:
         *   Specialization: {@link PyObjectHashNode#hash(VirtualFrame, Node, Object, GetClassNode, LookupCallableSlotInMRONode, MaybeBindDescriptorNode, CallUnaryMethodNode, CastUnsignedToJavaLongHashNode, Lazy)}
         *   Parameter: {@link Lazy} raiseNode
         *   Inline method: {@link LazyNodeGen#inline}
         *   Inline field: {@link Node} field1
*/ @Child @UnsafeAccessedField @SuppressWarnings("unused") private Node fallback_raiseNode__field1_; FallbackData() { } @Override public NodeCost getCost() { return NodeCost.NONE; } private static Lookup lookup_() { return MethodHandles.lookup(); } } @GeneratedBy(PyObjectHashNode.class) @DenyReplace private static final class Uncached extends PyObjectHashNode { @Override public long execute(Frame frameValue, Node arg0Value, Object arg1Value) { CompilerDirectives.transferToInterpreterAndInvalidate(); if (arg1Value instanceof TruffleString) { TruffleString arg1Value_ = (TruffleString) arg1Value; return PyObjectHashNode.hash(arg1Value_, (HashCodeNode.getUncached())); } if (arg1Value instanceof PString) { PString arg1Value_ = (PString) arg1Value; if ((PGuards.cannotBeOverridden(arg1Value_, arg0Value, (GetPythonObjectClassNodeGen.getUncached())))) { return PyObjectHashNode.hash(arg0Value, arg1Value_, (GetPythonObjectClassNodeGen.getUncached()), (CastToTruffleStringNode.getUncached()), (HashCodeNode.getUncached())); } } if (arg1Value instanceof Boolean) { boolean arg1Value_ = (boolean) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Integer) { int arg1Value_ = (int) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Long) { long arg1Value_ = (long) arg1Value; return PyObjectHashNode.hash(arg1Value_); } if (arg1Value instanceof Double) { double arg1Value_ = (double) arg1Value; return PyObjectHashNode.hash(arg1Value_); } return PyObjectHashNode.hash((VirtualFrame) frameValue, arg0Value, arg1Value, (GetClassNode.getUncached()), (LookupCallableSlotInMRONode.getUncached(SpecialMethodSlot.Hash)), (MaybeBindDescriptorNodeGen.getUncached()), (CallUnaryMethodNode.getUncached()), (CastUnsignedToJavaLongHashNodeGen.getUncached()), (Lazy.getUncached())); } @Override public long execute(Frame frameValue, Node arg0Value, TruffleString arg1Value) { CompilerDirectives.transferToInterpreterAndInvalidate(); return PyObjectHashNode.hash(arg1Value, (HashCodeNode.getUncached())); } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @Override public boolean isAdoptable() { return false; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy