@@ -22,6 +22,10 @@ typedef struct _PyJitUopBuffer {
2222 _PyUOpInstruction * end ;
2323} _PyJitUopBuffer ;
2424
25+ typedef struct _JitOptRefBuffer {
26+ JitOptRef * used ;
27+ JitOptRef * end ;
28+ } _JitOptRefBuffer ;
2529
2630typedef struct _JitOptContext {
2731 char done ;
@@ -37,10 +41,15 @@ typedef struct _JitOptContext {
3741 // Arena for the symbolic types.
3842 ty_arena t_arena ;
3943
40- JitOptRef * n_consumed ;
41- JitOptRef * limit ;
42- JitOptRef locals_and_stack [MAX_ABSTRACT_INTERP_SIZE ];
44+ /* To do -- We could make this more space efficient
45+ * by using a single array and growing the stack and
46+ * locals toward each other. */
47+ _JitOptRefBuffer locals ;
48+ _JitOptRefBuffer stack ;
49+ JitOptRef locals_array [ABSTRACT_INTERP_LOCALS_SIZE ];
50+ JitOptRef stack_array [ABSTRACT_INTERP_STACK_SIZE ];
4351 _PyJitUopBuffer out_buffer ;
52+ _PyBloomFilter * dependencies ;
4453} JitOptContext ;
4554
4655
@@ -83,13 +92,11 @@ typedef struct _PyJitTracerInitialState {
8392} _PyJitTracerInitialState ;
8493
8594typedef struct _PyJitTracerPreviousState {
86- bool dependencies_still_valid ;
8795 int instr_oparg ;
8896 int instr_stacklevel ;
8997 _Py_CODEUNIT * instr ;
9098 PyCodeObject * instr_code ; // Strong
9199 struct _PyInterpreterFrame * instr_frame ;
92- _PyBloomFilter dependencies ;
93100 PyObject * recorded_value ; // Strong, may be NULL
94101} _PyJitTracerPreviousState ;
95102
@@ -303,25 +310,24 @@ extern void _Py_uop_sym_set_recorded_type(JitOptContext *ctx, JitOptRef sym, PyT
303310extern void _Py_uop_sym_set_recorded_gen_func (JitOptContext * ctx , JitOptRef ref , PyFunctionObject * value );
304311extern PyCodeObject * _Py_uop_sym_get_probable_func_code (JitOptRef sym );
305312extern PyObject * _Py_uop_sym_get_probable_value (JitOptRef sym );
313+ extern JitOptRef * _Py_uop_sym_set_stack_depth (JitOptContext * ctx , int stack_depth , JitOptRef * current_sp );
306314
307- extern void _Py_uop_abstractcontext_init (JitOptContext * ctx );
315+ extern void _Py_uop_abstractcontext_init (JitOptContext * ctx , _PyBloomFilter * dependencies );
308316extern void _Py_uop_abstractcontext_fini (JitOptContext * ctx );
309317
310318extern _Py_UOpsAbstractFrame * _Py_uop_frame_new (
311319 JitOptContext * ctx ,
312320 PyCodeObject * co ,
313- int curr_stackentries ,
314321 JitOptRef * args ,
315322 int arg_len );
316323
317324extern _Py_UOpsAbstractFrame * _Py_uop_frame_new_from_symbol (
318325 JitOptContext * ctx ,
319326 JitOptRef callable ,
320- int curr_stackentries ,
321327 JitOptRef * args ,
322328 int arg_len );
323329
324- extern int _Py_uop_frame_pop (JitOptContext * ctx , PyCodeObject * co , int curr_stackentries );
330+ extern int _Py_uop_frame_pop (JitOptContext * ctx , PyCodeObject * co );
325331
326332PyAPI_FUNC (PyObject * ) _Py_uop_symbols_test (PyObject * self , PyObject * ignored );
327333
@@ -357,8 +363,6 @@ PyAPI_FUNC(void) _PyJit_FinalizeTracing(PyThreadState *tstate, int err);
357363void _PyPrintExecutor (_PyExecutorObject * executor , const _PyUOpInstruction * marker );
358364void _PyJit_TracerFree (_PyThreadStateImpl * _tstate );
359365
360- void _PyJit_Tracer_InvalidateDependency (PyThreadState * old_tstate , void * obj );
361-
362366#ifdef _Py_TIER2
363367typedef void (* _Py_RecordFuncPtr )(_PyInterpreterFrame * frame , _PyStackRef * stackpointer , int oparg , PyObject * * recorded_value );
364368PyAPI_DATA (const _Py_RecordFuncPtr ) _PyOpcode_RecordFunctions [];
0 commit comments