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-93429: MergeLOAD_METHOD back intoLOAD_ATTR#93430

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
markshannon merged 17 commits intopython:mainfromFidget-Spinner:load_attr_load_method
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
7ea8f66
Merge LOAD_METHOD back into LOAD_ATTR
Fidget-SpinnerJun 2, 2022
51e34f1
📜🤖 Added by blurb_it.
blurb-it[bot]Jun 2, 2022
7e8dd23
Remove LOAD_ATTR_METHOD_MODULE
Fidget-SpinnerJun 2, 2022
c95fb97
Merge branch 'load_attr_load_method' of https://github.com/Fidget-Spi…
Fidget-SpinnerJun 2, 2022
e0eb7ee
Make LOAD_METHOD a virtual instruction
Fidget-SpinnerJun 7, 2022
c912f30
Merge remote-tracking branch 'upstream/main' into load_attr_load_method
Fidget-SpinnerJun 7, 2022
da7fc17
Regen files, add unused field
Fidget-SpinnerJun 7, 2022
65e6aba
Merge specialization code more (stats are still broken)
Fidget-SpinnerJun 7, 2022
a6f9099
Merge remote-tracking branch 'upstream/main' into load_attr_load_method
Fidget-SpinnerJun 7, 2022
b8baebd
fix up stats and comments
Fidget-SpinnerJun 7, 2022
56ea61a
Shrink load method cache
Fidget-SpinnerJun 7, 2022
42340ee
fix formatting
Fidget-SpinnerJun 7, 2022
b0e5b6b
fail automatically when seeing a method
Fidget-SpinnerJun 7, 2022
20b3352
add back METHOD to the switch-case to avoid warnings
Fidget-SpinnerJun 7, 2022
28ddf12
fix a deopt
Fidget-SpinnerJun 8, 2022
6fb980e
PEP 7 nits
Fidget-SpinnerJun 9, 2022
5cc98f2
Apply mark's suggestions
Fidget-SpinnerJun 13, 2022
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
12 changes: 5 additions & 7 deletionsInclude/internal/pycore_code.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,18 +58,18 @@ typedef struct {
_Py_CODEUNIT index;
} _PyAttrCache;

#define INLINE_CACHE_ENTRIES_LOAD_ATTR CACHE_ENTRIES(_PyAttrCache)

#define INLINE_CACHE_ENTRIES_STORE_ATTR CACHE_ENTRIES(_PyAttrCache)

typedef struct {
_Py_CODEUNIT counter;
_Py_CODEUNIT type_version[2];
_Py_CODEUNIT keys_version[2];
_Py_CODEUNIT descr[4];
} _PyLoadMethodCache;

#define INLINE_CACHE_ENTRIES_LOAD_METHOD CACHE_ENTRIES(_PyLoadMethodCache)

// MUST be the max(_PyAttrCache, _PyLoadMethodCache)
#define INLINE_CACHE_ENTRIES_LOAD_ATTR CACHE_ENTRIES(_PyLoadMethodCache)

#define INLINE_CACHE_ENTRIES_STORE_ATTR CACHE_ENTRIES(_PyAttrCache)

typedef struct {
_Py_CODEUNIT counter;
Expand DownExpand Up@@ -233,8 +233,6 @@ extern int _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr,
extern int _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr,
PyObject *name);
extern int _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, _Py_CODEUNIT *instr, PyObject *name);
extern int _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr,
PyObject *name);
extern int _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container, _Py_CODEUNIT *instr);
extern int _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *instr);
extern int _Py_Specialize_Call(PyObject *callable, _Py_CODEUNIT *instr,
Expand Down
80 changes: 38 additions & 42 deletionsInclude/internal/pycore_opcode.h
View file
Open in desktop

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

61 changes: 29 additions & 32 deletionsInclude/opcode.h
View file
Open in desktop

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

5 changes: 5 additions & 0 deletionsLib/dis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,6 +37,7 @@
LOAD_GLOBAL = opmap['LOAD_GLOBAL']
BINARY_OP = opmap['BINARY_OP']
JUMP_BACKWARD = opmap['JUMP_BACKWARD']
LOAD_ATTR = opmap['LOAD_ATTR']

CACHE = opmap["CACHE"]

Expand DownExpand Up@@ -463,6 +464,10 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
argval, argrepr = _get_name_info(arg//2, get_name)
if (arg & 1) and argrepr:
argrepr = "NULL + " + argrepr
elif deop == LOAD_ATTR:
argval, argrepr = _get_name_info(arg//2, get_name)
if (arg & 1) and argrepr:
argrepr = "NULL|self + " + argrepr
else:
argval, argrepr = _get_name_info(arg, get_name)
elif deop in hasjabs:
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@@ -408,6 +408,7 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.12a1 3501 (YIELD_VALUE oparg == stack_depth)
# Python 3.12a1 3502 (LOAD_FAST_CHECK, no NULL-check in LOAD_FAST)
# Python 3.12a1 3503 (Shrink LOAD_METHOD cache)
# Python 3.12a1 3504 (Merge LOAD_METHOD back into LOAD_ATTR)

# Python 3.13 will start with 3550

Expand All@@ -421,7 +422,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 = (3503).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3504).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