summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_code.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-116381: Specialize CONTAINS_OP (GH-116385)Ken Jin2024-03-061-0/+7
| | | | | | | | | | | * Specialize CONTAINS_OP * 📜🤖 Added by blurb_it. * Add PyAPI_FUNC for JIT --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-115999: Disable the specializing adaptive interpreter in free-threaded ↵Brett Simmers2024-03-011-0/+5
| | | | | builds (#116013) For now, disable all specialization when the GIL might be disabled.
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)Eric Snow2024-02-131-0/+9
| | | | | For the most part, these changes make is substantially easier to backport subinterpreter-related code to 3.12, especially the related modules (e.g. _xxsubinterpreters). The main motivation is to support releasing a PyPI package with the 3.13 capabilities compiled for 3.12. A lot of the changes here involve either hiding details behind macros/functions or splitting up some files.
* gh-114312: Collect stats for unlikely events (GH-114493)Michael Droettboom2024-01-251-0/+2
|
* gh-106550: Fix sign conversion in pycore_code.h (#112613)Victor Stinner2023-12-041-10/+12
| | | | Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.
* gh-111652: Fix --enable-pystats build (GH-111653)Michael Droettboom2023-11-031-0/+2
|
* gh-109329: Count tier2 opcode misses (#110561)Michael Droettboom2023-10-311-2/+2
| | | This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
* GH-109329: Add tier 2 stats (GH-109913)Michael Droettboom2023-10-041-0/+15
|
* GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300)Brandt Bucher2023-09-131-1/+1
|
* GH-108716: Turn off deep-freezing of code objects. (GH-108722)Mark Shannon2023-09-081-2/+0
|
* gh-107265: Remove all ENTER_EXECUTOR when execute _Py_Instrument (gh-108539)Dong-hee Na2023-09-071-0/+3
|
* gh-108753: Enhance pystats (#108754)Victor Stinner2023-09-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Statistics gathering is now off by default. Use the "-X pystats" command line option or set the new PYTHONSTATS environment variable to 1 to turn statistics gathering on at Python startup. Statistics are no longer dumped at exit if statistics gathering was off or statistics have been cleared. Changes: * Add PYTHONSTATS environment variable. * sys._stats_dump() now returns False if statistics are not dumped because they are all equal to zero. * Add PyConfig._pystats member. * Add tests on sys functions and on setting PyConfig._pystats to 1. * Add Include/cpython/pystats.h and Include/internal/pycore_pystats.h header files. * Rename '_py_stats' variable to '_Py_stats'. * Exclude Include/cpython/pystats.h from the Py_LIMITED_API. * Move pystats.h include from object.h to Python.h. * Add _Py_StatsOn() and _Py_StatsOff() functions. Remove '_py_stats_struct' variable from the API: make it static in specialize.c. * Document API in Include/pystats.h and Include/cpython/pystats.h. * Complete pystats documentation in Doc/using/configure.rst. * Don't write "all zeros" stats: if _stats_off() and _stats_clear() or _stats_dump() were called. * _PyEval_Fini() now always call _Py_PrintSpecializationStats() which does nothing if stats are all zeros. Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* gh-108220: Internal header files require Py_BUILD_CORE to be defined (#108221)Victor Stinner2023-08-211-0/+4
| | | | | | | | | * pycore_intrinsics.h does nothing if included twice (add #ifndef and #define). * Update Tools/cases_generator/generate_cases.py to generate the Py_BUILD_CORE test. * _bz2, _lzma, _opcode and zlib extensions now define the Py_BUILD_CORE_MODULE macro to use internal headers (pycore_code.h, pycore_intrinsics.h and pycore_blocks_output_buffer.h).
* Add some GC stats to Py_STATS (GH-107581)Mark Shannon2023-08-041-0/+2
|
* gh-105481: the ENABLE_SPECIALIZATION flag does not need to be generated by ↵Irit Katriel2023-08-011-0/+2
| | | | the build script, or exposed in opcode.py (#107534)
* gh-107211: No longer export internal functions (4) (#107217)Victor Stinner2023-07-251-2/+1
| | | | | | | | | No longer export these 2 internal C API functions: * _PyEval_SignalAsyncExc() * _PyEval_SignalReceived() Add also comments explaining why some internal functions have to be exported, and update existing comments.
* gh-107211: No longer export internal functions (1) (#107213)Victor Stinner2023-07-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer export these 49 internal C API functions: * _PyArgv_AsWstrList() * _PyCode_New() * _PyCode_Validate() * _PyFloat_DebugMallocStats() * _PyFloat_FormatAdvancedWriter() * _PyImport_CheckSubinterpIncompatibleExtensionAllowed() * _PyImport_ClearExtension() * _PyImport_GetModuleId() * _PyImport_SetModuleString() * _PyInterpreterState_IDDecref() * _PyInterpreterState_IDIncref() * _PyInterpreterState_IDInitref() * _PyInterpreterState_LookUpID() * _PyWideStringList_AsList() * _PyWideStringList_CheckConsistency() * _PyWideStringList_Clear() * _PyWideStringList_Copy() * _PyWideStringList_Extend() * _Py_ClearArgcArgv() * _Py_DecodeUTF8Ex() * _Py_DecodeUTF8_surrogateescape() * _Py_EncodeLocaleRaw() * _Py_EncodeUTF8Ex() * _Py_GetEnv() * _Py_GetForceASCII() * _Py_GetLocaleEncoding() * _Py_GetLocaleEncodingObject() * _Py_GetLocaleconvNumeric() * _Py_ResetForceASCII() * _Py_device_encoding() * _Py_dg_dtoa() * _Py_dg_freedtoa() * _Py_dg_strtod() * _Py_get_blocking() * _Py_get_env_flag() * _Py_get_inheritable() * _Py_get_osfhandle_noraise() * _Py_get_xoption() * _Py_open() * _Py_open_osfhandle() * _Py_open_osfhandle_noraise() * _Py_read() * _Py_set_blocking() * _Py_str_to_int() * _Py_wfopen() * _Py_wgetcwd() * _Py_wreadlink() * _Py_wrealpath() * _Py_write()
* GH-104909: Break LOAD_GLOBAL specializations in micro-ops. (GH-106677)Mark Shannon2023-07-121-1/+1
|
* GH-106008: Make implicit boolean conversions explicit (GH-106003)Brandt Bucher2023-06-291-0/+8
|
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-141-13/+0
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-021-0/+1
|
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-111-5/+2
|
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-091-0/+1
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-103978: avoid using 'class' as an identifier (#103979)Carl Meyer2023-04-281-1/+1
|
* gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809)Carl Meyer2023-04-251-0/+11
|
* GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython ↵Mark Shannon2023-04-121-26/+4
| | | | | | | | | | (GH-103083) * The majority of the monitoring code is in instrumentation.c * The new instrumentation bytecodes are in bytecodes.c * legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
* GH-88691: Shrink the CALL caches (GH-103230)Brandt Bucher2023-04-051-1/+0
|
* GH-89987: Shrink the BINARY_SUBSCR caches (GH-103022)Brandt Bucher2023-03-291-2/+0
|
* GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)Brandt Bucher2023-03-231-1/+1
|
* GH-90997: Shrink the LOAD_GLOBAL caches (#102569)Brandt Bucher2023-03-111-1/+1
|
* GH-87849: Simplify stack effect of SEND and specialize it for generators and ↵Mark Shannon2023-02-131-0/+7
| | | | coroutines. (GH-101788)
* GH-100982: Add `COMPARE_AND_BRANCH` instruction (GH-100983)Mark Shannon2023-01-161-1/+1
|
* GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)Mark Shannon2023-01-111-1/+21
|
* GH-100222: Redefine _Py_CODEUNIT as a union to clarify structure of code ↵Mark Shannon2022-12-141-24/+24
| | | | unit. (GH-100223)
* GH-98522: Add version number to code objects. (GH-98525)Mark Shannon2022-12-091-0/+2
| | | | | | * Add version number to code object for better versioning of functions. * Improves specialization for closures and list comprehensions.
* GH-91054: Add code object watchers API (GH-99859)Itamar Ostricher2022-12-021-0/+2
| | | | | | * Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
* GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)Guido van Rossum2022-11-231-0/+6
| | | | | | | | | | | | | | Newly supported interpreter definition syntax: - `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }` - `macro(NAME) = OP1 + OP2;` Also some other random improvements: - Convert `WITH_EXCEPT_START` to use stack effects - Fix lexer to balk at unrecognized characters, e.g. `@` - Fix moved output names; support object pointers in cache - Introduce `error()` method to print errors - Introduce read_uint16(p) as equivalent to `*p` Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* GH-99298: Clean up attribute specializations (GH-99398)Brandt Bucher2022-11-171-3/+3
|
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-0/+10
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-091-12/+33
|
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-071-1/+1
|
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-26/+6
|
* GH-90997: Improve inline cache performance for MSVC (GH-96781)Brandt Bucher2022-09-151-74/+19
|
* GH-93911: Specialize `LOAD_ATTR` for custom `__getattribute__` (GH-93988)Ken Jin2022-08-171-0/+1
|
* GH-94739: Mark stacks of exception handling blocks for setting ↵Mark Shannon2022-07-181-0/+13
| | | | frame.f_lineno in the debugger. (GH-94958)
* GH-93841: Allow stats to be turned on and off, cleared and dumped at ↵Mark Shannon2022-06-211-8/+8
| | | | runtime. (GH-93843)
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-211-0/+7
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* gh-87347: Add parenthesis around macro arguments (#93915)Victor Stinner2022-06-201-5/+5
| | | Add unit test on Py_MEMBER_SIZE() and some other macros.
* GH-93516: Speedup line number checks when tracing. (GH-93763)Mark Shannon2022-06-201-0/+29
| | | | * Use a lookup table to reduce overhead of getting line numbers during tracing.
* GH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430)Ken Jin2022-06-141-7/+5
|