gh-128563: A new tail-calling interpreter (GH-128718)

Co-authored-by: Garrett Gu <garrettgu777@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Ken Jin 2025-02-06 23:21:57 +08:00 committed by GitHub
parent 555dc50c81
commit cb640b659e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 3883 additions and 623 deletions

View file

@ -1387,7 +1387,9 @@ dummy_func(
tier1 inst(CLEANUP_THROW, (sub_iter_st, last_sent_val_st, exc_value_st -- none, value)) {
PyObject *exc_value = PyStackRef_AsPyObjectBorrow(exc_value_st);
#ifndef Py_TAIL_CALL_INTERP
assert(throwflag);
#endif
assert(exc_value && PyExceptionInstance_Check(exc_value));
int matches = PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration);
@ -5305,6 +5307,9 @@ dummy_func(
}
#endif
RELOAD_STACK();
#ifdef Py_TAIL_CALL_INTERP
int opcode;
#endif
DISPATCH();
}
@ -5351,8 +5356,10 @@ dummy_func(
caller loses its exception */
assert(!_PyErr_Occurred(tstate));
#endif
RELOAD_STACK();
#ifdef Py_TAIL_CALL_INTERP
int opcode;
#endif
DISPATCH();
}