@@ -28,7 +28,7 @@ extern PyTypeObject _PyUOpOptimizer_Type;
2828
2929/* Symbols */
3030
31- struct _Py_UOpsSymType {
31+ struct _Py_UopsSymbol {
3232 int flags ;
3333 PyTypeObject * typ ;
3434 // constant propagated value (might be NULL)
@@ -38,34 +38,32 @@ struct _Py_UOpsSymType {
3838// Holds locals, stack, locals, stack ... co_consts (in that order)
3939#define MAX_ABSTRACT_INTERP_SIZE 4096
4040
41- #define OVERALLOCATE_FACTOR 5
42-
43- #define TY_ARENA_SIZE (UOP_MAX_TRACE_LENGTH * OVERALLOCATE_FACTOR)
41+ #define TY_ARENA_SIZE (UOP_MAX_TRACE_LENGTH * 5)
4442
4543// Need extras for root frame and for overflow frame (see TRACE_STACK_PUSH())
4644#define MAX_ABSTRACT_FRAME_DEPTH (TRACE_STACK_SIZE + 2)
4745
48- typedef struct _Py_UOpsSymType _Py_UOpsSymType ;
46+ typedef struct _Py_UopsSymbol _Py_UopsSymbol ;
4947
5048struct _Py_UOpsAbstractFrame {
5149 // Max stacklen
5250 int stack_len ;
5351 int locals_len ;
5452
55- _Py_UOpsSymType * * stack_pointer ;
56- _Py_UOpsSymType * * stack ;
57- _Py_UOpsSymType * * locals ;
53+ _Py_UopsSymbol * * stack_pointer ;
54+ _Py_UopsSymbol * * stack ;
55+ _Py_UopsSymbol * * locals ;
5856};
5957
6058typedef struct _Py_UOpsAbstractFrame _Py_UOpsAbstractFrame ;
6159
6260typedef struct ty_arena {
6361 int ty_curr_number ;
6462 int ty_max_number ;
65- _Py_UOpsSymType arena [TY_ARENA_SIZE ];
63+ _Py_UopsSymbol arena [TY_ARENA_SIZE ];
6664} ty_arena ;
6765
68- struct _Py_UOpsAbstractInterpContext {
66+ struct _Py_UOpsContext {
6967 PyObject_HEAD
7068 // The current "executing" frame.
7169 _Py_UOpsAbstractFrame * frame ;
@@ -75,40 +73,39 @@ struct _Py_UOpsAbstractInterpContext {
7573 // Arena for the symbolic types.
7674 ty_arena t_arena ;
7775
78- _Py_UOpsSymType * * n_consumed ;
79- _Py_UOpsSymType * * limit ;
80- _Py_UOpsSymType * locals_and_stack [MAX_ABSTRACT_INTERP_SIZE ];
76+ _Py_UopsSymbol * * n_consumed ;
77+ _Py_UopsSymbol * * limit ;
78+ _Py_UopsSymbol * locals_and_stack [MAX_ABSTRACT_INTERP_SIZE ];
8179};
8280
83- typedef struct _Py_UOpsAbstractInterpContext _Py_UOpsAbstractInterpContext ;
84-
85- extern bool _Py_uop_sym_is_null (_Py_UOpsSymType * sym );
86- extern bool _Py_uop_sym_is_not_null (_Py_UOpsSymType * sym );
87- extern bool _Py_uop_sym_is_const (_Py_UOpsSymType * sym );
88- extern PyObject * _Py_uop_sym_get_const (_Py_UOpsSymType * sym );
89- extern _Py_UOpsSymType * _Py_uop_sym_new_unknown (_Py_UOpsAbstractInterpContext * ctx );
90- extern _Py_UOpsSymType * _Py_uop_sym_new_not_null (_Py_UOpsAbstractInterpContext * ctx );
91- extern _Py_UOpsSymType * _Py_uop_sym_new_type (
92- _Py_UOpsAbstractInterpContext * ctx , PyTypeObject * typ );
93- extern _Py_UOpsSymType * _Py_uop_sym_new_const (_Py_UOpsAbstractInterpContext * ctx , PyObject * const_val );
94- extern _Py_UOpsSymType * _Py_uop_sym_new_null (_Py_UOpsAbstractInterpContext * ctx );
95- extern bool _Py_uop_sym_matches_type (_Py_UOpsSymType * sym , PyTypeObject * typ );
96- extern void _Py_uop_sym_set_null (_Py_UOpsSymType * sym );
97- extern void _Py_uop_sym_set_type (_Py_UOpsSymType * sym , PyTypeObject * tp );
98-
99- extern int _Py_uop_abstractcontext_init (_Py_UOpsAbstractInterpContext * ctx );
100- extern void _Py_uop_abstractcontext_fini (_Py_UOpsAbstractInterpContext * ctx );
101-
102- extern _Py_UOpsAbstractFrame * _Py_uop_ctx_frame_new (
103- _Py_UOpsAbstractInterpContext * ctx ,
81+ typedef struct _Py_UOpsContext _Py_UOpsContext ;
82+
83+ extern bool _Py_uop_sym_is_null (_Py_UopsSymbol * sym );
84+ extern bool _Py_uop_sym_is_not_null (_Py_UopsSymbol * sym );
85+ extern bool _Py_uop_sym_is_const (_Py_UopsSymbol * sym );
86+ extern PyObject * _Py_uop_sym_get_const (_Py_UopsSymbol * sym );
87+ extern _Py_UopsSymbol * _Py_uop_sym_new_unknown (_Py_UOpsContext * ctx );
88+ extern _Py_UopsSymbol * _Py_uop_sym_new_not_null (_Py_UOpsContext * ctx );
89+ extern _Py_UopsSymbol * _Py_uop_sym_new_type (
90+ _Py_UOpsContext * ctx , PyTypeObject * typ );
91+ extern _Py_UopsSymbol * _Py_uop_sym_new_const (_Py_UOpsContext * ctx , PyObject * const_val );
92+ extern _Py_UopsSymbol * _Py_uop_sym_new_null (_Py_UOpsContext * ctx );
93+ extern bool _Py_uop_sym_matches_type (_Py_UopsSymbol * sym , PyTypeObject * typ );
94+ extern void _Py_uop_sym_set_null (_Py_UopsSymbol * sym );
95+ extern void _Py_uop_sym_set_type (_Py_UopsSymbol * sym , PyTypeObject * tp );
96+
97+ extern int _Py_uop_abstractcontext_init (_Py_UOpsContext * ctx );
98+ extern void _Py_uop_abstractcontext_fini (_Py_UOpsContext * ctx );
99+
100+ extern _Py_UOpsAbstractFrame * _Py_uop_frame_new (
101+ _Py_UOpsContext * ctx ,
104102 PyCodeObject * co ,
105- _Py_UOpsSymType * * localsplus_start ,
103+ _Py_UopsSymbol * * localsplus_start ,
106104 int n_locals_already_filled ,
107105 int curr_stackentries );
108- extern int _Py_uop_ctx_frame_pop ( _Py_UOpsAbstractInterpContext * ctx );
106+ extern int _Py_uop_frame_pop ( _Py_UOpsContext * ctx );
109107
110- PyAPI_FUNC (PyObject * )
111- _Py_uop_symbols_test (PyObject * self , PyObject * ignored );
108+ PyAPI_FUNC (PyObject * ) _Py_uop_symbols_test (PyObject * self , PyObject * ignored );
112109
113110#ifdef __cplusplus
114111}
0 commit comments