Skip to content

Commit 7d19466

Browse files
committed
Use JUMPBY(n) instead of next_instr += n
1 parent 0ef4da7 commit 7d19466

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

Python/generated_cases.c.h

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

Tools/cases_generator/generate_cases.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def write(self, out: Formatter) -> None:
186186

187187
# Write cache effect
188188
if self.cache_offset:
189-
out.emit(f"next_instr += {self.cache_offset};")
189+
out.emit(f"JUMPBY({self.cache_offset});")
190190

191191
def write_body(self, out: Formatter, dedent: int, cache_adjust: int = 0) -> None:
192192
"""Write the instruction body."""
@@ -601,11 +601,11 @@ def write_super(self, sup: SuperInstruction) -> None:
601601
for comp in sup.parts:
602602
if not first:
603603
self.out.emit("NEXTOPARG();")
604-
self.out.emit("next_instr++;")
604+
self.out.emit("JUMPBY(1);")
605605
first = False
606606
comp.write_body(self.out, 0)
607607
if comp.instr.cache_offset:
608-
self.out.emit(f"next_instr += {comp.instr.cache_offset};")
608+
self.out.emit(f"JUMPBY({comp.instr.cache_offset});")
609609

610610
def write_macro(self, mac: MacroInstruction) -> None:
611611
"""Write code for a macro instruction."""
@@ -620,7 +620,7 @@ def write_macro(self, mac: MacroInstruction) -> None:
620620
cache_adjust += comp.instr.cache_offset
621621

622622
if cache_adjust:
623-
self.out.emit(f"next_instr += {cache_adjust};")
623+
self.out.emit(f"JUMPBY({cache_adjust});")
624624

625625
@contextlib.contextmanager
626626
def wrap_super_or_macro(self, up: SuperOrMacroInstruction):

0 commit comments

Comments
 (0)