Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
a6275f1
merge from upstream
Apr 30, 2024
7e7627f
remove test tags
Apr 30, 2024
00dde8e
add test for immortal
Apr 30, 2024
eadc4fc
Merge remote-tracking branch 'upstream/main' into stackref_all
Apr 30, 2024
64e2800
minor cleanups
Apr 30, 2024
bf6b7e4
Create 2024-05-01-05-09-16.gh-issue-117139.t41w_D.rst
Apr 30, 2024
865ff8d
remove bad assert
Apr 30, 2024
b1777c4
rename tagged -> stackref
May 1, 2024
50cfefa
trivial fixes first
May 2, 2024
39e9057
fix anti-patterns (use deferred everywhere)
May 2, 2024
1bb3c51
Delete 2024-03-26-20-31-34.gh-issue-117139.eELvoZ.rst
May 2, 2024
18ef669
Merge remote-tracking branch 'upstream/main' into stackref_all
May 2, 2024
3fedc6f
replace and use macro
May 2, 2024
1942d78
fix refcounting issues
May 4, 2024
5a1c46f
Fix decref inputs problem
May 4, 2024
dcc55b0
fix cases generator
May 4, 2024
ec70b3b
Merge remote-tracking branch 'upstream/main' into stackref_all
May 4, 2024
542cfbb
fix problems from upstream
May 4, 2024
3af1ef1
cleanup
May 4, 2024
6bc29a1
formatting
May 4, 2024
9052526
change used tags to 0b01
May 5, 2024
c38de34
alignment
May 5, 2024
106058c
Merge remote-tracking branch 'upstream/main' into stackref_all
May 6, 2024
f545b2f
fix merge problems
May 6, 2024
0d1b38f
Merge remote-tracking branch 'upstream/main' into stackref_all
May 8, 2024
a597536
use PyStackRef_IsNull
May 8, 2024
9d43727
tagged ->stackref
May 8, 2024
bc96ae6
use Mark's naming scheme
May 8, 2024
1d71dd1
Merge remote-tracking branch 'upstream/main' into stackref_all
May 8, 2024
e12337a
Update pycore_object_deferred.h
May 8, 2024
91a8c81
tag all pointers, address some comments
May 9, 2024
64bdfe2
fix free threaded, address more reviews
May 9, 2024
88e0ea8
remove GC changes
May 9, 2024
64b237c
address all of Mark's review
May 10, 2024
97f6e14
Merge remote-tracking branch 'upstream/main' into stackref_all
May 10, 2024
834cdf0
fix refcounting issue
May 10, 2024
99611cb
fix gdb failures
May 10, 2024
512cd2e
fix specialization
May 10, 2024
df176bf
fix tier 2
May 10, 2024
576909d
fix optimizer builds
May 10, 2024
adb54d8
don't check immortal when tagging
May 10, 2024
d86652f
remove immortal check for tagging
May 10, 2024
bca14a8
remove unsafe ptr conversions
May 10, 2024
4eaece7
Revert "remove immortal check for tagging"
May 10, 2024
4930f6f
Revert "don't check immortal when tagging"
May 10, 2024
8670ee4
tag immortal objects
May 10, 2024
144a6fa
Remove PyObject_To_StackRef_Steal
May 10, 2024
c2bbe17
minor clenaups
May 11, 2024
a6bfc97
Merge remote-tracking branch 'upstream/main' into stackref_all
May 27, 2024
e21a76a
Use Sam's and Mark's naming scheme
May 28, 2024
e12942d
Merge remote-tracking branch 'upstream/main' into stackref_all
May 28, 2024
64c070d
regen
May 28, 2024
4a103fb
fix test_generated_cases
May 28, 2024
0bd7435
address partially reviews
Jun 4, 2024
51908e9
convert the rest to stackrefs
Jun 4, 2024
e99f019
fix tests
Jun 4, 2024
fde830d
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 4, 2024
c73f8ac
ifdef out on default builds
Jun 4, 2024
6a6bae2
add back XCLOSE and XDUP for perf reasons
Jun 4, 2024
3d23f56
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 5, 2024
99fa382
Low the C recursion limit in WASI, it's failing
Jun 5, 2024
5a5e329
Revert "Low the C recursion limit in WASI, it's failing"
Jun 5, 2024
4a5ae8c
use macros instead of static inline for most things
Jun 5, 2024
4e9740d
Revert "use macros instead of static inline for most things"
Jun 5, 2024
c49cf1c
double WASI stack size of pydebug
Jun 5, 2024
1b45992
Revert "Revert "use macros instead of static inline for most things""
Jun 5, 2024
e5130a9
Revert "double WASI stack size of pydebug"
Jun 5, 2024
505d640
inline functions directly for non-gil to pass on WASI debug
Jun 5, 2024
5053536
Update configure
Jun 5, 2024
0242212
convert more stuff to macros to try fix wasi
Jun 5, 2024
12f8c0e
Increase wasm limit to 32kb
Jun 5, 2024
db89f64
Revert "Increase wasm limit to 32kb"
Jun 5, 2024
79714c2
skip test on WASI
Jun 5, 2024
9a33b7f
fix uses of dup
Jun 6, 2024
18894ca
refactor calls according to Mark
Jun 6, 2024
67e0d25
fix bug
Jun 6, 2024
4423794
fix macro
Jun 6, 2024
66eb526
regen frozemain?
Jun 6, 2024
2eda2f9
add PyStackRef_IsFalse/True
Jun 6, 2024
8f97ae2
skip bad test
Jun 6, 2024
58c3c55
fix tier 2 and JIT builds
Jun 6, 2024
ca92d4a
fix macro
Jun 7, 2024
3356eda
fix error handling
Jun 7, 2024
8274425
revert unicode
Jun 7, 2024
4405a5c
DCE hack
Jun 7, 2024
2d69426
revert dictionary
Jun 7, 2024
4f4107a
revert slice
Jun 7, 2024
65be3fd
revert lists
Jun 7, 2024
78dbf36
revert tuple
Jun 7, 2024
a21eddd
Address review
Jun 10, 2024
d744c8a
address changes (woops)
Jun 10, 2024
6c76fe3
Address half of Mark's review
Jun 11, 2024
8dc4fc6
Address rest of review
Jun 11, 2024
8044c7e
Address rest of review
Jun 11, 2024
90ebfc4
rename for clarity
Jun 11, 2024
e4ccb65
rename PyStackRef_AsPyObjectDeferredToNew -> PyStackRef_AsPyObjectDef…
Jun 12, 2024
2ff4f36
Drop defer, just steal
Jun 12, 2024
992731d
Address half of Mark's review
Jun 13, 2024
12f19ce
revert test frozenmain changes
Jun 13, 2024
268eb0e
remove istrue
Jun 13, 2024
d3b9e51
remove isfalse
Jun 13, 2024
680e828
remove isnone
Jun 13, 2024
27eda47
rename gen_frame_o
Jun 13, 2024
be25a04
Fixup
Jun 13, 2024
ae8c050
rename
Jun 13, 2024
6e84d69
rename true and false to static const
Jun 13, 2024
c523386
try fix on msvc
Jun 13, 2024
d565b0d
try fix
Jun 13, 2024
983764c
fix codegen
Jun 14, 2024
7f3c02d
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 14, 2024
656f35c
Use macro
Jun 14, 2024
92ada68
rename to PyStackRef_none
Jun 14, 2024
24bd03f
Fix tier 2 generation
Jun 14, 2024
fd1140c
cleanup code generator
Jun 14, 2024
fc66d1c
Change is_abstract to extract_bits
Jun 14, 2024
9dda41f
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 17, 2024
233f9e2
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 17, 2024
ef5a057
address review: use macro for conversion
Jun 17, 2024
d2c14f7
fix space issue
Jun 17, 2024
09a3848
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 18, 2024
40e72e1
(test) remove skips
Jun 18, 2024
b33d161
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 18, 2024
b160409
fix upstream changes
Jun 18, 2024
8ffd7ff
Convert functions back to static inline
Jun 19, 2024
cbc1b6f
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 19, 2024
6adbcbf
Update test_frozenmain.h
Jun 19, 2024
fdd24d6
Tighten diff
Jun 20, 2024
9acd39d
Apply all suggestions and reviews by Mark
Jun 21, 2024
e600102
Apply comment from line 1112
Jun 21, 2024
add5f75
borrow, not steal
Jun 21, 2024
f811462
Add documentation and guide
Jun 22, 2024
c4dd69b
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 22, 2024
60e2bb4
Address review by Mark
Jun 22, 2024
c7eac22
fix for free-threaded builds
Jun 22, 2024
8bf685a
fix typo
Jun 22, 2024
7cf0369
Rename Py_STACKREF_NULL to PyStackRef_NULL
Jun 23, 2024
37c31d1
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 24, 2024
2d38baa
Reduce scratch size on apple
Jun 25, 2024
8d82237
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 25, 2024
a959249
Address review, increase scratch
Jun 25, 2024
cab1d5b
Apply most suggestions
Jun 26, 2024
ee6630f
Fix write underflow
Jun 26, 2024
9b67932
reduce stack requirements
Jun 26, 2024
475e2dc
Update ceval_macros.h
Jun 26, 2024
126b60d
fix off by one
Jun 26, 2024
197e1ba
regen
Jun 26, 2024
4074bc3
undo immortal changes (they caused asserts to fail)
Jun 26, 2024
50c92d0
Merge remote-tracking branch 'upstream/main' into stackref_all
Jun 26, 2024
ce77fe4
Fix bug in malloc case
Jun 26, 2024
193e216
Use immortal
Jun 26, 2024
30f7a09
Remove borrowed load in counter_optimize
Jun 26, 2024
ff41e0c
silence warning
Jun 26, 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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into stackref_all
  • Loading branch information
