Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-135904: Optimize the JIT's assembly control flow#135905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 20 commits intopython:mainfrombrandtbucher:justin-hot
Jun 27, 2025
Merged
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
5606078
Do some textual assembly magic
brandtbucherJun 12, 2025
858624a
Switch to a linked list
brandtbucherJun 12, 2025
77886d0
Handle prefixes
brandtbucherJun 12, 2025
da72079
Rework optimizer and break it out into its own module
brandtbucherJun 19, 2025
9ebb32c
Add AArch64 stub
brandtbucherJun 20, 2025
4f85fab
Shake out some bugs on Windows
brandtbucherJun 20, 2025
d2c9ae9
Disable dead code removal for now
brandtbucherJun 20, 2025
ee97e87
More cleanup, don't add jumps
brandtbucherJun 20, 2025
b436751
Fix Windows label detection (and cleanup)
brandtbucherJun 20, 2025
fbb859d
fixup
brandtbucherJun 20, 2025
4cfabf5
Add comment and jump detection for AArch64
brandtbucherJun 20, 2025
77a8ba1
Fix bug in predecessor detection
brandtbucherJun 23, 2025
a987be7
formatting
brandtbucherJun 23, 2025
5ec6022
Commenting and cleanup
brandtbucherJun 24, 2025
a577c36
More comments
brandtbucherJun 24, 2025
807a359
fixup
brandtbucherJun 24, 2025
3541ef7
fixup
brandtbucherJun 24, 2025
51456c3
blurb add
brandtbucherJun 24, 2025
6ddeaaf
Add comments, noise -> noninstructions, jrxz -> jrcxz, predecessor ->…
brandtbucherJun 25, 2025
b6da4e6
fixup
brandtbucherJun 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Shake out some bugs on Windows
  • Loading branch information
@brandtbucher
brandtbucher committedJun 20, 2025
commit4f85fabfff69fd9086cbbd946f98eacd002826a8
10 changes: 6 additions & 4 deletionsTools/jit/_optimizers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -71,10 +71,10 @@ class Optimizer:
)
_re_jump: typing.ClassVar[re.Pattern[str]] = _RE_NEVER_MATCH # One group: target.
_re_label: typing.ClassVar[re.Pattern[str]] = re.compile(
r"\s*(?P<label>[\w\.]+):"
r'\s*(?P<label>[\w"$.?@]+):'
) # One group: label.
_re_noise: typing.ClassVar[re.Pattern[str]] = re.compile(
r"\s*(?:[#\.]|$)"
r"\s*(?:[#.]|$)"
) # No groups.
_re_return: typing.ClassVar[re.Pattern[str]] = _RE_NEVER_MATCH # No groups.

Expand DownExpand Up@@ -257,6 +257,8 @@ def _remove_dead_code(self) -> None:
todo.append(block.link)
for block in self._blocks():
if block not in reachable:
block.target = None
block.fallthrough = True
block.instructions.clear()

def _remove_redundant_jumps(self) -> None:
Expand DownExpand Up@@ -301,9 +303,9 @@ class OptimizerX86(Optimizer):

_branches = _X86_BRANCHES
_re_branch = re.compile(
rf"\s*(?P<instruction>{'|'.join(_X86_BRANCHES)})\s+(?P<target>[\w\.]+)"
rf"\s*(?P<instruction>{'|'.join(_X86_BRANCHES)})\s+(?P<target>[\w.]+)"
)
_re_jump = re.compile(r"\s*jmp\s+(?P<target>[\w\.]+)")
_re_jump = re.compile(r"\s*jmp\s+(?P<target>[\w.]+)")
_re_return = re.compile(r"\s*ret\b")

@staticmethod
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp