Commit Graph

4489 Commits

Author SHA1 Message Date
Mark Shannon 57e3c59bb6
GH-125521: Remove `if (true)` from generated output to reduce C compiler warnings (GH-125700) 2024-10-22 10:11:29 +01:00
Mikhail Efimov c1bdbe84c8
gh-124889: Rework Python generator cache (#125816) 2024-10-22 09:42:56 +01:00
Adam Turner f36d37bbaf
gh-125741: Update `build.yml` for the new check_autoconf_regen job (#125772) 2024-10-21 11:54:54 +01:00
Michael Droettboom c8fd4b12e3
gh-125207: Fix MSVC 1935 build with JIT (#125209)
* gh-125207: Use {0} array initializers

* Simplify, as suggested in PR

* Revert change to explicitly specify length
2024-10-18 15:51:29 -04:00
Wulian cda0ec8e7c
gh-124102: Clean up unsupported VS and WiX detections (GH-124784) 2024-10-18 13:48:18 +01:00
Kirill Podoprigora d83fcf8371
CI: Bump Python to 3.13 and mypy to 1.12 in mypy workflow (#125592)
* Bump mypy to 1.12 & Python to 3.13

* Remove unnecessary `type: ignore`
2024-10-16 14:27:19 +00:00
Kirill Podoprigora bee112a94d
gh-124872: Replace enter/exit events with "switched" (#125532)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-10-16 13:53:21 +02:00
Kirill Podoprigora d3c82b9cce
gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513) 2024-10-15 17:42:16 +03:00
Richard Hansen 843d28f59d
gh-124872: Replace enter/exit events with "switched" (#124776)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
2024-10-14 12:28:41 -07:00
Mikhail Efimov 187580d95c
gh-119786: [doc] broken link and typo fix in interpreter_definition.md (#125455) 2024-10-14 17:24:54 +00:00
Mark Shannon 06ca33020e
GH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes PyStackRefs. (GH-125439) 2024-10-14 14:18:57 +01:00
Ken Jin 4b358ee647
gh-125323: Remove some unsafe Py_DECREFs in bytecodes.c, replacing them with PyStackRef_CLOSEs (GH-125324) 2024-10-14 09:17:51 +01:00
Donghee Na 08f6bf7171
gh-124612: Update autoconf container image (#125320) 2024-10-12 00:27:26 +09:00
Mark Shannon c9014374c5
GH-125174: Make immortal objects more robust, following design from PEP 683 (GH-125251) 2024-10-10 18:19:08 +01:00
Tomas R. 6b533a659b
gh-125039: Make `this_instr`/`prev_instr` const in cases generator (GH-125071) 2024-10-09 13:54:39 +01:00
Donghee Na b502573f7f
gh-124612: Use ghcr.io/python/autoconf instead of public image (#124657)
* gh-124612: Use ghcr.io/python/autoconf instead of public image

* Update
2024-10-09 09:33:18 +09:00
Cody Maloney 7dca7322cc
gh-125084: Resolve paths in generator common code (GH-125085)
In out of tree builds, the paths can contain `../ which needs to be
resolved for the relative path calculation to work.
2024-10-08 12:16:02 -05:00
Bénédikt Tran e4292c0410
gh-123961: Convert _curses to a multi-phase init module (PEP-489) (#124965) 2024-10-08 13:42:44 +02:00
Mark Shannon da071fa3e8
GH-119866: Spill the stack around escaping calls. (GH-124392)
* Spill the evaluation around escaping calls in the generated interpreter and JIT. 

* The code generator tracks live, cached values so they can be saved to memory when needed.

* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
2024-10-07 14:56:39 +01:00
efimov-mikhail 1f9025a4e7
gh-124889: Remove redundant artificial rules in PEG parser (#124893)
Cache in C PEG-generator reworked:
we save artificial rules in cache by Node string representation as a key instead of Node object itself.
As a result total count of artificial rules in parsers.c is lowered from 283 to 170.
More natural number ordering is used for the names of artificial rules.

Auxiliary method CCallMakerVisitor._generate_artificial_rule_call is added.
Its purpose is abstracting work with artificial rules cache.

Explicit using of "is_repeat1" kwarg is added to visit_Repeat0 and visit_Repeat1 methods.
Its slightly improve code readabitily.
2024-10-03 13:58:56 +01:00
Diego Russo b85923a0fe
GH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872) 2024-10-02 12:07:20 -07:00
Savannah Ostrowski 6737333ac5
GH-124820: Move `-mno-outline-atomics` flag to aarch64 Linux JIT builds only (#124821) 2024-10-02 11:40:59 +02:00
Wulian da1e5526ae
gh-124487: Updated installer messages and internal docs regarding minimum Windows version (GH-124822) 2024-10-01 15:44:18 +01:00
Steve Dower fac5e7aa17
gh-124487: Require at least Windows 10 SDK and update install check (GH-124672) 2024-09-30 18:50:46 +01:00
Bénédikt Tran 4d8e7c40a0
gh-123961: Add a global state to _curses (#124729) 2024-09-29 15:17:20 +00:00
Bénédikt Tran c00964ecd5
gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` (#124677) 2024-09-29 02:25:23 +02:00
Jelle Zijlstra 25189188bf
generate_global_objects.py: Fix name of macro in error message (#124464)
_PyID does not exist but _Py_ID does.
2024-09-26 21:37:21 -07:00
Savannah Ostrowski 65f1237098
GH-123516: Improve JIT memory consumption by invalidating cold executors (GH-124443)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-27 00:35:42 +00:00
Brett Cannon 66cc6d4c50
Remove some unused files related to WASM/WASI (GH-124635) 2024-09-26 21:23:41 +00:00
Irit Katriel 78aeb38f7d
gh-124285: Fix bug where bool() is called multiple times for the same part of a boolean expression (#124394) 2024-09-25 15:51:25 +01:00
Savannah Ostrowski b6471f4a39
GH-124408: Temporarily skip test_strftime_y2k for emulated Linux JIT CI (GH-124466) 2024-09-24 18:09:50 -07:00
Sam Gross f4997bb3ac
gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)
Use a `_PyStackRef` and defer the reference to `f_funcobj` when
possible. This avoids some reference count contention in the common case
of executing the same code object from multiple threads concurrently in
the free-threaded build.
2024-09-24 20:08:18 +00:00
Jason Fried d87482bc4e
gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-09-23 20:40:17 -07:00
Hugo van Kemenade e256a7590a
Lint and format Tools/build/check-warnings.py (#124382) 2024-09-24 02:47:05 +03:00
Wulian 27a62e7371
gh-124102: Update internal PCbuild docs to accurately list build dependencies (GH-124103) 2024-09-23 23:09:22 +00:00
Mark Shannon c87b0e4a46
GH-124284: Add stats for refcount operations on immortal objects (GH-124288) 2024-09-23 19:10:55 +01:00
Steve Dower df7228ce14
gh-124254: Detect freethreaded MSI component when doing an upgrade on Windows (GH-124279) 2024-09-23 16:27:46 +01:00
Petr Viktorin aee219f455
gh-123880: Allow recursive import of single-phase-init modules (GH-123950)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
2024-09-20 10:27:34 +02:00
Nate Ohlson 81480e6edb
gh-124190: Ignore files directories check warning tooling (#124193)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-09-18 10:49:43 +03:00
Nate Ohlson 29a1a6e3ed
gh-124191: Disable -Wconversion in enable safety (gh-124192) 2024-09-18 12:55:09 +09:00
Victor Stinner 3aff1d0260
gh-124064: Fix -Wconversion warnings in Parser/pegen.c (#124181) 2024-09-17 15:58:43 +00:00
Victor Stinner ec08aa1fe4
gh-124064: Fix -Wconversion warnings in pycore_{long,object}.h (#124177)
Change also the fix for pycore_gc.h and pycore_stackref.h:
declare constants as uintptr_t, rather than casting constants.
2024-09-17 15:35:40 +00:00
Victor Stinner 98f93a32f3
gh-124064: Fix -Wconversion warnings in pycore_{gc,list,stackref}.h (#124174) 2024-09-17 14:43:39 +00:00
Petr Viktorin 4d09719341
Tools/build/stable_abi.py: Improve ergonomics (GH-105355)
* Tools/build/stable_abi.py: Improve ergonomics

- Make the manifest file argument optional
- Output resolved paths with --list (getting rid of `../../`)
- Mention --all or --generate-all if no actions are specified

* Don't hardcode Misc/stable_abi.toml in Makefile, rely on the default
2024-09-17 14:32:04 +02:00
Nate Ohlson 44052b5f18
gh-124064: Make warning emitting compiler options opt-in (#124070)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-09-16 20:22:30 +03:00
Hugo van Kemenade ea77973718
Revert "gh-112301: Enable warning emitting options and ignore warnings in CI (#123020)" (#124065) 2024-09-13 22:47:12 +03:00
Benjamin Peterson bb904e063d
closes gh-124016: update Unicode to 16.0.0 (#124017) 2024-09-13 07:47:04 -07:00
Nate Ohlson cfe6074d1f
gh-112301: Enable warning emitting options and ignore warnings in CI (#123020)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-09-13 13:40:04 +00:00
Bénédikt Tran acb3f875fb
gh-123961: Add `curses` prefix to global variables in `_cursesmodule.c` (#124047)
Use the `const char*` type instead of a `const *` for the encoding name.
2024-09-13 12:43:06 +00:00
Bénédikt Tran 403f3ddedc
gh-123961: Remove global variable `ModDict` in `_cursesmodule.c` (#123962) 2024-09-13 10:33:13 +00:00