GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Optimize the JIT's low-level assembly control flow · Issue #135904 · python/cpython Closed Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JITtype-featureA feature request or enhancementA feature request or enhancement DescriptionCurrently, our JIT backend mostly just takes the machine code that Clang gives us, and emits it without modification. The one exception to this is removing zero-length jumps to the next uop at the end of each blob of machine code, which is both fragile and extremely limited in what it can do. For example, consider cmpq $0x1, -0x10(%r13) je _JIT_CONTINUE jmp _JIT_JUMP_TARGET And this is the (11-byte) sequence we want: cmpq $0x1, -0x10(%r13) jne _JIT_JUMP_TARGET We should do a bit more here, and doing more is a lot easier if we're modifying textual assembly at build time. Thankfully, this is pretty straightforward: we just compile to assembly using Clang ( We should intentionally not take on too much complexity here, especially since we support a few different platforms. There's a lot that we can do by only reasoning about labels, jumps, branches, and returns and treating all other sequences of instructions as black boxes. Once we have the assembly parsed into basic blocks, we can do things like:
I have a branch to do all but the last of these, and will open a PR soon. Linked PRs
Reacted by Sergey Miryanov, Diego Russo, Ken Jin and Mikhail Efimov Activity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-JITtype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |