mirror of
https://github.com/python/cpython.git
synced 2026-04-18 01:41:27 +00:00
gh-143421: Move JitOptContext from stack allocation to per-thread heap allocation (GH-143536)
* move JitOptContext to _PyThreadStateImpl * make _PyUOpInstruction buffer a part of _PyThreadStateImpl Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
cea2d2475d
commit
aeb3403563
6 changed files with 150 additions and 147 deletions
|
|
@ -1025,13 +1025,6 @@ _PyJit_TryInitializeTracing(
|
|||
if (oparg > 0xFFFF) {
|
||||
return 0;
|
||||
}
|
||||
if (_tstate->jit_tracer_state.code_buffer == NULL) {
|
||||
_tstate->jit_tracer_state.code_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE);
|
||||
if (_tstate->jit_tracer_state.code_buffer == NULL) {
|
||||
// Don't error, just go to next instruction.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
PyObject *func = PyStackRef_AsPyObjectBorrow(frame->f_funcobj);
|
||||
if (func == NULL) {
|
||||
return 0;
|
||||
|
|
@ -1484,8 +1477,8 @@ uop_optimize(
|
|||
OPT_STAT_INC(traces_created);
|
||||
if (!is_noopt) {
|
||||
length = _Py_uop_analyze_and_optimize(
|
||||
_tstate->jit_tracer_state.initial_state.func,
|
||||
buffer,length,
|
||||
_tstate,
|
||||
buffer, length,
|
||||
curr_stackentries, dependencies);
|
||||
if (length <= 0) {
|
||||
return length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue