Commit Graph

10132 Commits

Author SHA1 Message Date
Peter Gessler f5685a266b gh-80620: Support negative timestamps on windows in time.gmtime, time.localtime, and datetime module (#143463)
Previously, negative timestamps (representing dates before 1970-01-01) were
not supported on Windows due to platform limitations. The changes introduce a
fallback implementation using the Windows FILETIME API, allowing negative
timestamps to be correctly handled in both UTC and local time conversions.
Additionally, related test code is updated to remove Windows-specific skips
and error handling, ensuring consistent behavior across platforms.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 10:51:11 +01:00
Donghee Na 794f758cd8 gh-141504: Refactor policy object into a single opt_config (gh-143644) 2026-01-15 09:53:00 +09:00
Mohammad Miadh Angkad 499706b843 GH-143842: Make optimizer color table static (GH-143846) 2026-01-14 20:37:13 +00:00
Ken Jin e370c8db52 gh-143123: Protect against recursive tracer calls/finalization (GH-143126)
* Stronger check for recursive traces

* Add a stop_tracing field

* Stop early when tracing exceptions
2026-01-14 12:23:14 +00:00
Mark Shannon 6db952eae9 GH-143613: Add colours and some more edges to executor visualization graph (GH-143809) 2026-01-14 11:34:58 +00:00
Duane Griffin ce8f5f98c6 gh-106287: Do not write objects after an unmarshalling error (GH-132715)
Writing out an object may involve a slot lookup, which is not safe to do with
an exception raised. In debug mode an assertion failure will occur if this
happens.
2026-01-14 11:25:46 +00:00
Hai Zhu 94dbce1397 gh-138050: Use cold flag instead of warm flag in MAKE_WARM (GH-143827) 2026-01-14 10:27:33 +00:00
Ken Jin 2873c31edf gh-131798: JIT optimizer: Support custom binary op and property frames (GH-143735) 2026-01-13 19:11:53 +00:00
reiden c556786b8b gh-134584: Eliminate redundant refcounting in TO_BOOL_INT, TO_BOOL_LIST (GH-143759) 2026-01-12 21:56:26 +00:00
Nadeshiko Manju e535bdb0a2 gh-134584: Eliminate redundant refcounting from _CONTAINS_{OP|OP_SET|OP_DICT} (GH-143731)
Signed-off-by: Manjusaka <me@manjusaka.me>
2026-01-12 15:47:31 +00:00
Cajetan Rodrigues 054a565c64 gh-134584: JIT: Remove redundant refcount for _BINARY_OP_SUBSCR_DICT (GH-143724) 2026-01-12 14:13:55 +00:00
Ken Jin 548526bbbe gh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704) 2026-01-11 20:42:55 +00:00
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