@@ -31,7 +31,8 @@ PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
3131PyAPI_FUNC (int ) _PyDict_DelItem_KnownHash (PyObject * mp , PyObject * key ,
3232 Py_hash_t hash );
3333
34- extern int _PyDict_DelItem_KnownHash_LockHeld (PyObject * mp , PyObject * key ,
34+ // Exported for external JIT support
35+ PyAPI_FUNC (int ) _PyDict_DelItem_KnownHash_LockHeld (PyObject * mp , PyObject * key ,
3536 Py_hash_t hash );
3637
3738extern int _PyDict_Contains_KnownHash (PyObject * , PyObject * , Py_hash_t );
@@ -93,8 +94,9 @@ extern PyObject *_PyDict_Or(PyObject *self, PyObject *other);
9394extern PyObject * _PyDict_IOr (PyObject * self , PyObject * other );
9495
9596/* Gets a version number unique to the current state of the keys of dict, if possible.
96- * Returns the version number, or zero if it was not possible to get a version number. */
97- extern uint32_t _PyDictKeys_GetVersionForCurrentState (
97+ * Returns the version number, or zero if it was not possible to get a version number.
98+ * Exported for external JIT support */
99+ PyAPI_FUNC (uint32_t ) _PyDictKeys_GetVersionForCurrentState (
98100 PyInterpreterState * interp , PyDictKeysObject * dictkeys );
99101
100102/* Gets a version number unique to the current state of the keys of dict, if possible.
@@ -104,8 +106,9 @@ extern uint32_t _PyDictKeys_GetVersionForCurrentState(
104106 *
105107 * The caller must hold the per-object lock on dict.
106108 *
107- * Returns the version number, or zero if it was not possible to get a version number. */
108- extern uint32_t _PyDict_GetKeysVersionForCurrentState (
109+ * Returns the version number, or zero if it was not possible to get a version number.
110+ * Exported for external JIT support */
111+ PyAPI_FUNC (uint32_t ) _PyDict_GetKeysVersionForCurrentState (
109112 PyInterpreterState * interp , PyDictObject * dict );
110113
111114extern size_t _PyDict_KeysSize (PyDictKeysObject * keys );
@@ -114,16 +117,18 @@ extern void _PyDictKeys_DecRef(PyDictKeysObject *keys);
114117
115118/* _Py_dict_lookup() returns index of entry which can be used like DK_ENTRIES(dk)[index].
116119 * -1 when no entry found, -3 when compare raises error.
120+ * Exported for external JIT support
117121 */
118- extern Py_ssize_t _Py_dict_lookup (PyDictObject * mp , PyObject * key , Py_hash_t hash , PyObject * * value_addr );
122+ PyAPI_FUNC ( Py_ssize_t ) _Py_dict_lookup (PyDictObject * mp , PyObject * key , Py_hash_t hash , PyObject * * value_addr );
119123extern Py_ssize_t _Py_dict_lookup_threadsafe (PyDictObject * mp , PyObject * key , Py_hash_t hash , PyObject * * value_addr );
120124extern Py_ssize_t _Py_dict_lookup_threadsafe_stackref (PyDictObject * mp , PyObject * key , Py_hash_t hash , _PyStackRef * value_addr );
121125
122126extern int _PyDict_GetMethodStackRef (PyDictObject * dict , PyObject * name , _PyStackRef * method );
123127
124- extern Py_ssize_t _PyDict_LookupIndexAndValue (PyDictObject * , PyObject * , PyObject * * );
125- extern Py_ssize_t _PyDict_LookupIndex (PyDictObject * , PyObject * );
126- extern Py_ssize_t _PyDictKeys_StringLookup (PyDictKeysObject * dictkeys , PyObject * key );
128+ // Exported for external JIT support
129+ PyAPI_FUNC (Py_ssize_t ) _PyDict_LookupIndexAndValue (PyDictObject * , PyObject * , PyObject * * );
130+ PyAPI_FUNC (Py_ssize_t ) _PyDict_LookupIndex (PyDictObject * , PyObject * );
131+ PyAPI_FUNC (Py_ssize_t ) _PyDictKeys_StringLookup (PyDictKeysObject * dictkeys , PyObject * key );
127132
128133/* Look up a string key in an all unicode dict keys, assign the keys object a version, and
129134 * store it in version.
@@ -132,9 +137,11 @@ extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject
132137 * strings.
133138 *
134139 * Returns DKIX_EMPTY if the key is not present.
140+ *
141+ * Exported for external JIT support
135142 */
136- extern Py_ssize_t _PyDictKeys_StringLookupAndVersion (PyDictKeysObject * dictkeys , PyObject * key , uint32_t * version );
137- extern Py_ssize_t _PyDictKeys_StringLookupSplit (PyDictKeysObject * dictkeys , PyObject * key );
143+ PyAPI_FUNC ( Py_ssize_t ) _PyDictKeys_StringLookupAndVersion (PyDictKeysObject * dictkeys , PyObject * key , uint32_t * version );
144+ PyAPI_FUNC ( Py_ssize_t ) _PyDictKeys_StringLookupSplit (PyDictKeysObject * dictkeys , PyObject * key );
138145PyAPI_FUNC (PyObject * )_PyDict_LoadGlobal (PyDictObject * , PyDictObject * , PyObject * );
139146PyAPI_FUNC (void ) _PyDict_LoadGlobalStackRef (PyDictObject * , PyDictObject * , PyObject * , _PyStackRef * );
140147
@@ -144,7 +151,8 @@ extern PyObject *_PyDict_LoadBuiltinsFromGlobals(PyObject *globals);
144151/* Consumes references to key and value */
145152PyAPI_FUNC (int ) _PyDict_SetItem_Take2 (PyDictObject * op , PyObject * key , PyObject * value );
146153PyAPI_FUNC (int ) _PyDict_SetItem_Take2_KnownHash (PyDictObject * op , PyObject * key , PyObject * value , Py_hash_t hash );
147- extern int _PyDict_SetItem_LockHeld (PyDictObject * dict , PyObject * name , PyObject * value );
154+ // Exported for external JIT support
155+ PyAPI_FUNC (int ) _PyDict_SetItem_LockHeld (PyDictObject * dict , PyObject * name , PyObject * value );
148156// Export for '_asyncio' shared extension
149157PyAPI_FUNC (int ) _PyDict_SetItem_KnownHash_LockHeld (PyDictObject * mp , PyObject * key ,
150158 PyObject * value , Py_hash_t hash );
@@ -329,6 +337,10 @@ _PyDictValues_AddToInsertionOrder(PyDictValues *values, Py_ssize_t ix)
329337 values -> size = size + 1 ;
330338}
331339
340+ // Exported for external JIT support
341+ PyAPI_FUNC (void )
342+ _PyDict_InsertSplitValue (PyDictObject * mp , PyObject * key , PyObject * value , Py_ssize_t ix );
343+
332344static inline size_t
333345shared_keys_usable_size (PyDictKeysObject * keys )
334346{
0 commit comments