Fidget-Spinner committed Jun 18, 2024
commit b33d161fb5bb7d8ad728bbaff8b91066cbc2d5bb
92 changes: 14 additions & 78 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3102,86 +3102,22 @@ dummy_func(
_FOR_ITER_GEN_FRAME +
_PUSH_FRAME;

inst(BEFORE_ASYNC_WITH, (mgr -- exit, res)) {
PyObject *exit_o;
PyObject *mgr_o = PyStackRef_AsPyObjectBorrow(mgr);
PyObject *res_o;

PyObject *enter = _PyObject_LookupSpecial(mgr_o, &_Py_ID(__aenter__));
if (enter == NULL) {
if (!_PyErr_Occurred(tstate)) {
_PyErr_Format(tstate, PyExc_TypeError,
"'%.200s' object does not support the "
"asynchronous context manager protocol",
Py_TYPE(mgr_o)->tp_name);
}
ERROR_NO_POP();
}
exit_o = _PyObject_LookupSpecial(mgr_o, &_Py_ID(__aexit__));
if (exit_o == NULL) {
if (!_PyErr_Occurred(tstate)) {
_PyErr_Format(tstate, PyExc_TypeError,
"'%.200s' object does not support the "
"asynchronous context manager protocol "
"(missed __aexit__ method)",
Py_TYPE(mgr_o)->tp_name);
}
Py_DECREF(enter);
ERROR_NO_POP();
}

DECREF_INPUTS();
res_o = PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res_o == NULL) {
Py_DECREF(exit_o);
ERROR_IF(true, error);
}
exit = PyStackRef_FromPyObjectSteal(exit_o);
res = PyStackRef_FromPyObjectSteal(res_o);
}

