Skip to content

Commit 0e08c38

Browse files
committed
Tidy up loose ends
1 parent 3278bd2 commit 0e08c38

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

Python/optimizer_analysis.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,6 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
297297
INST->oparg = ARG; \
298298
INST->operand = OPERAND;
299299

300-
#define OUT_OF_SPACE_IF_NULL(EXPR) (EXPR)
301-
302-
#define _LOAD_ATTR_NOT_NULL \
303-
do { \
304-
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_not_null(ctx)); \
305-
OUT_OF_SPACE_IF_NULL(null = _Py_uop_sym_new_null(ctx)); \
306-
} while (0);
307-
308-
309300
/* Shortened forms for convenience, used in optimizer_bytecodes.c */
310301
#define sym_is_not_null _Py_uop_sym_is_not_null
311302
#define sym_is_const _Py_uop_sym_is_const

Python/optimizer_bytecodes.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ dummy_func(void) {
419419
}
420420

421421
op(_LOAD_ATTR_INSTANCE_VALUE, (index/1, owner -- attr, null if (oparg & 1))) {
422-
_LOAD_ATTR_NOT_NULL
422+
attr = sym_new_not_null(ctx);
423+
null = sym_new_null(ctx);
423424
(void)index;
424425
(void)owner;
425426
}
@@ -462,7 +463,7 @@ dummy_func(void) {
462463
PyObject *res = convert_global_to_const(this_instr, dict);
463464
if (res != NULL) {
464465
this_instr[-1].opcode = _POP_TOP;
465-
OUT_OF_SPACE_IF_NULL(attr = sym_new_const(ctx, res));
466+
attr = sym_new_const(ctx, res);
466467
}
467468
}
468469
if (attr == NULL) {
@@ -472,19 +473,22 @@ dummy_func(void) {
472473
}
473474

474475
op(_LOAD_ATTR_WITH_HINT, (hint/1, owner -- attr, null if (oparg & 1))) {
475-
_LOAD_ATTR_NOT_NULL
476+
attr = sym_new_not_null(ctx);
477+
null = sym_new_null(ctx);
476478
(void)hint;
477479
(void)owner;
478480
}
479481

480482
op(_LOAD_ATTR_SLOT, (index/1, owner -- attr, null if (oparg & 1))) {
481-
_LOAD_ATTR_NOT_NULL
483+
attr = sym_new_not_null(ctx);
484+
null = sym_new_null(ctx);
482485
(void)index;
483486
(void)owner;
484487
}
485488

486489
op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr, null if (oparg & 1))) {
487-
_LOAD_ATTR_NOT_NULL
490+
attr = sym_new_not_null(ctx);
491+
null = sym_new_null(ctx);
488492
(void)descr;
489493
(void)owner;
490494
}

Python/optimizer_cases.c.h

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_symbols.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ _Py_uop_sym_set_type(_Py_UOpsContext *ctx, _Py_UopsSymbol *sym, PyTypeObject *ty
143143
if (sym->typ != NULL) {
144144
if (sym->typ != typ) {
145145
sym_set_bottom(ctx, sym);
146-
ctx->contradiction = true;
147146
return;
148147
}
149148
}

0 commit comments

Comments
 (0)