aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
Commit message (Collapse)AuthorAge
* GH-106057: Handle recursion errors in inline class calls properly. (GH-106108)Mark Shannon2023-07-07
|
* gh-104584: Fix error handling from backedge optimization (#106484)Guido van Rossum2023-07-06
| | | | | | | | | | | | When `_PyOptimizer_BackEdge` returns `NULL`, we should restore `next_instr` (and `stack_pointer`). To accomplish this we should jump to `resume_with_error` instead of just `error`. The problem this causes is subtle -- the only repro I have is in PR gh-106393, at commit d7df54b139bcc47f5ea094bfaa9824f79bc45adc. But the fix is real (as shown later in that PR). While we're at it, also improve the debug output: the offsets at which traces are identified are now measured in bytes, and always show the start offset. This makes it easier to correlate executor calls with optimizer calls, and either with `dis` output. <!-- gh-issue-number: gh-104584 --> * Issue: gh-104584 <!-- /gh-issue-number -->
* GH-104584: Fix ENTER_EXECUTOR (GH-106141)Mark Shannon2023-07-03
| | | | | | * Check eval-breaker in ENTER_EXECUTOR. * Make sure that frame->prev_instr is set before entering executor.
* gh-106023: Update code using _PyObject_FastCall() (#106257)Victor Stinner2023-06-30
| | | Replace _PyObject_FastCall() calls with PyObject_Vectorcall().
* GH-106008: Make implicit boolean conversions explicit (GH-106003)Brandt Bucher2023-06-29
|
* gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)hms2023-06-29
| | | | | | This enables super-instruction formation, removal of checks for uninitialized variables, and frees up an instruction.
* gh-104584: Baby steps towards generating and executing traces (#105924)Guido van Rossum2023-06-26
| | | | | Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose). All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
* GH-91095: Specialize calls to normal Python classes. (GH-99331)Mark Shannon2023-06-22
|
* GH-104584: Assorted fixes for the optimizer API. (GH-105683)Mark Shannon2023-06-19
| | | | | | * Add test for long loops * Clear ENTER_EXECUTOR when deopting code objects.
* gh-105481: add HAS_JUMP flag to opcode metadata (#105791)Irit Katriel2023-06-14
|
* GH-77273: Better bytecodes for f-strings (GH-6132)Mark Shannon2023-06-14
|
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-14
| | | | | | | | | | 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-105481: add flags to each instr in the opcode metadata table, to replace ↵Irit Katriel2023-06-13
| | | | opcode.hasarg/hasname/hasconst (#105482)
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-13
| | | | (GH-105680)
* gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)Irit Katriel2023-06-11
|
* GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)Mark Shannon2023-06-08
| | | | * Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
* GH-104610: Remove the use of `PREDICT` macros. (GH-104651)Mark Shannon2023-06-07
|
* GH-105229: Replace some superinstructions with single instruction ↵Mark Shannon2023-06-05
| | | | equivalent. (GH-105230)
* gh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)Jelle Zijlstra2023-06-02
|
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-02
|
* remove unused #includes of pycore_pymem.h (#105166)Irit Katriel2023-06-01
|
* gh-104909: Split BINARY_OP into micro-ops (#104910)Guido van Rossum2023-05-31
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-105035: fix super() calls on unusual types (e.g. meta-types) (#105094)Carl Meyer2023-05-30
|
* GH-104580: Don't cache eval breaker in interpreter (GH-104581)Mark Shannon2023-05-18
| | | Move eval-breaker to the front of the interpreter state.
* GH-103906: Remove immortal refcounting in the interpreter (GH-103909)Brandt Bucher2023-05-16
|
* gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)Carl Meyer2023-05-16
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-15
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-104405: Add missing PEP 523 checks (GH-104406)Brandt Bucher2023-05-12
|
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-12
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* gh-104413: Fix refleak when super attribute throws AttributeError (#104414)Jelle Zijlstra2023-05-12
|
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-11
|
* gh-87849: fix SEND specialization family definition (GH-104268)Carl Meyer2023-05-11
|
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-09
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98003: Inline call frames for CALL_FUNCTION_EX (GH-98004)Ken Jin2023-04-30
|
* gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809)Carl Meyer2023-04-25
|
* gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)Carl Meyer2023-04-24
| | | | | This speeds up `super()` (by around 85%, for a simple one-level `super().meth()` microbenchmark) by avoiding allocation of a new single-use `super()` object on each use.
* GH-103488: Use return-offset, not yield-offset. (GH-103502)Mark Shannon2023-04-13
| | | | * Use return-offset, not yield-offset, so that instruction pointer is correct when sending to a generator or coroutine.
* GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython ↵Mark Shannon2023-04-12
| | | | | | | | | | (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-05
|
* gh-102192: use PyErr_SetHandledException instead of the legacy ↵Irit Katriel2023-04-01
| | | | PyErr_SetExcInfo (#103157)
* Add missing variables to `bytecodes.c` (GH-103153)Brett Cannon2023-03-31
| | | The code works without this change, but it does cause C tooling to complain less about undeclared variables.
* GH-89987: Shrink the BINARY_SUBSCR caches (GH-103022)Brandt Bucher2023-03-29
|
* GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)Brandt Bucher2023-03-23
|
* gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)Irit Katriel2023-03-22
|
* GH-101291: Rearrange the size bits in PyLongObject (GH-102464)Mark Shannon2023-03-22
| | | | | | | | | | * Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
* gh-102598: Remove obsolete optimization from `FORMAT_VALUE` opcode (#102599)Nikita Sobolev2023-03-21
|
* gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives ↵Irit Katriel2023-03-19
| | | | (#102816)
* gh-98831: Use DECREF_INPUTS() more (#102409)Guido van Rossum2023-03-13
|
* GH-100987: Don't cache references to the names and consts array in ↵Mark Shannon2023-03-13
| | | | | | | `_PyEval_EvalFrameDefault`. (#102640) * Rename local variables, names and consts, from the interpeter loop. Will allow non-code objects in frames for better introspection of C builtins and extensions. * Remove unused dummy variables.
* GH-102300: Reuse objects with refcount == 1 in float specialized binary ops. ↵Mark Shannon2023-03-13
| | | | (GH-102301)