inst(BEFORE_WITH, (mgr -- exit, res)) {
PyObject *exit_o;
PyObject *mgr_o = PyStackRef_AsPyObjectBorrow(mgr);
PyObject *res_o;
/* pop the context manager, push its __exit__ and the
* value returned from calling its __enter__
*/
PyObject *enter = _PyObject_LookupSpecial(mgr_o, &_Py_ID(__enter__));
if (enter == NULL) {
inst(LOAD_SPECIAL, (owner -- attr, self_or_null)) {
assert(oparg <= SPECIAL_MAX);
PyGenObject *owner_o = (PyGenObject *)PyStackRef_AsPyObjectSteal(owner_o);
PyObject *name = _Py_SpecialMethods[oparg].name;
attr = PyStackRef_FromPyObjectSteal(_PyObject_LookupSpecialMethod(owner_o, name, &self_or_null));
if (PyStackRef_IsNull(attr)) {
if (!_PyErr_Occurred(tstate)) {
_PyErr_Format(tstate, PyExc_TypeError,
"'%.200s' object does not support the "
"context manager protocol",
Py_TYPE(mgr_o)->tp_name);
_Py_SpecialMethods[oparg].error,
Py_TYPE(owner_o)->tp_name);
}
ERROR_NO_POP();
}
exit_o = _PyObject_LookupSpecial(mgr_o, &_Py_ID(__exit__));
if (exit_o == NULL) {
if (!_PyErr_Occurred(tstate)) {
_PyErr_Format(tstate, PyExc_TypeError,
"'%.200s' object does not support the "
"context manager protocol "
"(missed __exit__ method)",
Py_TYPE(mgr_o)->tp_name);
}
Py_DECREF(enter);
ERROR_NO_POP();
}
DECREF_INPUTS();
res_o = PyObject_CallNoArgs(enter);
Py_DECREF(enter);
if (res_o == NULL) {
Py_DECREF(exit_o);
ERROR_IF(true, error);
}
exit = PyStackRef_FromPyObjectSteal(exit_o);
res = PyStackRef_FromPyObjectSteal(res_o);
ERROR_IF(PyStackRef_IsNull(attr), error);
}

inst(WITH_EXCEPT_START, (exit_func, lasti, unused, val -- exit_func, lasti, unused, val, res)) {
inst(WITH_EXCEPT_START, (exit_func, exit_self, lasti, unused, val -- exit_func, exit_self, lasti, unused, val, res)) {
/* At the top of the stack are 4 values:
- val: TOP = exc_info()
- unused: SECOND = previous exception
Expand All @@ -3207,10 +3143,10 @@ dummy_func(
}
assert(PyLong_Check(PyStackRef_AsPyObjectBorrow(lasti)));
(void)lasti; // Shut up compiler warning if asserts are off
PyObject * stack[4] = {NULL, exc, val_o, tb};
res = PyStackRef_FromPyObjectSteal(
PyObject_Vectorcall(exit_func_o, stack + 1,
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL));
PyObject *stack[5] = {NULL, PyStackRef_AsPyObjectBorrow(exit_self), exc, val, tb};
int has_self = !PyStackRef_IsNull(exit_self);
res = PyStackRef_FromPyObjectSteal(PyObject_Vectorcall(exit_func, stack + 2 - has_self,
(3 + has_self) | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL));
ERROR_IF(PyStackRef_IsNull(res), error);
}

Expand Down
22 changes: 12 additions & 10 deletions Python/executor_cases.c.h

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

121 changes: 12 additions & 109 deletions Python/generated_cases.c.h

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

You are viewing a condensed version of this merge commit. You can view the full changes here.