Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dce5124
Re-organize the _PyCodeObject fields.
ericsnowcurrently May 18, 2021
e416918
Spell out the PyCode_New*() signatures.
ericsnowcurrently May 18, 2021
6740572
Add a TODO to code.h.
ericsnowcurrently May 18, 2021
4381869
Fix a memory leak.
ericsnowcurrently May 18, 2021
19cfb8b
Add _PyCode_New().
ericsnowcurrently May 18, 2021
8f10f5d
Factor out _PyCode_GetFastlocalOffsetId().
ericsnowcurrently May 18, 2021
0c42221
Factor out _PyCode_HasFastlocals().
ericsnowcurrently May 18, 2021
3315b28
Factor out _PyCode_CellForLocal().
ericsnowcurrently May 18, 2021
2ac48ba
Add macros to hide away some of the PyCodeObject fields.
ericsnowcurrently May 19, 2021
02e15a4
Move the fast locals section down.
ericsnowcurrently May 19, 2021
ad70f99
Store more counts on PyCodeObject.
ericsnowcurrently May 19, 2021
e38643f
Update a comment.
ericsnowcurrently May 19, 2021
09fbe71
Factor out macros related to co_code.
ericsnowcurrently May 14, 2021
9b4ca77
Fix some smelly names.
ericsnowcurrently May 20, 2021
f00133f
Fix whitespace.
ericsnowcurrently May 20, 2021
acef742
Fix co_nlocals in code.replace().
ericsnowcurrently May 20, 2021
559e408
Stop using statics in PyCode_NewEmpty().
ericsnowcurrently May 20, 2021
a923b5b
Actually fix whitespace.
ericsnowcurrently May 20, 2021
afcc944
Fix a typo.
ericsnowcurrently May 20, 2021
d304aba
Replace macros with inline functions.
ericsnowcurrently May 20, 2021
23e5485
Unify all the PyCodeObject validation code.
ericsnowcurrently May 20, 2021
81c4a49
Fix the logged function name.
ericsnowcurrently May 20, 2021
af51553
Fix the GDB script.
ericsnowcurrently May 21, 2021
cc3f435
-_PyCode_GetFastlocalOffsetId -> _PyCode_FastOffsetFromId().
ericsnowcurrently May 21, 2021
fcf4ea3
Fix CO_FAST_KWONLY.
ericsnowcurrently May 21, 2021
cb82a6a
Fix a typo.
ericsnowcurrently May 21, 2021
672a75f
Make sure int is used for fast offsets and PyCodeObject counts.
ericsnowcurrently May 22, 2021
32907b1
Fix the comment about fields in hash/comparision.
ericsnowcurrently May 22, 2021
aee3640
Drop co_nlocals from marshaled code objects.
ericsnowcurrently May 22, 2021
fd50f62
Regen a couple more files.
ericsnowcurrently May 22, 2021
9736ff5
Fix test_ctypes.
ericsnowcurrently May 22, 2021
c95314c
Factor out CO_FAST_ARG.
ericsnowcurrently May 24, 2021
b419060
Fix a typo.
ericsnowcurrently May 24, 2021
6195184
Add an assert for the return value of frame_nslots().
ericsnowcurrently May 24, 2021
3c4ec94
Add a comment about using an arguments struct for _PyCode_New().
ericsnowcurrently May 24, 2021
ffc4b54
Drop some outdated TODO comments.
ericsnowcurrently May 24, 2021
292b646
Fix a typo.
ericsnowcurrently May 24, 2021
cd9e34a
Add _PyCode_FastInfoFromOffset().
ericsnowcurrently May 24, 2021
cd4f587
Add _PyCode_GetFastFreevar().
ericsnowcurrently May 24, 2021
a4e6dd3
Use _PyCode_FastInfoFromOffset() elsewhere in ceval.c.
ericsnowcurrently May 24, 2021
f93b6df
Add _PyCode_OffsetFromIndex().
ericsnowcurrently May 24, 2021
f779627
_PyCode_FastInfoFromOffset() -> _PyCode_FastInfoFromOparg().
ericsnowcurrently May 24, 2021
292e457
Add _PyCode_FastInfoFromOffset() and use it in frameobject.c.
ericsnowcurrently May 24, 2021
f6bafb4
Fix warnings.
ericsnowcurrently May 24, 2021
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
Prev Previous commit
Next Next commit
Drop some outdated TODO comments.
  • Loading branch information
ericsnowcurrently committed May 24, 2021
commit ffc4b54b4ee1205efac5b1804342284f0b42ec69
1 change: 0 additions & 1 deletion Include/cpython/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct PyCodeObject {
PyObject *co_freevars; /* tuple of strings (free variable names) */

/* args (within co_varnames) */
// XXX Make these convenience fields, reflecting co_fastlocalkinds.
int co_argcount; /* #arguments, except *args */
int co_posonlyargcount; /* #positional only arguments */
int co_kwonlyargcount; /* #keyword only arguments */
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct _PyOpcache {
};


// XXX Can we do this with an enum instead?
// We would use an enum if C let us specify the storage type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still use an enum to define the values though, even if you store them in a char.

typedef unsigned char _PyFastLocalKind;
// Note that these all fit within _PyFastLocalKind, as do combinations.
#define CO_FAST_POSONLY 0x01
Expand Down
1 change: 0 additions & 1 deletion Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,6 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
/*[clinic end generated code: output=80957472b7f78ed6 input=38376b1193efbbae]*/
{
// All the logged values here have already been validated well enough.
// XXX This is the wrong name.
if (PySys_Audit("code.replace", "OOOiiiiii",
co_code, co_filename, co_name, co_argcount,
co_posonlyargcount, co_kwonlyargcount, co_nlocals,
Expand Down