Skip to content

Commit b80bce1

Browse files
committed
add _STORE_ATTR_SLOT_NULL && rename
1 parent bf29c13 commit b80bce1

10 files changed

Lines changed: 1213 additions & 991 deletions

Include/internal/pycore_optimizer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ typedef struct _JitOptContext {
3737
// Arena for the symbolic types.
3838
ty_arena t_arena;
3939

40-
// Arena for the slots mappings.
41-
slots_arena s_arena;
40+
// Arena for the descriptor mappings.
41+
descr_arena d_arena;
4242

4343
JitOptRef *n_consumed;
4444
JitOptRef *limit;
@@ -300,9 +300,9 @@ extern JitOptRef _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptRef value,
300300
extern bool _Py_uop_sym_is_compact_int(JitOptRef sym);
301301
extern JitOptRef _Py_uop_sym_new_compact_int(JitOptContext *ctx);
302302
extern void _Py_uop_sym_set_compact_int(JitOptContext *ctx, JitOptRef sym);
303-
extern JitOptRef _Py_uop_sym_new_slots_object(JitOptContext *ctx, unsigned int type_version);
304-
extern JitOptRef _Py_uop_sym_slots_getattr(JitOptContext *ctx, JitOptRef ref, uint16_t slot_index);
305-
extern void _Py_uop_sym_slots_setattr(JitOptContext *ctx, JitOptRef ref, uint16_t slot_index, JitOptRef value);
303+
extern JitOptRef _Py_uop_sym_new_descr_object(JitOptContext *ctx, unsigned int type_version);
304+
extern JitOptRef _Py_uop_sym_get_attr(JitOptContext *ctx, JitOptRef ref, uint16_t slot_index);
305+
extern JitOptRef _Py_uop_sym_set_attr(JitOptContext *ctx, JitOptRef ref, uint16_t slot_index, JitOptRef value);
306306
extern JitOptRef _Py_uop_sym_new_predicate(JitOptContext *ctx, JitOptRef lhs_ref, JitOptRef rhs_ref, JitOptPredicateKind kind);
307307
extern void _Py_uop_sym_apply_predicate_narrowing(JitOptContext *ctx, JitOptRef sym, bool branch_is_true);
308308

Include/internal/pycore_optimizer_types.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ extern "C" {
1616

1717
#define TY_ARENA_SIZE (UOP_MAX_TRACE_LENGTH * 5)
1818

19-
// Maximum slots per object tracked symbolically
20-
#define MAX_SYMBOLIC_SLOTS_SIZE 16
21-
#define SLOTS_ARENA_SIZE (MAX_SYMBOLIC_SLOTS_SIZE * 100)
19+
// Maximum descriptor mappings per object tracked symbolically
20+
#define MAX_SYMBOLIC_DESCR_SIZE 16
21+
#define DESCR_ARENA_SIZE (MAX_SYMBOLIC_DESCR_SIZE * 100)
2222

2323
// Need extras for root frame and for overflow frame (see TRACE_STACK_PUSH())
2424
#define MAX_ABSTRACT_FRAME_DEPTH (16)
@@ -45,7 +45,7 @@ typedef enum _JitSymType {
4545
JIT_SYM_TRUTHINESS_TAG = 9,
4646
JIT_SYM_COMPACT_INT = 10,
4747
JIT_SYM_PREDICATE_TAG = 11,
48-
JIT_SYM_SLOTS_TAG = 12,
48+
JIT_SYM_DESCR_TAG = 12,
4949
} JitSymType;
5050

5151
typedef struct _jit_opt_known_class {
@@ -99,13 +99,13 @@ typedef struct {
9999
uint16_t symbol;
100100
} JitOptDescrMapping;
101101

102-
typedef struct _jit_opt_slots {
102+
typedef struct _jit_opt_descr {
103103
uint8_t tag;
104-
uint8_t num_slots;
104+
uint8_t num_descrs;
105105
uint16_t last_modified_index; // Index in out_buffer when this object was last modified
106106
uint32_t type_version;
107-
JitOptDescrMapping *slots;
108-
} JitOptSlotsObject;
107+
JitOptDescrMapping *descrs;
108+
} JitOptDescrObject;
109109

110110
typedef union _jit_opt_symbol {
111111
uint8_t tag;
@@ -115,7 +115,7 @@ typedef union _jit_opt_symbol {
115115
JitOptTuple tuple;
116116
JitOptTruthiness truthiness;
117117
JitOptCompactInt compact;
118-
JitOptSlotsObject slots;
118+
JitOptDescrObject descr;
119119
JitOptPredicate predicate;
120120
} JitOptSymbol;
121121

@@ -145,11 +145,11 @@ typedef struct ty_arena {
145145
JitOptSymbol arena[TY_ARENA_SIZE];
146146
} ty_arena;
147147

148-
typedef struct slots_arena {
149-
int slots_curr_number;
150-
int slots_max_number;
151-
JitOptDescrMapping arena[SLOTS_ARENA_SIZE];
152-
} slots_arena;
148+
typedef struct descr_arena {
149+
int descr_curr_number;
150+
int descr_max_number;
151+
JitOptDescrMapping arena[DESCR_ARENA_SIZE];
152+
} descr_arena;
153153

154154
#ifdef __cplusplus
155155
}

0 commit comments

Comments
 (0)