diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-06-26 03:54:45 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-06-26 03:54:45 (GMT) |
commit | 9003760991145584ec1f11d4eed3242dd4467c05 (patch) | |
tree | fa046f973ea9b0bdd388ddb0373e13e3513b93cb /Include | |
parent | 935fa016f48d794253257e6a8e65c091593a7664 (diff) | |
download | cpython-9003760991145584ec1f11d4eed3242dd4467c05.zip cpython-9003760991145584ec1f11d4eed3242dd4467c05.tar.gz cpython-9003760991145584ec1f11d4eed3242dd4467c05.tar.bz2 |
map cells to arg slots at code creation time (closes #12399)
This removes nested loops in PyEval_EvalCodeEx.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/code.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/code.h b/Include/code.h index e773b6a..7c7e5bf 100644 --- a/Include/code.h +++ b/Include/code.h @@ -22,6 +22,7 @@ typedef struct { PyObject *co_freevars; /* tuple of strings (free variable names) */ PyObject *co_cellvars; /* tuple of strings (cell variable names) */ /* The rest doesn't count for hash or comparisons */ + unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */ PyObject *co_filename; /* unicode (where it was loaded from) */ PyObject *co_name; /* unicode (name, for reference) */ int co_firstlineno; /* first source line number */ @@ -57,6 +58,11 @@ typedef struct { #define CO_FUTURE_BARRY_AS_BDFL 0x40000 +/* This value is found in the co_cell2arg array when the associated cell + variable does not correspond to an argument. The maximum number of + arguments is 255 (indexed up to 254), so 255 work as a special flag.*/ +#define CO_CELL_NOT_AN_ARG 255 + /* This should be defined if a future statement modifies the syntax. For example, when a keyword is added. */ |