Make all jump opcodes relative #91276
Copy link
Copy link
Closed
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/iritkatriel'
closed_at = None
created_at = <Date 2022-03-25.14:30:53.931>
labels = ['interpreter-core', '3.11', 'performance']
title = 'Make all jump opcodes relative'
updated_at = <Date 2022-04-07.14:59:34.889>
user = 'https://github.com/iritkatriel'bugs.python.org fields:
activity = <Date 2022-04-07.14:59:34.889>
actor = 'iritkatriel'
assignee = 'iritkatriel'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2022-03-25.14:30:53.931>
creator = 'iritkatriel'
dependencies = []
files = []
hgrepos = []
issue_num = 47120
keywords = ['patch']
message_count = 4.0
messages = ['416003', '416431', '416466', '416772']
nosy_count = 4.0
nosy_names = ['Mark.Shannon', 'corona10', 'brandtbucher', 'iritkatriel']
pr_nums = ['32115', '32215', '32221', '32353', '32359', '32400']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue47120'
versions = ['Python 3.11']Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage
Activity
iritkatriel commentedon Mar 25, 2022
For some of our jump opcodes target is absolute, so it can easily require EXTENDED_ARGS. Our analysis [1] shows that turning all absolute jumps into relative jumps will eliminate almost all EXTENDED_ARGS on jumps.
This will require a _BACK version for each jump type, which negates the oparg.
[1] faster-cpython/ideas#235 (reply in thread)
[-]Make all jumps relative[/-][+]Make all jump opcodes relative[/+][-]Make all jumps relative[/-][+]Make all jump opcodes relative[/+]markshannon commentedon Mar 31, 2022
New changeset a00518d by Irit Katriel in branch 'main':
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD (GH-32115)
a00518d
brandtbucher commentedon Mar 31, 2022
Another benefit of this work is that we'll be able to remove
first_instrfrom the eval loop.iritkatriel commentedon Apr 5, 2022
New changeset 0aa8d5c by Irit Katriel in branch 'main':
bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)
0aa8d5c
gh-91276: make space for longer opcodes in dis output (GH-91444)
gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-…
iritkatriel commentedon Apr 15, 2022
This is complete.
pythongh-91276: revert the increase of dis output width
Merge branch 'main' into pythongh-91276
gh-91276: revert the increase of dis output width (GH-92126)
pythongh-91276: remove unused _PyOpcode_RelativeJump
gh-91276: remove unused _PyOpcode_RelativeJump (#103156)
pythongh-91276: remove unused _PyOpcode_RelativeJump (python#103156)
pythongh-91276: remove unused _PyOpcode_RelativeJump (python#103156)