8000 GH-105229: Remove remaining two-codeunit superinstructions (GH-105326) · python/cpython@e830289 · GitHub
[go: up one dir, main page]

Skip to content

Commit e830289

Browse files
authored
GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)
* Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
1 parent 410c2f1 commit e830289

12 files changed

+521
-624
lines changed

Include/internal/pycore_opcode.h

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

Include/internal/pycore_opcode_utils.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ extern "C" {
5555
(opcode) == RAISE_VARARGS || \
5656
(opcode) == RERAISE)
5757

58-
#define IS_SUPERINSTRUCTION_OPCODE(opcode) \
59-
((opcode) == LOAD_FAST__LOAD_CONST || \
60-
(opcode) == LOAD_CONST__LOAD_FAST)
61-
62-
6358
#define LOG_BITS_PER_INT 5
6459
#define MASK_LOW_LOG_BITS 31
6560

Include/opcode.h

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

Lib/opcode.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,6 @@ def pseudo_op(name, op, real_ops):
409409
"LOAD_ATTR_METHOD_NO_DICT",
410410
"LOAD_ATTR_METHOD_WITH_VALUES",
411411
],
412-
"LOAD_CONST": [
413-
"LOAD_CONST__LOAD_FAST",
414-
],
415-
"LOAD_FAST": [
416-
"LOAD_FAST__LOAD_CONST",
417-
],
418412
"LOAD_GLOBAL": [
419413
"LOAD_GLOBAL_BUILTIN",
420414
"LOAD_GLOBAL_MODULE",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove remaining two-codeunit superinstructions. All remaining
2+
superinstructions only take a single codeunit, simplifying instrumentation
3+
and quickening.

Python/bytecodes.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ dummy_func(
233233
SETLOCAL(oparg2, value2);
234234
}
235235

236-
super(LOAD_FAST__LOAD_CONST) = LOAD_FAST + LOAD_CONST;
237-
super(LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST;
238-
239236
inst(POP_TOP, (value --)) {
240237
DECREF_INPUTS();
241238
}

Python/flowgraph.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,6 @@ scan_block_for_locals(basicblock *b, basicblock ***sp)
16761676
for (int i = 0; i < b->b_iused; i++) {
16771677
cfg_instr *instr = &b->b_instr[i];
16781678
assert(instr->i_opcode != EXTENDED_ARG);
1679-
assert(!IS_SUPERINSTRUCTION_OPCODE(instr->i_opcode));
16801679
if (instr->i_except != NULL) {
16811680
maybe_push(instr->i_except, unsafe_mask, sp);
16821681
}
@@ -1735,7 +1734,6 @@ fast_scan_many_locals(basicblock *entryblock, int nlocals)
17351734
for (int i = 0; i < b->b_iused; i++) {
17361735
cfg_instr *instr = &b->b_instr[i];
17371736
assert(instr->i_opcode != EXTENDED_ARG);
1738-
assert(!IS_SUPERINSTRUCTION_OPCODE(instr->i_opcode));
17391737
int arg = instr->i_oparg;
17401738
if (arg < 64) {
17411739
continue;

0 commit comments

Comments
 (0)
0