Skip to content

Commit 536ee25

Browse files
committed
Remove support for GO_TO_INSTRUCTION
1 parent 7e8d188 commit 536ee25

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

Python/bytecodes.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "ceval_macros.h"
4646

4747
/* Flow control macros */
48-
#define GO_TO_INSTRUCTION(instname) ((void)0)
4948

5049
#define inst(name, ...) case name:
5150
#define op(name, ...) /* NAME is ignored */

Tools/cases_generator/analyzer.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@ def find_escaping_api_calls(instr: parser.InstDef) -> dict[lexer.Token, tuple[le
734734

735735
EXITS = {
736736
"DISPATCH",
737-
"GO_TO_INSTRUCTION",
738737
"Py_UNREACHABLE",
739738
"DISPATCH_INLINED",
740739
"DISPATCH_GOTO",
@@ -1183,17 +1182,6 @@ def analyze_forest(forest: list[parser.AstNode]) -> Analysis:
11831182
add_label(node, labels)
11841183
case _:
11851184
pass
1186-
for uop in uops.values():
1187-
tkn_iter = iter(uop.body)
1188-
for tkn in tkn_iter:
1189-
if tkn.kind == "IDENTIFIER" and tkn.text == "GO_TO_INSTRUCTION":
1190-
if next(tkn_iter).kind != "LPAREN":
1191-
continue
1192-
target = next(tkn_iter)
1193-
if target.kind != "IDENTIFIER":
1194-
continue
1195-
if target.text in instructions:
1196-
instructions[target.text].is_target = True
11971185
for uop in uops.values():
11981186
uop.instruction_size = get_instruction_size_for_uop(instructions, uop)
11991187
# Special case BINARY_OP_INPLACE_ADD_UNICODE

Tools/cases_generator/generators_common.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ def __init__(self, out: CWriter):
126126
"PyStackRef_AsPyObjectSteal": self.stackref_steal,
127127
"DISPATCH": self.dispatch,
128128
"INSTRUCTION_SIZE": self.instruction_size,
129-
"POP_INPUT": self.pop_input,
130-
"GO_TO_INSTRUCTION": self.go_to_instruction,
129+
"POP_INPUT": self.pop_input
131130
}
132131
self.out = out
133132

@@ -406,23 +405,6 @@ def sync_sp(
406405
self._print_storage(storage)
407406
return True
408407

409-
def go_to_instruction(
410-
self,
411-
tkn: Token,
412-
tkn_iter: TokenIterator,
413-
uop: Uop,
414-
storage: Storage,
415-
inst: Instruction | None,
416-
) -> bool:
417-
next(tkn_iter)
418-
name = next(tkn_iter)
419-
next(tkn_iter)
420-
next(tkn_iter)
421-
assert name.kind == "IDENTIFIER"
422-
self.emit("\n")
423-
self.emit(f"goto PREDICTED_{name.text};\n")
424-
return True
425-
426408
def emit_save(self, storage: Storage) -> None:
427409
storage.save(self.out)
428410
self._print_storage(storage)

0 commit comments

Comments
 (0)