summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function (#107197)Victor Stinner2023-07-271-14/+0
| | | | Remove the private _PyArg_VaParseTupleAndKeywordsFast() function: it is no longer used.
* GH-106895: Raise a `ValueError` when attempting to disable events that ↵Mark Shannon2023-07-275-50/+63
| | | | cannot be disabled. (GH-107337)
* GH-106897: Add `RERAISE` event to `sys.monitoring`. (GH-107291)Mark Shannon2023-07-274-3/+30
| | | * Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
* gh-106149: fix comment on stackdepth of generators (#107321)Irit Katriel2023-07-261-2/+3
|
* gh-107015: Remove async_hacks from the tokenizer (#107018)Pablo Galindo Salgado2023-07-261-3/+0
|
* gh-106149: Simplify stack depth calculation. Replace asserts by exceptions. ↵Irit Katriel2023-07-262-36/+72
| | | | (#107255)
* gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)Guido van Rossum2023-07-251-0/+7
| | | | Co-authored-by: Victor Stinner <vstinner@python.org>
* Remove unused internal _PyImport_GetModuleId() function (#107235)Victor Stinner2023-07-251-11/+0
|
* gh-106869: Use new PyMemberDef constant names (#106871)Victor Stinner2023-07-258-68/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
* gh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() (#107212)Victor Stinner2023-07-252-3/+3
| | | | Rename the internal PySymtable_Lookup() function to _PySymtable_Lookup() and no longer export it.
* gh-106149: move _PyCfg_BasicblockLastInstr and make it local to flowgraph.c ↵Irit Katriel2023-07-241-23/+34
| | | | (#107180)
* gh-106917: fix super classmethod calls to non-classmethods (#106977)Carl Meyer2023-07-243-3/+3
|
* gh-106320: Remove private _PyDict C API (#107145)Victor Stinner2023-07-244-1/+5
| | | | | | | | | | | | | Move private _PyDict functions to the internal C API (pycore_dict.h): * _PyDict_Contains_KnownHash() * _PyDict_DebugMallocStats() * _PyDict_DelItemIf() * _PyDict_GetItemWithError() * _PyDict_HasOnlyStringKeys() * _PyDict_MaybeUntrack() * _PyDict_MergeEx() No longer export these functions.
* gh-106320: Remove private _PyObject C API (#107147)Victor Stinner2023-07-231-1/+1
| | | | | | | | | | | | | | | | Move private debug _PyObject functions to the internal C API (pycore_object.h): * _PyDebugAllocatorStats() * _PyObject_CheckConsistency() * _PyObject_DebugTypeStats() * _PyObject_IsFreed() No longer export most of these functions, except of _PyObject_IsFreed(). Move test functions using _PyObject_IsFreed() from _testcapi to _testinternalcapi. check_pyobject_is_freed() test no longer catch _testcapi.error: the tested function cannot raise _testcapi.error.
* GH-103082: Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS (#107069)Victor Stinner2023-07-223-24/+24
| | | | | | Rename private C API constants: * Rename PY_MONITORING_UNGROUPED_EVENTS to _PY_MONITORING_UNGROUPED_EVENTS * Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS
* gh-106320: Move _PyMethodWrapper_Type to internal C API (#107064)Victor Stinner2023-07-221-2/+2
|
* gh-106320: Move private _PySet API to the internal API (#107041)Victor Stinner2023-07-227-10/+17
| | | | | | | | * Add pycore_setobject.h header file. * Move the following API to the internal C API: * _PySet_Dummy * _PySet_NextEntry() * _PySet_Update()
* gh-106320: Move private _PyHash API to the internal C API (#107026)Victor Stinner2023-07-222-0/+2
| | | | | * No longer export most private _PyHash symbols, only export the ones which are needed by shared extensions. * Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.
* gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)Kirill Podoprigora2023-07-211-0/+6
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-106701: Move _PyUopExecute to Python/executor.c (GH-106924)Brandt Bucher2023-07-206-244/+249
|
* gh-105481: do not auto-generate pycore_intrinsics.h (#106913)Irit Katriel2023-07-204-25/+56
|
* GH-104584: Miscellaneous fixes for -Xuops (GH-106908)Brandt Bucher2023-07-205-2/+29
|
* gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860)Serhiy Storchaka2023-07-181-6/+1
|
* gh-105481: Generate the opcode lists in dis from data extracted from ↵Irit Katriel2023-07-185-3/+22
| | | | bytecodes.c (#106758)
* bpo-42327: C API: Add PyModule_Add() function (GH-23443)Serhiy Storchaka2023-07-181-19/+10
| | | | | It is a fixed implementation of PyModule_AddObject() which consistently steals reference both on success and on failure.
* gh-106843: fix memleak in _PyCompile_CleanDoc (#106846)Inada Naoki2023-07-181-1/+4
|
* Small fixes to code generator (#106845)Guido van Rossum2023-07-181-5/+3
| | | | These repair nits I found in PR gh-106798 (issue gh-106797) and in PR gh-106716 (issue gh-106706).
* gh-106603: Make uop struct a triple (opcode, oparg, operand) (#106794)Guido van Rossum2023-07-175-68/+145
|
* gh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` (#106707)Guido van Rossum2023-07-175-30/+365
| | | | | | | | | | | | | By turning `assert(kwnames == NULL)` into a macro that is not in the "forbidden" list, many instructions that formerly were skipped because they contained such an assert (but no other mention of `kwnames`) are now supported in Tier 2. This covers 10 instructions in total (all specializations of `CALL` that invoke some C code): - `CALL_NO_KW_TYPE_1` - `CALL_NO_KW_STR_1` - `CALL_NO_KW_TUPLE_1` - `CALL_NO_KW_BUILTIN_O` - `CALL_NO_KW_BUILTIN_FAST` - `CALL_NO_KW_LEN` - `CALL_NO_KW_ISINSTANCE` - `CALL_NO_KW_METHOD_DESCRIPTOR_O` - `CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS` - `CALL_NO_KW_METHOD_DESCRIPTOR_FAST`
* gh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE (#106796)Guido van Rossum2023-07-171-0/+17
| | | | | | | | These aren't automatically translated because (ironically) they are macros deferring to POP_JUMP_IF_{TRUE,FALSE}, which are not viable uops (being manually translated). The hack is that we emit IS_NONE and then set opcode and jump to the POP_JUMP_IF_{TRUE,FALSE} translation code.
* gh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)Dong-hee Na2023-07-171-12/+8
|
* gh-106706: Streamline family syntax in cases generator DSL (#106716)Kevin Diem2023-07-161-26/+13
| | | | From `family(opname, STRUCTSIZE) = OPNAME + SPEC1 + ... + SPECn;` to `family(OPNAME, STRUCTSIZE) = SPEC1 + ... + SPECn;`
* gh-81283: compiler: remove indent from docstring (#106411)Inada Naoki2023-07-151-1/+98
| | | Co-authored-by: Éric <merwok@netwok.org>
* gh-106529: Fix subtle Tier 2 edge case with list iterator (#106756)Guido van Rossum2023-07-152-4/+24
| | | | | | | | | | | | The Tier 2 opcode _IS_ITER_EXHAUSTED_LIST (and _TUPLE) didn't set it->it_seq to NULL, causing a subtle bug that resulted in test_exhausted_iterator in list_tests.py to fail when running all tests with -Xuops. The bug was introduced in gh-106696. Added this as an explicit test. Also fixed the dependencies for ceval.o -- it depends on executor_cases.c.h.
* gh-105481: expose opcode metadata via the _opcode module (#106688)Irit Katriel2023-07-142-3/+33
|
* gh-106529: Split FOR_ITER_{LIST,TUPLE} into uops (#106696)Guido van Rossum2023-07-144-102/+314
| | | | Also rename `_ITER_EXHAUSTED_XXX` to `_IS_ITER_EXHAUSTED_XXX` to make it clear this is a test.
* gh-106701: Move the hand-written Tier 2 uops to bytecodes.c (#106702)Guido van Rossum2023-07-133-40/+66
| | | | | | | This moves EXIT_TRACE, SAVE_IP, JUMP_TO_TOP, and _POP_JUMP_IF_{FALSE,TRUE} from ceval.c to bytecodes.c. They are no less special than before, but this way they are discoverable o the copy-and-patch tooling.
* GH-104909: Split `LOAD_ATTR_INSTANCE_VALUE` into micro-ops (GH-106678)Mark Shannon2023-07-133-24/+72
|
* gh-106529: Split FOR_ITER_RANGE into uops (#106638)Guido van Rossum2023-07-124-25/+118
| | | | For an example of what this does for Tier 1 and Tier 2, see https://github.com/python/cpython/issues/106529#issuecomment-1631649920
* gh-106656: Remove --emit-line-directives from regen-cases (#106657)Guido van Rossum2023-07-122-862/+0
| | | | | | | If you prefer to see `#line` directives in generated_cases.c.h, run ``` make regen-cases CASESFLAG=-l ``` But please don't commit the result.
* GH-104909: Break LOAD_GLOBAL specializations in micro-ops. (GH-106677)Mark Shannon2023-07-123-499/+576
|
* gh-105481: move Python/opcode_metadata.h to ↵Irit Katriel2023-07-126-1325/+8
| | | | Include/internal/pycore_opcode_metadata.h (#106673)
* gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)Serhiy Storchaka2023-07-1211-243/+243
|
* gh-106529: Implement JUMP_FORWARD in uops (with test) (#106651)Guido van Rossum2023-07-111-0/+7
| | | | Note that this may generate two SAVE_IP uops in a row. Removing unneeded SAVE_IP uops is the optimizer's job.
* gh-104584: readability improvements in optimizer.c (#106641)Irit Katriel2023-07-111-18/+19
|
* gh-106307: C API: Add PyMapping_GetOptionalItem() function (GH-106308)Serhiy Storchaka2023-07-114-874/+620
| | | | Also add PyMapping_GetOptionalItemString() function.
* gh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)Guido van Rossum2023-07-113-28/+48
| | | | | During superblock generation, a JUMP_BACKWARD instruction is translated to either a JUMP_TO_TOP micro-op (when the target of the jump is exactly the beginning of the superblock, closing the loop), or a SAVE_IP + EXIT_TRACE pair, when the jump goes elsewhere. The new JUMP_TO_TOP instruction includes a CHECK_EVAL_BREAKER() call, so a closed loop can still be interrupted.
* gh-106360: remove redundant #ifdef (#106622)Irit Katriel2023-07-111-3/+1
|
* GH-106529: Define POP_JUMP_IF_NONE in terms of POP_JUMP_IF_TRUE (GH-106599)Mark Shannon2023-07-114-235/+281
|
* gh-106572: Convert PyObject_DelAttr() to a function (#106611)Victor Stinner2023-07-114-4/+5
| | | | | | | | * Convert PyObject_DelAttr() and PyObject_DelAttrString() macros to functions. * Add PyObject_DelAttr() and PyObject_DelAttrString() functions to the stable ABI. * Replace PyObject_SetAttr(obj, name, NULL) with PyObject_DelAttr(obj, name).