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-105481: generate op IDs from bytecode.c instead of hard coding them in opcode.py#107971

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
iritkatriel merged 18 commits intopython:mainfromiritkatriel:deopt
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
0811c6d
gh-105481: allocate op IDs in cases generator. Generate _PyOpcode_Deo…
iritkatrielAug 14, 2023
a10a14d
_PyOpcode_OpName generated by cases_generator
iritkatrielAug 14, 2023
eecc84c
remove include
iritkatrielAug 14, 2023
96bbc8f
replacement for opcode_targets.h
iritkatrielAug 14, 2023
e68fc03
generate opcode IDs from bytecodes.c
iritkatrielAug 14, 2023
f04d3eb
remove opcode IDs from opcode.py. Update tests and fix specialized op…
iritkatrielAug 15, 2023
e7833dd
fix magic number
iritkatrielAug 15, 2023
99a408b
rename function
iritkatrielAug 15, 2023
7615eff
add news
iritkatrielAug 15, 2023
2f67ea8
update windows makefile
iritkatrielAug 15, 2023
d6ecee1
remove _specialized_instructions, we have the same in _specialized_op…
iritkatrielAug 15, 2023
7337a4b
gh-103082: remove assumption that INSTRUMENTED_LINE is the last instr…
iritkatrielAug 15, 2023
0d6ed4b
assert 255 is not used
iritkatrielAug 15, 2023
1d55078
fix _co_firsttraceable calculation in deepfreeze.py
iritkatrielAug 16, 2023
50415d5
update RESUME hard coded value (argh)
iritkatrielAug 16, 2023
5543e7c
Merge remote-tracking branch 'upstream/main' into deopt
iritkatrielAug 16, 2023
d39233e
hard code RESUME. Make sure opmaps are sorted by ID
iritkatrielAug 16, 2023
f5e4c1d
implemented suggestions from code review
iritkatrielAug 16, 2023
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
540 changes: 0 additions & 540 deletionsInclude/internal/pycore_opcode.h
View file
Open in desktop

Large diffs are not rendered by default.

490 changes: 490 additions & 0 deletionsInclude/internal/pycore_opcode_metadata.h
View file
Open in desktop

Large diffs are not rendered by default.

436 changes: 219 additions & 217 deletionsInclude/opcode_ids.h
View file
Open in desktop

Large diffs are not rendered by default.

226 changes: 225 additions & 1 deletionLib/_opcode_metadata.py
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

10 changes: 5 additions & 5 deletionsLib/dis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,7 @@
_intrinsic_1_descs,
_intrinsic_2_descs,
_specializations,
_specialized_instructions,
_specialized_opmap,
)

__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
Expand DownExpand Up@@ -49,11 +49,11 @@

_all_opname = list(opname)
_all_opmap = dict(opmap)
_empty_slot = [slot for slot, name in enumerate(_all_opname) if name.startswith("<")]
for spec_op, specialized in zip(_empty_slot, _specialized_instructions):
for name, op in _specialized_opmap.items():
# fill opname and opmap
_all_opname[spec_op] = specialized
_all_opmap[specialized] = spec_op
assert op < len(_all_opname)
_all_opname[op] = name
_all_opmap[name] = op

deoptmap = {
specialized: base for base, family in _specializations.items() for specialized in family
Expand Down
3 changes: 2 additions & 1 deletionLib/importlib/_bootstrap_external.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -454,6 +454,7 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.13a1 3556 (Convert LOAD_CLOSURE to a pseudo-op)
# Python 3.13a1 3557 (Make the conversion to boolean in jumps explicit)
# Python 3.13a1 3558 (Reorder the stack items for CALL)
# Python 3.13a1 3559 (Generate opcode IDs from bytecodes.c)

# Python 3.14 will start with 3600

Expand All@@ -470,7 +471,7 @@ def _write_atomic(path, data, mode=0o666):
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.

MAGIC_NUMBER = (3558).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3559).to_bytes(2, 'little') + b'\r\n'

_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp