mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
[3.11] GH-93516: Backport GH-93769 (GH-94231)
* Store offset of first traceable instruction to avoid having to recompute it all the time when tracing.
This commit is contained in:
parent
50a2e36ce9
commit
3b4f5ed168
7 changed files with 217 additions and 209 deletions
|
@ -341,6 +341,12 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
|
|||
co->_co_linearray = NULL;
|
||||
memcpy(_PyCode_CODE(co), PyBytes_AS_STRING(con->code),
|
||||
PyBytes_GET_SIZE(con->code));
|
||||
int entry_point = 0;
|
||||
while (entry_point < Py_SIZE(co) &&
|
||||
_Py_OPCODE(_PyCode_CODE(co)[entry_point]) != RESUME) {
|
||||
entry_point++;
|
||||
}
|
||||
co->_co_firsttraceable = entry_point;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue