-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. #30928
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericsnowcurrently
merged 117 commits into
python:main
from
ericsnowcurrently:global-strings
Feb 8, 2022
Merged
Changes from 95 commits
Commits
Show all changes
117 commits
Select commit
Hold shift + click to select a range
ec0c931
Add _Py_STRING_LENGTH().
ericsnowcurrently cea1335
Add PyInterpreterState._preallocated.strings (identifiers-only for now).
ericsnowcurrently a5513fc
Move the strings to _PyRuntimeState.
ericsnowcurrently dd084ee
Initialize the global singleton strings (identifiers-only for now).
ericsnowcurrently 472b0a6
Add the global (non-identifier) string literals.
ericsnowcurrently 8a3096b
Add _PyObject_CallMethod().
ericsnowcurrently 38300b3
Get rid of _Py_IDENTIFIER() in tokenizer.c.
ericsnowcurrently fb9fe24
Add _PyDict_GetItemWithError().
ericsnowcurrently 7fa8e83
Set the hash if not set yet.
ericsnowcurrently 9563c27
Add _PySys_GetAttr().
ericsnowcurrently 674e40b
Get rid of _Py_IDENTIFIER() in _warnings.c.
ericsnowcurrently e5e7483
_PyObject_LookupSpecial() -> _PyObject_LookupSpecialId().
ericsnowcurrently 07ac6ba
Add _PyObject_LookupSpecial().
ericsnowcurrently 249e830
Get rid of _Py_IDENTIFIER() in bltinmodule.c.
ericsnowcurrently 3ea3c09
Get rid of _Py_IDENTIFIER() in ceval.c.
ericsnowcurrently 5713dab
Add a TODO.
ericsnowcurrently 77a21d6
Get rid of _Py_IDENTIFIER() in specialize.c.
ericsnowcurrently 704d440
Get rid of _Py_IDENTIFIER() in traceback.c.
ericsnowcurrently 2800db6
Get rid of _Py_IDENTIFIER() in codecs.c.
ericsnowcurrently db72429
Get rid of _Py_IDENTIFIER() in compile.c.
ericsnowcurrently 737391f
Get rid of _Py_IDENTIFIER() in importdl.c.
ericsnowcurrently 9e3ff70
Get rid of _Py_IDENTIFIER() in marshal.c.
ericsnowcurrently 71fc362
Get rid of _Py_IDENTIFIER() in errors.c.
ericsnowcurrently 2046b53
Get rid of _Py_IDENTIFIER() in import.c.
ericsnowcurrently a4c1aa9
Add _PySys_SetAttr().
ericsnowcurrently 48fcb06
Get rid of _Py_IDENTIFIER() in pylifecycle.c.
ericsnowcurrently c9bc124
Get rid of _Py_IDENTIFIER() in pythonrun.c.
ericsnowcurrently 816c630
Get rid of _Py_IDENTIFIER() in sysmodule.c.
ericsnowcurrently ef2b061
Get rid of _Py_IDENTIFIER() in typeobject.c.
ericsnowcurrently 4e03f95
Get rid of _Py_IDENTIFIER() in abstract.c.
ericsnowcurrently 814ec4a
Add _PyEval_GetBuiltin().
ericsnowcurrently a91fe82
Get rid of _Py_IDENTIFIER() in descrobject.c.
ericsnowcurrently 25a2ec4
Get rid of _Py_IDENTIFIER() in moduleobject.c.
ericsnowcurrently 865cc8a
Get rid of _Py_IDENTIFIER() in object.c.
ericsnowcurrently e4c2f0d
Get rid of _Py_IDENTIFIER() in bytearrayobject.c.
ericsnowcurrently f82baa8
Get rid of _Py_IDENTIFIER() in bytesobject.c.
ericsnowcurrently 4b10323
Get rid of _Py_IDENTIFIER() in classobject.c.
ericsnowcurrently ffd9493
Get rid of _Py_IDENTIFIER() in complexobject.c.
ericsnowcurrently ddd887b
Get rid of _Py_IDENTIFIER() in dictobject.c.
ericsnowcurrently 0a02936
Get rid of _Py_IDENTIFIER() in enumobject.c.
ericsnowcurrently d157842
Get rid of _Py_IDENTIFIER() in exceptions.c.
ericsnowcurrently 297240c
Get rid of _Py_IDENTIFIER() in fileobject.c.
ericsnowcurrently 875353d
Get rid of _Py_IDENTIFIER() in frameobject.c.
ericsnowcurrently 9138b2e
Get rid of _Py_IDENTIFIER() in funcobject.c.
ericsnowcurrently 5e576f0
Get rid of _Py_IDENTIFIER() in genericaliasobject.c.
ericsnowcurrently 7591bf1
Get rid of _Py_IDENTIFIER() in genobject.c.
ericsnowcurrently f27547e
Get rid of _Py_IDENTIFIER() in iterobject.c.
ericsnowcurrently dd3900f
Get rid of _Py_IDENTIFIER() in listobject.c.
ericsnowcurrently ecd568d
Get rid of _Py_IDENTIFIER() in longobject.c.
ericsnowcurrently 187133d
Get rid of _Py_IDENTIFIER() in methodobject.c.
ericsnowcurrently e04947e
Get rid of _Py_IDENTIFIER() in odictobject.c.
ericsnowcurrently 91ef303
Get rid of _Py_IDENTIFIER() in rangeobject.c.
ericsnowcurrently 21c564a
Get rid of _Py_IDENTIFIER() in setobject.c.
ericsnowcurrently d833719
Get rid of _Py_IDENTIFIER() in structseq.c.
ericsnowcurrently 329f8fd
Get rid of _Py_IDENTIFIER() in tupleobject.c.
ericsnowcurrently 0cbeb2d
Get rid of _Py_IDENTIFIER() in unicodeobject.c.
ericsnowcurrently 972044a
Get rid of _Py_IDENTIFIER() in unionobject.c.
ericsnowcurrently e55556f
Get rid of _Py_IDENTIFIER() in weakrefobject.c.
ericsnowcurrently 5e32d13
Get rid of _Py_IDENTIFIER() in _pickle.c.
ericsnowcurrently 6081cf1
Add _PyObject_CallMethodObj().
ericsnowcurrently 6aa5674
Use _PyObject_CallMethodObj().
ericsnowcurrently 37c0200
_PyObject_CallMethod() -> _PyObject_CallMethodFormat().
ericsnowcurrently 10f82cd
_PyObject_CallMethodObj() -> _PyObject_CallMethod().
ericsnowcurrently 85f16a4
Get rid of _Py_IDENTIFIER() in the _io module.
ericsnowcurrently aa641a3
Get rid of _Py_IDENTIFIER() in _threadmodule.c.
ericsnowcurrently dda08ad
Get rid of _Py_IDENTIFIER() in _abc.c.
ericsnowcurrently 4d75c6b
Get rid of _Py_IDENTIFIER() in faulthandler.c.
ericsnowcurrently 9d36c02
Get rid of _Py_IDENTIFIER() in _collectionsmodule.c.
ericsnowcurrently 1f42649
Get rid of _Py_IDENTIFIER() in itertoolsmodule.c.
ericsnowcurrently c2f1cfb
Get rid of _Py_IDENTIFIER() in posixmodule.c.
ericsnowcurrently 3ed68a7
Get rid of _Py_IDENTIFIER() in _operator.c.
ericsnowcurrently d86ceb1
Get rid of _Py_IDENTIFIER() in timemodule.c.
ericsnowcurrently c0c6777
Get rid of _Py_IDENTIFIER() in main.c.
ericsnowcurrently c9f4563
Get rid of _Py_static_string() in typeobject.c.
ericsnowcurrently 0796475
Get rid of _Py_static_string() in ast_opt.c.
ericsnowcurrently 3e5fac3
Get rid of _Py_static_string() in compile.c.
ericsnowcurrently 77d423e
Disallow _Py_IDENTIFIER in core.
ericsnowcurrently 308fb9e
Leave all the functions.
ericsnowcurrently 2136577
Auto-generate the global strings.
ericsnowcurrently b14d0a8
Drop _Py_unicode_state.empty_string.
ericsnowcurrently 61abdab
Do not include the latin-1 characters (for now).
ericsnowcurrently db9de0a
Use a better prefix for the field names.
ericsnowcurrently 1074b77
Clean up the declarations a little.
ericsnowcurrently d4f58fd
Add _Py_IS_POINTER_FROM_VAR().
ericsnowcurrently 09c2a51
Consider all global strings as singletons.
ericsnowcurrently 983dda0
_Py_IS_POINTER_FROM_VAR() -> _PyObject_IsSingleton().
ericsnowcurrently 3fbc75f
Add _PyUnicode_InternSafe().
ericsnowcurrently bd8b74c
Intern the global strings when used.
ericsnowcurrently b305ded
Limit when we check the global strings for consistency.
ericsnowcurrently 3da2d65
Drop _PyUnicode_InternSafe().
ericsnowcurrently 3673bbd
Add a --check option to generate_global_objects.py.
ericsnowcurrently 9a419a7
Drop unused global strings.
ericsnowcurrently c6a292d
Check the global objects in CI.
ericsnowcurrently ffbd515
Fix _PyObject_CallMethod() for size_t.
ericsnowcurrently 878059b
Dump the exception if normal printing fails.
ericsnowcurrently 780e61f
Regenerate test_frozenmain.h.
ericsnowcurrently 876aa77
Add some identifiers that are only used in non-debug builds.
ericsnowcurrently f0bd78d
Drop _PyObject_CallMethod_SizeT().
ericsnowcurrently d575057
Merge branch 'main' into global-strings
ericsnowcurrently db92384
Cast to void* before casting to uint64_t.
ericsnowcurrently 955d26a
Explicitly mark each module that still uses _Py_IDENTIFIER().
ericsnowcurrently 3c66484
_testembed still uses _Py_IDENTIFIER().
ericsnowcurrently 05fd034
Fix name collisions from Windows.
ericsnowcurrently 78482cf
_Py_GET_GLOBAL_IDENTIFIER() -> _Py_ID().
ericsnowcurrently 72316f4
_Py_GET_GLOBAL_STRING() -> _Py_STR().
ericsnowcurrently 75b6a83
Use a simpler field prefix than spamspamspam_.
ericsnowcurrently 7b670c1
ASCII_STR() -> STRUCT_FOR_ASCII_STR().
ericsnowcurrently 144ed0f
LITERAL() -> STRUCT_FOR_STR().
ericsnowcurrently f3aa225
ID() -> STRUCT_FOR_ID().
ericsnowcurrently 050b34b
Use _PyObject_IMMORTAL_INIT().
ericsnowcurrently dbec341
Drop _Py_STRING_LENGTH().
ericsnowcurrently 7a075ac
Inline uses of _Py_ID().
ericsnowcurrently 6fdba80
Inline uses of _Py_STR().
ericsnowcurrently 4e00c87
Drop _PyObject_IsSingleton(). (C99 undefined makes it too tricky.)
ericsnowcurrently fbe8f4a
Drop address-taking from _PY_ID() and _Py_STR().
ericsnowcurrently f2d9b81
Add a compatibility shim for _PyObject_LookupSpecialId().
ericsnowcurrently 7781025
Merge branch 'main' into global-strings
ericsnowcurrently File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.