|
167 | 167 | import com.oracle.graal.python.builtins.objects.type.TpSlotsFactory.GetObjectSlotsNodeGen;
|
168 | 168 | import com.oracle.graal.python.builtins.objects.type.TpSlotsFactory.GetTpSlotsNodeGen;
|
169 | 169 | import com.oracle.graal.python.builtins.objects.type.TypeNodes.GetSubclassesAsArrayNode;
|
170 |
| -import com.oracle.graal.python.builtins.objects.type.slots.PyObjectHashNotImplemented; |
171 | 170 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlot;
|
172 | 171 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlot.TpSlotBuiltin;
|
173 | 172 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlot.TpSlotCExtNative;
|
|
186 | 185 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotDescrSet.TpSlotDescrSetPython;
|
187 | 186 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotGetAttr.TpSlotGetAttrBuiltin;
|
188 | 187 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotGetAttr.TpSlotGetAttrPython;
|
| 188 | +import com.oracle.graal.python.builtins.objects.type.slots.TpSlotHashFun; |
189 | 189 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotHashFun.TpSlotHashBuiltin;
|
190 | 190 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotInquiry.TpSlotInquiryBuiltin;
|
191 | 191 | import com.oracle.graal.python.builtins.objects.type.slots.TpSlotIterNext;
|
@@ -1239,7 +1239,7 @@ public static TpSlots fromNative(PythonAbstractNativeObject pythonClass, PythonC
|
1239 | 1239 | // PyObject_HashNotImplemented, we still assign it to the slot as wrapped
|
1240 | 1240 | // native executable later on
|
1241 | 1241 | if (CApiContext.isIdenticalToSymbol(fieldPointer, NativeCAPISymbol.FUN_PYOBJECT_HASH_NOT_IMPLEMENTED)) {
|
1242 |
| - builder.set(def, TpSlotIterNext.NEXT_NOT_IMPLEMENTED); |
| 1242 | + builder.set(def, TpSlotHashFun.HASH_NOT_IMPLEMENTED); |
1243 | 1243 | continue;
|
1244 | 1244 | }
|
1245 | 1245 | } else if (def == TpSlotMeta.TP_ITERNEXT) {
|
@@ -1534,7 +1534,7 @@ private static Builder updateSlots(PythonAbstractClass klass, Builder slots, Set
|
1534 | 1534 | // TODO: special cases:
|
1535 | 1535 | // PyCFunction_Type && tp_new (looks like just optimization)
|
1536 | 1536 | } else if (descr == PNone.NONE && slot == TpSlotMeta.TP_HASH) {
|
1537 |
| - specific = PyObjectHashNotImplemented.INSTANCE; |
| 1537 | + specific = TpSlotHashFun.HASH_NOT_IMPLEMENTED; |
1538 | 1538 | } else {
|
1539 | 1539 | useGeneric = true;
|
1540 | 1540 | generic = defs[i].functionFactory;
|
@@ -1621,7 +1621,7 @@ public static void addOperatorsToBuiltin(Map<TruffleString, BoundBuiltinCallable
|
1621 | 1621 | for (var slotDefGroup : SLOTDEFS.entrySet()) {
|
1622 | 1622 | TpSlotMeta slotMeta = slotDefGroup.getKey();
|
1623 | 1623 | TpSlot slotValue = slotMeta.getter.get(slots);
|
1624 |
| - if (slotMeta == TpSlotMeta.TP_HASH && slotValue == PyObjectHashNotImplemented.INSTANCE) { |
| 1624 | + if (slotMeta == TpSlotMeta.TP_HASH && slotValue == TpSlotHashFun.HASH_NOT_IMPLEMENTED) { |
1625 | 1625 | DynamicObjectLibrary.getUncached().put(pythonBuiltinClass, T___HASH__, PNone.NONE);
|
1626 | 1626 | continue;
|
1627 | 1627 | }
|
@@ -1664,7 +1664,7 @@ public void addOperators(PythonClass type) {
|
1664 | 1664 | continue;
|
1665 | 1665 | }
|
1666 | 1666 | Object wrapperDescriptor = null;
|
1667 |
| - if (value == PyObjectHashNotImplemented.INSTANCE) { |
| 1667 | + if (value == TpSlotHashFun.HASH_NOT_IMPLEMENTED) { |
1668 | 1668 | wrapperDescriptor = PNone.NO_VALUE;
|
1669 | 1669 | } else if (value instanceof TpSlotBuiltin<?> builtinSlot) {
|
1670 | 1670 | wrapperDescriptor = builtinSlot.createBuiltin(context, type, tpSlotDef.name, tpSlotDef.wrapper);
|
|
0 commit comments