We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 837166f commit 82212b3Copy full SHA for 82212b3
1 file changed
Python/specialize.c
@@ -644,14 +644,22 @@ specialize_dict_access_hint(
644
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_SPLIT_DICT);
645
return 0;
646
}
647
+#ifdef Py_GIL_DISABLED
648
+ PyObject *value;
649
+ Py_ssize_t index = _PyDict_LookupIndexAndValue((PyDictObject *)globals, name, &value);
650
+#else
651
Py_ssize_t index = _PyDict_LookupIndex(dict, name);
652
+#endif
653
if (index != (uint16_t)index) {
654
SPECIALIZATION_FAIL(base_op,
655
index == DKIX_EMPTY ?
656
SPEC_FAIL_ATTR_NOT_IN_DICT :
657
SPEC_FAIL_OUT_OF_RANGE);
658
659
660
661
+ maybe_enable_deferred_ref_count(value);
662
663
cache->index = (uint16_t)index;
664
write_u32(cache->version, tp_version);
665
specialize(instr, hint_op);
0 commit comments