aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/codegen.c
Commit message (Collapse)AuthorAge
* GH-131238: More refactoring of core header files (GH-131351)Mark Shannon2025-03-17
| | | | Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
* gh-130480: Move duplicate `LOAD_SMALL_INT` optimization from codegen to CFG ↵Yan Yanchii2025-03-14
| | | | (#130481)
* gh-130080: move _Py_EnsureArrayLargeEnough to a separate header so it can be ↵Irit Katriel2025-03-13
| | | | used outside of the compiler (#130930)
* gh-126835: Avoid creating unnecessary tuple when looking for constant ↵Yan Yanchii2025-03-12
| | | | sequence during constant folding (#131054)
* GH-123044: Give the `POP_TOP` after a case test a location in the body, not ↵Mark Shannon2025-03-10
| | | | the pattern. (GH-130627)
* GH-128534: Fix behavior of branch monitoring for `async for` (GH-130847)Mark Shannon2025-03-07
| | | * Both branches in a pair now have a common source and are included in co_branches
* gh-130740: Move some `stdbool.h` includes after `Python.h` (#130738)Hugo Beauzée-Luyssen2025-03-02
| | | | | Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not included first and when we are in a platform-agnostic context. This is to avoid having features defined by `stdbool.h` before those decided by `Python.h`.
* GH-128534: Instrument branches for `async for` loops. (GH-130569)Mark Shannon2025-02-27
|
* GH-130396: Use computed stack limits on linux (GH-130398)Mark Shannon2025-02-25
| | | | | | | | | | | * Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
* gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR ↵Irit Katriel2025-02-07
| | | | (#129700)
* gh-126835: Move constant subscript folding to CFG (#129568)Yan Yanchii2025-02-04
| | | | | Move folding of constant subscription from AST optimizer to CFG. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-126835: Move optimization of constant sequence creation from codegen to ↵Kirill Podoprigora2025-02-01
| | | | | | | | | | | | | | | | | | | | | | CFG (#129426) Codegen phase has an optimization that transforms ``` LOAD_CONST x LOAD_CONST y LOAD_CONXT z BUILD_LIST/BUILD_SET (3) ``` -> ``` BUILD_LIST/BUILD_SET (0) LOAD_CONST (x, y, z) LIST_EXTEND/SET_UPDATE 1 ``` This optimization has now been moved to CFG phase to make #128802 work. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
* GH-128914: Remove all but one conditional stack effects (GH-129226)Mark Shannon2025-01-27
| | | | | | | | | | | | | * Remove all 'if (0)' and 'if (1)' conditional stack effects * Use array instead of conditional for BUILD_SLICE args * Refactor LOAD_GLOBAL to use a common conditional uop * Remove conditional stack effects from LOAD_ATTR specializations * Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array. * Remove conditional stack effects from CALL_FUNCTION_EX
* Revert "GH-128914: Remove conditional stack effects from `bytecodes.c` and ↵Sam Gross2025-01-23
| | | | | | | the code generators (GH-128918)" (GH-129202) The commit introduced a ~2.5-3% regression in the free threading build. This reverts commit ab61d3f4303d14a413bc9ae6557c730ffdf7579e.
* GH-128914: Remove conditional stack effects from `bytecodes.c` and the code ↵Mark Shannon2025-01-20
| | | | generators (GH-128918)
* GH-128533: Add `NOT_TAKEN` instruction after bytecode optimization. (GH-128554)Mark Shannon2025-01-06
|
* GH-128375: Better instrument for `FOR_ITER` (GH-128445)Mark Shannon2025-01-06
|
* gh-119180: Set the name of the param to __annotate__ to "format" (#124730)Jelle Zijlstra2024-12-30
|
* GH-122548: Implement branch taken and not taken events for sys.monitoring ↵Mark Shannon2024-12-19
| | | | (GH-122564)
* gh-119180: Add VALUE_WITH_FAKE_GLOBALS format to annotationlib (#124415)Jelle Zijlstra2024-11-26
|
* Fix typo: Use AsyncFor element access in codegen (#127278)Marc Mueller2024-11-26
| | | Use AsyncFor element access in codegen
* gh-126072: Set docstring attribute for module and class (#126231)Xuanteng Huang2024-11-08
|
* gh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros ↵Bénédikt Tran2024-11-07
| | | | (#120018)
* gh-125832: Reformat comments for inlined comprehensions (gh-126346)Donghee Na2024-11-03
|
* gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (#126322)rimchoi2024-11-02
| | | | | | | | | | | | | | * Fix comprehensions comment to inlined by pep 709 * Update spacing Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com> * Add reference to PEP 709 --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com> Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)Xuanteng Huang2024-10-30
|
* GH-125837: Split `LOAD_CONST` into three. (GH-125972)Mark Shannon2024-10-29
| | | | | | | | * Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
* gh-125038: Fix crash after genexpr.gi_frame.f_locals manipulations (#125178)Mikhail Efimov2024-10-22
|
* gh-125063: Emit slices as constants in the bytecode compiler (#125064)Michael Droettboom2024-10-08
| | | | | | | | | | | | | | | | | | | | | | | * Make slices marshallable * Emit slices as constants * Update Python/marshal.c Co-authored-by: Peter Bierma <zintensitydev@gmail.com> * Refactor codegen_slice into two functions so it always has the same net effect * Fix for free-threaded builds * Simplify marshal loading of slices * Only return SUCCESS/ERROR from codegen_slice --------- Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-124285: Fix bug where bool() is called multiple times for the same part ↵Irit Katriel2024-09-25
| | | | of a boolean expression (#124394)
* gh-124058: remove _PyCompile_IsNestedScope, roll it into ↵Irit Katriel2024-09-16
| | | | _PyCompile_IsInteractive (#124061)
* gh-124022: Fix bug where class docstring is removed in interactive mode ↵Irit Katriel2024-09-13
| | | | | | | (#124023) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-124019: do not call codegen_annotations_in_scope if there are no ↵Irit Katriel2024-09-12
| | | | annotations (#124020)
* gh-124013: remove _PyCompile_IsTopLevelAwait (#124014)Irit Katriel2024-09-12
|
* gh-123958: apply docstring removal optimization in ast_opt instead of ↵Irit Katriel2024-09-11
| | | | codegen (#123959)
* gh-123881: make compiler add the .generic_base base class without ↵Irit Katriel2024-09-10
| | | | | | constructing AST nodes (#123883)
* gh-121404: split compile.c into compile.c and codegen.c (#123651)Irit Katriel2024-09-09