@@ -28,7 +28,7 @@ extern PyTypeObject _PyUOpOptimizer_Type;
28
28
29
29
/* Symbols */
30
30
31
- struct _Py_UOpsSymType {
31
+ struct _Py_UopsSymbol {
32
32
int flags ;
33
33
PyTypeObject * typ ;
34
34
// constant propagated value (might be NULL)
@@ -38,34 +38,32 @@ struct _Py_UOpsSymType {
38
38
// Holds locals, stack, locals, stack ... co_consts (in that order)
39
39
#define MAX_ABSTRACT_INTERP_SIZE 4096
40
40
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)
44
42
45
43
// Need extras for root frame and for overflow frame (see TRACE_STACK_PUSH())
46
44
#define MAX_ABSTRACT_FRAME_DEPTH (TRACE_STACK_SIZE + 2)
47
45
48
- typedef struct _Py_UOpsSymType _Py_UOpsSymType ;
46
+ typedef struct _Py_UopsSymbol _Py_UopsSymbol ;
49
47
50
48
struct _Py_UOpsAbstractFrame {
51
49
// Max stacklen
52
50
int stack_len ;
53
51
int locals_len ;
54
52
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 ;
58
56
};
59
57
60
58
typedef struct _Py_UOpsAbstractFrame _Py_UOpsAbstractFrame ;
61
59
62
60
typedef struct ty_arena {
63
61
int ty_curr_number ;
64
62
int ty_max_number ;
65
- _Py_UOpsSymType arena [TY_ARENA_SIZE ];
63
+ _Py_UopsSymbol arena [TY_ARENA_SIZE ];
66
64
} ty_arena ;
67
65
68
- struct _Py_UOpsAbstractInterpContext {
66
+ struct _Py_UOpsContext {
69
67
PyObject_HEAD
70
68
// The current "executing" frame.
71
69
_Py_UOpsAbstractFrame * frame ;
@@ -75,40 +73,39 @@ struct _Py_UOpsAbstractInterpContext {
75
73
// Arena for the symbolic types.
76
74
ty_arena t_arena ;
77
75
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 ];
81
79
};
82
80
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 ,
104
102
PyCodeObject * co ,
105
- _Py_UOpsSymType * * localsplus_start ,
103
+ _Py_UopsSymbol * * localsplus_start ,
106
104
int n_locals_already_filled ,
107
105
int curr_stackentries );
108
- extern int _Py_uop_ctx_frame_pop ( _Py_UOpsAbstractInterpContext * ctx );
106
+ extern int _Py_uop_frame_pop ( _Py_UOpsContext * ctx );
109
107
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 );
112
109
113
110
#ifdef __cplusplus
114
111
}
0 commit comments