summaryrefslogtreecommitdiffstats
path: root/Python/opcode_metadata.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-105481: move Python/opcode_metadata.h to ↵Irit Katriel2023-07-121-1317/+0
| | | | Include/internal/pycore_opcode_metadata.h (#106673)
* gh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)Guido van Rossum2023-07-111-26/+28
| | | | | 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-111-5/+7
|
* gh-106529: Implement POP_JUMP_IF_XXX uops (#106551)Guido van Rossum2023-07-101-24/+28
| | | | | | | | | | | | | | | - Hand-written uops JUMP_IF_{TRUE,FALSE}. These peek at the top of the stack. The jump target (in superblock space) is absolute. - Hand-written translation for POP_JUMP_IF_{TRUE,FALSE}, assuming the jump is unlikely. Once we implement jump-likelihood profiling, we can implement the jump-unlikely case (in another PR). - Tests (including some test cleanup). - Improvements to len(ex) and ex[i] to expose the whole trace.
* GH-100288: Specialize LOAD_ATTR for simple class attributes. (#105990)Mark Shannon2023-07-101-3/+13
| | | * Add two more specializations of LOAD_ATTR.
* gh-104584: Allow unspecialized instructions in superblocks (#106497)Guido van Rossum2023-07-071-0/+8
| | | | | | | | | | | | | | | | This adds several of unspecialized opcodes to superblocks: TO_BOOL, BINARY_SUBSCR, STORE_SUBSCR, UNPACK_SEQUENCE, LOAD_GLOBAL, LOAD_ATTR, COMPARE_OP, BINARY_OP. While we may not want that eventually, for now this helps finding bugs. There is a rudimentary test checking for UNPACK_SEQUENCE. Once we're ready to undo this, that would be simple: just replace the call to variable_used_unspecialized with a call to variable_used (as shown in a comment). Or add individual opcdes to FORBIDDEN_NAMES_IN_UOPS.
* gh-104584: Move super-instruction special-casing to generator (#106500)Guido van Rossum2023-07-071-0/+9
| | | | | | Instead of special-casing specific instructions, we add a few more special values to the 'size' field of expansions, so in the future we can automatically handle additional super-instructions in the generator.
* GH-106360: Support very basic superblock introspection (#106422)Mark Shannon2023-07-041-4/+2
| | | * Add len() and indexing support to uop superblocks.
* GH-104584: Fix ENTER_EXECUTOR (GH-106141)Mark Shannon2023-07-031-1/+1
| | | | | | * Check eval-breaker in ENTER_EXECUTOR. * Make sure that frame->prev_instr is set before entering executor.
* gh-106290: Fix edge cases around uops (#106319)Guido van Rossum2023-07-031-2/+4
| | | | | | | | | | - Tweak uops debugging output - Fix the bug from gh-106290 - Rename `SET_IP` to `SAVE_IP` (per https://github.com/faster-cpython/ideas/issues/558) - Add a `SAVE_IP` uop at the start of the trace (ditto) - Allow `unbound_local_error`; this gives us uops for `LOAD_FAST_CHECK`, `LOAD_CLOSURE`, and `DELETE_FAST` - Longer traces - Support `STORE_FAST_LOAD_FAST`, `STORE_FAST_STORE_FAST` - Add deps on pycore_uops.h to Makefile(.pre.in)
* gh-106149: move unconditional jump direction resolution from optimizer to ↵Irit Katriel2023-07-011-2/+2
| | | | assembler (#106291)
* GH-106008: Make implicit boolean conversions explicit (GH-106003)Brandt Bucher2023-06-291-1/+42
|
* gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)hms2023-06-291-0/+1
| | | | | | This enables super-instruction formation, removal of checks for uninitialized variables, and frees up an instruction.
* gh-104584: Emit macro expansions to opcode_metadata.h (#106163)Guido van Rossum2023-06-281-0/+32
| | | | | | | This produces longer traces (superblocks?). Also improved debug output (uop names are now printed instead of numeric opcodes). This would be simpler if the numeric opcode values were generated by generate_cases.py, but that's another project. Refactored some code in generate_cases.py so the essential algorithm for cache effects is only run once. (Deciding which effects are used and what the total cache size is, regardless of what's used.)
* gh-104584: Baby steps towards generating and executing traces (#105924)Guido van Rossum2023-06-271-0/+106
| | | | | 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-221-0/+10
|
* gh-105481: add HAS_JUMP flag to opcode metadata (#105791)Irit Katriel2023-06-141-14/+16
|
* GH-77273: Better bytecodes for f-strings (GH-6132)Mark Shannon2023-06-141-4/+14
|
* gh-105481: add flags to each instr in the opcode metadata table, to replace ↵Irit Katriel2023-06-131-203/+210
| | | | opcode.hasarg/hasname/hasconst (#105482)
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-131-2/+7
| | | | (GH-105680)
* gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)Irit Katriel2023-06-111-2/+76
|
* GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)Mark Shannon2023-06-081-11/+1
| | | | * Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
* GH-105229: Replace some superinstructions with single instruction ↵Mark Shannon2023-06-051-15/+15
| | | | equivalent. (GH-105230)
* gh-105214: Use named constants for MAKE_FUNCTION oparg (#105215)Jelle Zijlstra2023-06-021-1/+1
|
* GH-104584: Plugin optimizer API (GH-105100)Mark Shannon2023-06-021-0/+5
|
* gh-104909: Split BINARY_OP into micro-ops (#104910)Guido van Rossum2023-05-311-22/+22
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)Carl Meyer2023-05-161-0/+5
|
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-161-5/+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-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-121-5/+0
| | | | | | | | (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-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-111-3/+8
|
* gh-87849: fix SEND specialization family definition (GH-104268)Carl Meyer2023-05-111-1/+1
|
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-091-0/+5
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809)Carl Meyer2023-04-251-2/+7
|
* gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)Carl Meyer2023-04-241-0/+5
| | | | | 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-103082: Implementation of PEP 669: Low Impact Monitoring for CPython ↵Mark Shannon2023-04-121-0/+95
| | | | | | | | | | (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-19/+19
|
* gh-87092: move CFG related code from compile.c to flowgraph.c (#103021)Irit Katriel2023-03-311-3/+3
|
* GH-89987: Shrink the BINARY_SUBSCR caches (GH-103022)Brandt Bucher2023-03-291-5/+5
|
* GH-100982: Break up COMPARE_AND_BRANCH (GH-102801)Brandt Bucher2023-03-231-18/+13
|
* gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)Irit Katriel2023-03-221-10/+0
|
* gh-102738: remove from cases generator the code related to register ↵Irit Katriel2023-03-151-174/+170
| | | | instructions (#102739)
* GH-90997: Shrink the LOAD_GLOBAL caches (#102569)Brandt Bucher2023-03-111-4/+4
|
* gh-102021 : Allow multiple input files for interpreter loop generator (#102022)Jacob Bower2023-03-041-2/+3
| | | The input files no longer use `-i`.
* gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)Irit Katriel2023-02-141-5/+5
|
* GH-87849: Simplify stack effect of SEND and specialize it for generators and ↵Mark Shannon2023-02-131-3/+8
| | | | coroutines. (GH-101788)
* gh-98831: Use opcode metadata for stack_effect() (#101704)Guido van Rossum2023-02-091-7/+18
| | | | | | | | | | * Write output and metadata in a single run This halves the time to run the cases generator (most of the time goes into parsing the input). * Declare or define opcode metadata based on NEED_OPCODE_TABLES * Use generated metadata for stack_effect() * compile.o depends on opcode_metadata.h * Return -1 from _PyOpcode_num_popped/pushed for unknown opcode
* gh-98831: Modernize CALL and family (#101508)Guido van Rossum2023-02-081-56/+56
| | | Includes a slight improvement to `DECREF_INPUTS()`.
* gh-98831: Modernize CALL_FUNCTION_EX (#101627)Guido van Rossum2023-02-081-2/+2
| | | New generator feature: Move CHECK_EVAL_BREAKER() call to just before DISPATCH().
* gh-98831: Modernize FORMAT_VALUE (#101628)Guido van Rossum2023-02-081-2/+2
| | | Generator update: support balanced parentheses and brackets in conditions and size expressions.