summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509)Victor Stinner2020-04-141-3/+3
| | | | | | | Rename _PyInterpreterState_GET_UNSAFE() to _PyInterpreterState_GET() for consistency with _PyThreadState_GET() and to have a shorter name (help to fit into 80 columns). Add also "assert(tstate != NULL);" to the function.
* bpo-40268: Include explicitly pycore_interp.h (GH-19505)Victor Stinner2020-04-141-1/+2
| | | | pycore_pystate.h no longer includes pycore_interp.h: it's now included explicitly in files accessing PyInterpreterState.
* bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)Victor Stinner2020-04-071-1/+1
| | | | | | | | | | | | The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar().
* bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)Victor Stinner2020-02-071-1/+1
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-38631: Avoid Py_FatalError() in PyCode_New() (GH-18215)Victor Stinner2020-01-271-26/+46
| | | | | | | intern_strings() now raises a SystemError, rather than calling Py_FatalError(). intern_string_constants() now reports exceptions to the caller, rather than ignoring silently exceptions.
* Document CodeType.replace (GH-17776)Anthony Sottile2020-01-011-2/+2
|
* bpo-38922: Raise code.__new__ audit event when code object replace() is ↵Steve Dower2019-11-271-0/+7
| | | | called (GH-17394)
* bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set ↵Pablo Galindo2019-07-011-15/+31
| | | | | | PyCode_New as a compatibility wrapper (GH-13959) Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
* bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13997)Victor Stinner2019-06-121-1/+1
| | | | | | | Fix MSVC warning: objects\codeobject.c(285): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
* bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13809)Victor Stinner2019-06-041-1/+2
| | | | | | Fix this MSVC warning: objects\codeobject.c(264): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-031-0/+65
| | | | | | This patch implements per opcode cache mechanism, and use it in only LOAD_GLOBAL opcode. Based on Yury's opcache3.patch in bpo-26219.
* bpo-36842: Pass positional only parameters to code_new audit hook (GH-13707)Pablo Galindo2019-06-011-3/+3
|
* bpo-37122: Make co->co_argcount represent the total number of positonal ↵Pablo Galindo2019-06-011-6/+5
| | | | arguments in the code object (GH-13726)
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-37032: Add CodeType.replace() method (GH-13542)Victor Stinner2019-05-241-4/+75
|
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+6
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)Victor Stinner2018-11-251-0/+1
| | | | Move _PyTuple_ITEMS() to a new header file: Include/internal/pycore_tupleobject.h
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)Victor Stinner2018-11-091-1/+1
| | | | | | | * _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the first argument to PyTupleObject*. This internal macro is only usable if Py_BUILD_CORE is defined. * Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob). * Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner2018-08-031-2/+3
| | | | sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
* bpo-24618: Add a check in the code constructor. (GH-8283)Serhiy Storchaka2018-07-161-3/+15
| | | Check that the size of the varnames tuple is enough at least for all arguments.
* bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). ↵Serhiy Storchaka2018-04-191-4/+11
| | | | (GH-6513)
* bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)Nick Coghlan2017-12-031-1/+9
| | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined.
* replace custom table with pyctype (#3456)Benjamin Peterson2017-09-081-12/+1
|
* bpo-31393: Fix the use of PyUnicode_READY(). (#3451)Serhiy Storchaka2017-09-081-1/+5
|
* update all_name_chars comment after 9020ac7cce97dddad51b285fffc31fe4ddf60898 ↵Benjamin Peterson2017-09-081-2/+1
| | | | (#3452)
* optimize all_name_chars (#3442)Benjamin Peterson2017-09-081-14/+14
| | | Remove redundant PyUnicode_Check call. Use a static table for checking chars.
* bpo-30789: Use a single memory block for co_extra. (#2555)Serhiy Storchaka2017-07-041-39/+15
| | | | | | * bpo-30789: Use a single memory block for co_extra. * Address review comments.
* bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455)Victor Stinner2017-06-281-1/+2
| | | Free also co_extra->ce_extras, not only co_extra.
* bpo-30604: clean up co_extra support (#2144)Dino Viehland2017-06-211-12/+18
| | | bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
* bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168)Dong-hee Na2017-04-201-2/+6
|
* bpo-29683 - Fixes to _PyCode_SetExtra when co_extra->ce->extras is (#376)Brian Coleman2017-03-021-10/+14
| | | | | | | | allocated. On PyMem_Realloc failure, _PyCode_SetExtra should free co_extra if co_extra->ce_extras could not be allocated. On PyMem_Realloc success, _PyCode_SetExtra should set all unused slots in co_extra->ce_extras to NULL.
* Issue #29337: Fixed possible BytesWarning when compare the code objects.Serhiy Storchaka2017-01-241-3/+3
|\ | | | | | | Warnings could be emitted at compile time.
| * Issue #29337: Fixed possible BytesWarning when compare the code objects.Serhiy Storchaka2017-01-241-3/+3
| |\ | | | | | | | | | Warnings could be emitted at compile time.
| | * Issue #29337: Fixed possible BytesWarning when compare the code objects.Serhiy Storchaka2017-01-241-3/+3
| | | | | | | | | | | | Warnings could be emitted at compile time.
* | | Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-161-7/+13
| | | | | | | | | | | | collections.namedtuple() now supports tuples with more than 255 elements.
* | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-3/+2
|/ / | | | | | | functions.
* | Merge 3.5 (issue #27942)Yury Selivanov2016-11-091-0/+2
|\ \ | |/
| * ssue #27942: Fix memory leak in codeobject.cYury Selivanov2016-11-091-0/+2
| |
* | Issue #28350: String constants with null character no longer interned.Serhiy Storchaka2016-10-041-8/+8
|\ \ | |/
| * Issue #28350: String constants with null character no longer interned.Serhiy Storchaka2016-10-041-8/+8
| |
* | Issue #27942: String constants now interned recursively in tuples and ↵Serhiy Storchaka2016-09-301-7/+45
|\ \ | |/ | | | | frozensets.
| * Issue #27942: String constants now interned recursively in tuples and ↵Serhiy Storchaka2016-09-301-7/+45
| | | | | | | | frozensets.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | Make PyCodeObject.co_extra even more private to force users through the ↵Brett Cannon2016-09-071-23/+31
| | | | | | | | proper API.
* | Change error return value to be more consistent with the rest of PythonBrett Cannon2016-09-071-5/+5
| |
* | use a the bool type for a boolean variableBenjamin Peterson2016-09-071-2/+4
| |
* | Add the co_extra field and accompanying APIs to code objects.Brett Cannon2016-09-071-0/+91
| | | | | | | | This completes PEP 523.