Skip to content

Commit e0ec2f8

Browse files
Subbarao Garlapatimeta-codesync[bot]
authored andcommitted
Add Lazy Imports to 3.14t
Summary: Add Lazy Imports to the free-threaded build of Meta Python 3.14. Lazy Imports was added to the gil build of Meta Python 3.14 in D83595369. This Diff is the result of squashing this stack: D85054995. The stack must be landed in one commit to avoid introducing any dangerous behavior in 3.14t. Reviewed By: DinoV Differential Revision: D85977460 fbshipit-source-id: f11501c8996c55cb83952016916f88b5f9d05636
1 parent 66d14c7 commit e0ec2f8

3 files changed

Lines changed: 167 additions & 82 deletions

File tree

cinderx/Interpreter/3.14/Includes/generated_cases.c.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7844,7 +7844,7 @@
78447844
fromlist = stack_pointer[-1];
78457845
level = stack_pointer[-2];
78467846
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg);
7847-
#if defined(ENABLE_LAZY_IMPORTS) && !defined(Py_GIL_DISABLED)
7847+
#if defined(ENABLE_LAZY_IMPORTS)
78487848
PyObject *res_o;
78497849
_PyFrame_SetStackPointer(frame, stack_pointer);
78507850
bool active = _PyImport_IsLazyImportsActive(tstate);
@@ -10050,7 +10050,7 @@
1005010050
assert(_PyOpcode_Deopt[opcode] == (LOAD_ATTR));
1005110051
JUMP_TO_PREDICTED(LOAD_ATTR);
1005210052
}
10053-
assert(keys->dk_kind == DICT_KEYS_UNICODE);
10053+
assert(DK_KIND(keys) == DICT_KEYS_UNICODE);
1005410054
assert(index < FT_ATOMIC_LOAD_SSIZE_RELAXED(keys->dk_nentries));
1005510055
PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(keys) + index;
1005610056
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_RELAXED(ep->me_value);
@@ -10431,7 +10431,7 @@
1043110431
}
1043210432
}
1043310433
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg>>1);
10434-
if (dk->dk_kind != DICT_KEYS_UNICODE) {
10434+
if (DK_KIND(dk) != DICT_KEYS_UNICODE) {
1043510435
if (true) {
1043610436
UPDATE_MISS_STATS(LOAD_ATTR);
1043710437
assert(_PyOpcode_Deopt[opcode] == (LOAD_ATTR));

cinderx/UpstreamBorrow/borrowed-3.14.c.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ PyDictKeysObject* ci_dict_empty_keys;
141141
// @Borrow function delitem_knownhash_lock_held from Objects/dictobject.c [3.14]
142142
// @Borrow function _PyDict_DelItem_KnownHash_LockHeld from Objects/dictobject.c [3.14]
143143
// @Borrow function new_keys_object from Objects/dictobject.c [3.14]
144+
// @Borrow function lazy_import_verbose_lock_held from Objects/dictobject.c [3.14]
144145
// @Borrow function lazy_import_verbose from Objects/dictobject.c [3.14]
145146
// @Borrow function insert_to_emptydict from Objects/dictobject.c [3.14]
146147
// @Borrow function ensure_shared_on_resize from Objects/dictobject.c [3.14]

0 commit comments

Comments
 (0)