Skip to content

Commit 807a359

Browse files
committed
fixup
1 parent a577c36 commit 807a359

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Tools/jit/_optimizers.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class Optimizer:
9292
def __post_init__(self) -> None:
9393
# Split the code into a linked list of basic blocks. A basic block is an
9494
# optional label, followed by zero or more non-instruction ("noise")
95-
# lines, followed by one or more instruction lines (only the last of
96-
# which may be a branch, jump, or return).
95+
# lines, followed by zero or more instruction lines (only the last of
96+
# which may be a branch, jump, or return):
9797
text = self._preprocess(self.path.read_text())
9898
block = self._root
9999
for line in text.splitlines():
@@ -114,15 +114,15 @@ def __post_init__(self) -> None:
114114
block.link = block = _Block()
115115
block.instructions.append(line)
116116
if match := self._re_branch.match(line):
117-
# A block ending in a branch has a target, and fallthrough:
117+
# A block ending in a branch has a target and fallthrough:
118118
block.target = self._lookup_label(match["target"])
119119
assert block.fallthrough
120120
elif match := self._re_jump.match(line):
121-
# A block ending in a jump has a target, and no fallthrough:
121+
# A block ending in a jump has a target and no fallthrough:
122122
block.target = self._lookup_label(match["target"])
123123
block.fallthrough = False
124124
elif self._re_return.match(line):
125-
# A block ending in a return has no target, and fallthrough:
125+
# A block ending in a return has no target and fallthrough:
126126
assert not block.target
127127
block.fallthrough = False
128128

@@ -196,7 +196,8 @@ def _insert_continue_label(self) -> None:
196196
# After:
197197
# jmp FOO
198198
# .balign 8
199-
# _JIT_CONTINUE:
199+
# _JIT_CONTINUE:
200+
# This lets the assembler encode _JIT_CONTINUE jumps at build time!
200201
align = _Block()
201202
align.noise.append(f"\t.balign\t{self._alignment}")
202203
continuation = self._lookup_label(f"{self.prefix}_JIT_CONTINUE")

0 commit comments

Comments
 (0)