Commit Graph

10120 Commits

Author SHA1 Message Date
Bénédikt Tran ce6bae92da gh-143377: fix crashes in _interpreters.capture_exception (#143418) 2026-01-10 12:37:54 +01:00
Nadeshiko Manju e2f0160026 gh-143604: Hold strong reference to executor during JIT tracing (GH-143646)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-10 11:15:48 +00:00
Ken Jin 95259116ec gh-142764: Restore REPLACE_OPCODE_IF_EVALUATES_PURE optimization for some ops (GH-143335) 2026-01-09 23:18:22 +00:00
Ken Jin e0fb278064 gh-143421: Allocate all JIT state in one go (GH-143626) 2026-01-09 19:00:49 +00:00
Ken Jin b852236b26 gh-143421: Lazily allocate tracer code and opt buffers (GH-143597) 2026-01-09 16:56:19 +00:00
A.Ibrahim a4086d7f89 gh-142829: Fix use-after-free in Context.__eq__ via re-entrant ContextVar.set (#142905) 2026-01-09 17:57:34 +05:30
Victor Stinner 39a2bcf949 gh-143547: Fix PyErr_FormatUnraisable() fallback (#143557)
Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

Fix test_sys.UnraisableHookTest: use the right decorator function to
disable colors. Previously, tests were always skipped.
2026-01-09 13:16:22 +01:00
Hai Zhu aeb3403563 gh-143421: Move JitOptContext from stack allocation to per-thread heap allocation (GH-143536)
* move JitOptContext to _PyThreadStateImpl
* make _PyUOpInstruction buffer a part of _PyThreadStateImpl

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-01-08 19:38:21 +00:00
Sam Gross 8cf5c4d89a gh-142908: Don't use DK_IS_UNICODE in interpreter (gh-142909)
`DK_IS_UNICODE()` includes split keys and we don't want to specialize on
those accesses..
2026-01-08 09:32:20 -05:00
Sam Gross f11f5ebfe6 gh-129824: Fix data race on runtime->gilstate.check_enabled (gh-143530) 2026-01-07 17:56:14 -05:00
Dino Viehland bfc3d8d77f gh-143531: Use macro to check if PEP 523 is hooked (#143532)
Use macro to check if PEP 523 is hooked
2026-01-07 13:26:19 -08:00
Nadeshiko Manju 0a5c04a5ce gh-134584: Eliminate redundant refcounting from TO_BOOL_STR (GH-143417)
Signed-off-by: Manjusaka <me@manjusaka.me>
2026-01-06 21:11:53 +00:00
Ken Jin df355348f0 gh-142982: Specialize CALL_FUNCTION_EX (GH-143391) 2026-01-06 20:34:08 +00:00
Kumar Aditya 74bb3ca1f8 gh-142863: optimize list and set calls with generator expressions (#142864) 2026-01-06 23:23:28 +05:30
Ken Jin 90c44bc803 gh-131798: Support generator frames in the JIT optimizer (GH-143340) 2026-01-06 16:39:57 +00:00
Kumar Aditya faa3dc7c64 gh-143469: enable LOAD_ATTR_MODULE specialization even if __getattr__ is defined (#143470) 2026-01-06 22:09:18 +05:30
reiden 54f1ed0299 gh-134584: Eliminate redundant refcounting in TO_BOOL_ALWAYS_TRUE (GH-143427)
Co-authored-by: Ken Jin <kenjin@python.org>
2026-01-06 16:11:56 +00:00
Sam Gross 841b7482dd gh-143424: Fix assertion in _PyMutex_LockTimed (gh-143439)
The assertion doesn't necessarily hold for `threading.Lock`, so allow
the lock to be unlocked if `_PY_LOCK_PYTHONLOCK` is set on the flags.
2026-01-06 09:40:14 -05:00
Serhiy Storchaka 4d21297d28 gh-41779: Allow defining any __slots__ for a class derived from tuple (GH-141763) 2026-01-06 11:36:00 +02:00
Kumar Aditya d6f77e6a3f gh-116738: make entering of contextvars.Context thread safe (#143074) 2026-01-06 12:24:02 +05:30
Sam Gross 7a572d9f21 gh-143108: Don't instrument some faulthandler related functions for TSan (#143450) 2026-01-05 22:13:29 +01:00
Chris Eibl e6bfe4d886 gh-139757: Add BINARY_OP_SUBSCR_USTR_INT (GH-143389) 2026-01-04 14:14:27 +00:00
Ken Jin 6116d70bbd gh-143403: Fix a UAF in _BINARY_OP_INPLACE_ADD_UNICODE (GH-143404)
Fix a UAF in `_BINARY_OP_INPLACE_ADD_UNICODE`
2026-01-04 13:10:39 +00:00
Donghee Na 12283f6373 gh-141504: Factor out tracing and optimization heuristics into a single object (gh-143381) 2026-01-03 15:22:14 +00:00
Bartosz Sławecki 6d05e55de0 Fix dunder name typo in compiler code comment (#143374) 2026-01-03 10:08:42 +00:00
Aaron Wieczorek b538c2832d gh-143361: Pass PY_VECTORCALL_ARGUMENTS_OFFSET in _Py_CallBuiltinClass_StackRefSteal (GH-143367)
Co-authored-by: Aaron Wieczorek <woz@Aarons-MacBook-Pro.local>
2026-01-02 20:43:00 +00:00
Ken Jin f7a03bb944 gh-134584: JIT: Remove redundant refcount from STORE_FAST (GH-143336) 2026-01-02 18:22:21 +00:00
Donghee Na 61f2ad9a3a gh-139757: Fix unintended bytecode specialization for non-ascii string (gh-143352) 2026-01-02 14:05:08 +00:00
Donghee Na 315f474d11 gh-139757: Add _GUARD_NOS_COMPACT_ASCII for compact ascii optimization (gh-143332) 2026-01-02 20:58:14 +09:00
Nadeshiko Manju d00d39f58e gh-134584: Eliminate redundant refcounting from _LOAD_ATTR_SLOT (GH-143320)
Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-01 17:27:02 +00:00
Donghee Na 1fb8e0eb51 gh-134584: Eliminate redundant refcounting from _CALL{_BUILTIN_O, _METHOD_DESCRIPTOR_O} (GH-143330)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-01 17:25:38 +00:00
Ken Jin 6cb245d260 gh-143183: Link trace to side exits, rather than stop (GH-143268) 2025-12-29 15:10:42 +00:00
Samuel f37f57dfe6 gh-131421: Fix ASDL kw_defaults being expr* instead of expr?* (GH-133773)
Also fix docs ASDL highlighting.
2025-12-29 13:43:09 +02:00
Ken Jin daa9aa4c0a gh-143183: Rewind stop tracing to previous target (GH-143187)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-28 22:12:31 +00:00
Tomas R. 713684de53 gh-131798: Remove bounds check when indexing into tuples with a constant index (#137607)
* Remove bounds check when indexing into tuples with a constant index

* Add news entry

* fixup after rebase
2025-12-28 22:06:06 +01:00
Pablo Galindo Salgado 3ccc76f036 gh-143228: Fix UAF in perf trampoline during finalization (#143233) 2025-12-28 13:50:23 +00:00
Pablo Galindo Salgado 3a728e5f93 gh-131591: Do not free page caches that weren't allocated (#143205) 2025-12-27 13:38:11 +00:00
Hai Zhu a1c6308346 gh-134584: Eliminate redundant refcounting from IS_OP (GH-143171)
Eliminate redundant refcounting from IS_OP
2025-12-26 20:30:02 +00:00
Hai Zhu b3f2d80569 gh-134584: Eliminate redundant refcounting from _COMPARE_OP_X (GH-143186) 2025-12-26 16:12:28 +00:00
Yongtao Huang de22e718bb Remove redundant pycore_optimizer.h includes (#143184)
`pycore_optimizer.h` was included redundantly in
Objects/frameobject.c and Python/instrumentation.c.
Both includes are unnecessary and can be safely removed.
No functional change.

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
2025-12-26 11:11:11 +00:00
Peter Bierma 8611f74e08 gh-142975: During GC, mark frozen objects with a merged zero refcount for destruction (GH-143156) 2025-12-25 16:31:41 +00:00
Ken Jin cf6758ff9e gh-143092: Make CALL_LIST_APPEND and BINARY_OP_INPLACE_ADD_UNICODE normal instructions (GH-143124)
These super instructions need many special cases in the interpreter, specializer, and JIT. It's best we convert them to normal instructions.
2025-12-24 22:03:00 +00:00
Sam Gross 594a4631c3 gh-120321: Fix TSan reported races on gi_frame_state (gh-143128) 2025-12-24 16:10:43 -05:00
Stan Ulbrych 3509fa5a12 gh-143135: Fix sys.flags.inspect when PYTHONINSPECT=0 (GH-143136) 2025-12-24 19:56:59 +02:00
Diego Russo fc2f0fea6b JIT: Move executor to a register (#143072) 2025-12-24 09:44:16 +00:00
Sam Gross 50ecd6b880 gh-143108: Don't instrument faulthandler.c for TSan (#143109)
The dumping of tracebacks has data races and that's okay (it's best
effort).
2025-12-24 02:12:55 +01:00
Hai Zhu cc48bf0fde gh-134584: Eliminate redundant refcounting from _BINARY_OP_SUBSCR_TUPLE_INT (GH-143094) 2025-12-23 21:47:12 +00:00
Diego Russo 450e836aef JIT: don't leak shim memory when shutting down the interpreter (#142984) 2025-12-23 17:50:00 +00:00
Mark Shannon 20aeb3a463 GH-143026: Fix assertion error in executor management. (GH-143104) 2025-12-23 17:19:34 +00:00
Tomas R. 25c294b6ea gh-134584: Eliminate redundant refcounting from _CALL_TYPE_1 (GH-135818) 2025-12-23 17:01:10 +00:00