Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-119866: Spill before escaping calls in all cases. #124392

Merged
merged 62 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
75bda28
Add copy and == support to Stack class
markshannon Aug 7, 2024
c7e9102
Merge branch 'main' into stack-copy-and-merge
markshannon Aug 8, 2024
d331371
blacken stack.py
markshannon Aug 8, 2024
4673d8a
Cases generator: Track reachability and divergent stacks in if statem…
markshannon Aug 8, 2024
132df06
Fix type errors and rename ahead to look_ahead
markshannon Aug 9, 2024
b7f71d4
Track state of output variables
markshannon Aug 9, 2024
b97dea9
Handle stack and output locals togather as Storage class
markshannon Aug 9, 2024
9838a05
Track locals as well as stack on differing paths
markshannon Aug 9, 2024
1f829be
Use 'PEP 7' in syntax error, to make it clear that this is not a C sy…
markshannon Aug 27, 2024
d2e5f12
Push peeks back to stack in optimizer code gen
markshannon Aug 27, 2024
2753014
Merge branch 'main' into stack-copy-and-merge
markshannon Aug 27, 2024
1754fc4
Update test
markshannon Aug 27, 2024
98f9720
Cleanup whitespace
markshannon Aug 27, 2024
0284b3f
Add tests for PEP 7 parsing and escaping call in condition
markshannon Aug 27, 2024
03bea71
Remove merge artifact
markshannon Aug 27, 2024
ca2f457
Remove test for escaping calls in conditions
markshannon Aug 27, 2024
57de61f
Spill before escaping calls. Initial attempt
markshannon Aug 29, 2024
a2e430a
Clean up asserts
markshannon Aug 29, 2024
95408d3
Update test
markshannon Aug 29, 2024
eb3a645
Flush locals as well on error
markshannon Aug 29, 2024
00f5265
Spill stack on escaping calls. Preparatory work
markshannon Aug 29, 2024
7de1e60
Spill stack contents on escaping calls
markshannon Aug 30, 2024
3bfed1b
Find end of statement when anlyzing escaping calls
markshannon Aug 30, 2024
d7e1c82
Spill stack pointer as well. Work in progress
markshannon Aug 31, 2024
2cc4f64
Don't allow escaping calls in ERROR_IF or DEOPT_IF
markshannon Sep 9, 2024
8e258ad
Improve tracking of stack and locals in conditional flow
markshannon Sep 10, 2024
6da3fc6
Handle ERROR_NO_POP correctly
markshannon Sep 10, 2024
60ee3e9
Fix up handling of liveness
markshannon Sep 12, 2024
9f2f3bb
Allow assignments of new refs to input as well as output variables.
markshannon Sep 12, 2024
87b5561
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Sep 12, 2024
9dda555
Add explicit kills and more stack tracking
markshannon Sep 16, 2024
a387cb2
Final fixups
markshannon Sep 16, 2024
c95d367
Fix tests
markshannon Sep 16, 2024
dd0e9f6
Fix up tier 2 and optimizer generators
markshannon Sep 17, 2024
e5d0e67
Publish symbol for the JIT
markshannon Sep 17, 2024
fee5c3f
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Sep 20, 2024
d1f1d85
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Sep 23, 2024
2492e6d
Rename to KILL to the less aggressive DEAD
markshannon Sep 23, 2024
4c813d1
Add type annotations and workaround mypy's lack of flow sensitivity
markshannon Sep 23, 2024
8c94974
Add type ignore
markshannon Sep 23, 2024
794eea5
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Sep 25, 2024
16d6345
Address some review comments
markshannon Sep 30, 2024
b9c645e
Address more review comments
markshannon Sep 30, 2024
d822866
Revert TO_BOOL changes in optimizer_bytecodes.c
markshannon Sep 30, 2024
c61905a
Remove dead code
markshannon Sep 30, 2024
bded308
Better analysis of escaping calls
markshannon Sep 30, 2024
56b0bd5
Remove debug statement
markshannon Sep 30, 2024
ddd3bac
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Sep 30, 2024
e2408e2
Find escaping calls of form (func)(args) and table[oparg](args)
markshannon Sep 30, 2024
7cd6f90
Refactor optimizer_bytecodes.c a bit to help codegen understand it
markshannon Sep 30, 2024
7a77491
Fix lexer bug
markshannon Oct 1, 2024
60f5054
Tweak formatting of code directly after C macros
markshannon Oct 1, 2024
d3d6259
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Oct 2, 2024
6771c4a
Remove debugging code
markshannon Oct 3, 2024
8c48eaa
Add more non-escaping functions
markshannon Oct 3, 2024
6288f80
Move casts to avoid extra spilling. Regenerate files
markshannon Oct 3, 2024
d183767
Sort non-escaping function names
markshannon Oct 3, 2024
0244d77
A cast to (int) is not a call
markshannon Oct 3, 2024
efb5e7d
Prohibit switch statements in bytecodes.c and remove the last one.
markshannon Oct 3, 2024
de3b86c
Insert extra braces to handle 'else if' without an 'else' correctly.
markshannon Oct 3, 2024
2db84df
Merge branch 'main' into spill-before-escaping-calls-2
markshannon Oct 3, 2024
a1e55d4
Fix test. gc.get_referrers can now see values on generator stacks
markshannon Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Include/internal/pycore_ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ typedef struct _special_method {
} _Py_SpecialMethod;

PyAPI_DATA(const _Py_SpecialMethod) _Py_SpecialMethods[];
PyAPI_DATA(const size_t) _Py_FunctionAttributeOffsets[];

PyAPI_FUNC(int) _PyEval_CheckExceptStarTypeValid(PyThreadState *tstate, PyObject* right);
PyAPI_FUNC(int) _PyEval_CheckExceptTypeValid(PyThreadState *tstate, PyObject* right);
Expand All @@ -274,6 +275,8 @@ PyAPI_FUNC(PyObject *) _PyEval_GetANext(PyObject *aiter);
PyAPI_FUNC(void) _PyEval_LoadGlobalStackRef(PyObject *globals, PyObject *builtins, PyObject *name, _PyStackRef *writeto);
PyAPI_FUNC(PyObject *) _PyEval_GetAwaitable(PyObject *iterable, int oparg);
PyAPI_FUNC(PyObject *) _PyEval_LoadName(PyThreadState *tstate, _PyInterpreterFrame *frame, PyObject *name);
PyAPI_FUNC(int)
_Py_Check_ArgsIterable(PyThreadState *tstate, PyObject *func, PyObject *args);

/* Bits that can be set in PyThreadState.eval_breaker */
#define _PY_GIL_DROP_REQUEST_BIT (1U << 0)
Expand Down
42 changes: 18 additions & 24 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading