176 Commits
Author SHA1 Message Date
Irit KatrielandGitHub 5529213d4e gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626) 2025-05-01 10:28:52 +00:00
Russell Keith-MageeandGitHub 6c522debc2 GH-125515: Remove two unused error branches. (#133181)
Remove two unused error branches in the generated bytecode handling.
2025-05-01 06:21:57 +08:00
+1 60202609a2 gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Wingy <[email protected]>
Co-authored-by: Koudai Aono <[email protected]>
Co-authored-by: Dave Peck <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Paul Everitt <[email protected]>
Co-authored-by: sobolevn <[email protected]>
2025-04-30 11:46:41 +02:00
mpageandGitHub 053c285f6b gh-130704: Strength reduce LOAD_FAST{_LOAD_FAST} (#130708)
Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
2025-04-01 10:18:42 -07:00
Mark ShannonandGitHub 89df62c120 GH-128534: Fix behavior of branch monitoring for async for (GH-130847)
* Both branches in a pair now have a common source and are included in co_branches
2025-03-07 14:30:31 +00:00
Tomasz PytelandGitHub aeb2327386 gh-130574: renumber RESUME opcode from 149 to 128 (GH-130685) 2025-03-06 08:59:36 +00:00
Mark ShannonandGitHub 2a18e80695 GH-128534: Instrument branches for async for loops. (GH-130569) 2025-02-27 09:36:41 +00:00
359c7dde3b gh-129989: Properly disable tailcall interp in configure (GH-129991)
Co-authored-by: Zanie Blue <[email protected]>
2025-02-16 03:01:24 +08:00
Irit KatrielandGitHub a1417b211f gh-100239: replace BINARY_SUBSCR & family by BINARY_OP with oparg NB_SUBSCR (#129700) 2025-02-07 22:39:54 +00:00
Ken JinGitHubGarrett Gublurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Hugo van Kemenade
cb640b659e gh-128563: A new tail-calling interpreter (GH-128718)
Co-authored-by: Garrett Gu <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <[email protected]>
2025-02-06 23:21:57 +08:00
Mark ShannonandGitHub 75b628adeb GH-128563: Generate opcode = ... in instructions that need opcode (GH-129608)
* Remove support for GO_TO_INSTRUCTION
2025-02-03 15:09:21 +00:00
Brandt BucherandGitHub 828b27680f GH-126599: Remove the PyOptimizer API (GH-129194) 2025-01-28 16:10:51 -08:00
Mark ShannonandGitHub 75b4962157 GH-128914: Remove all but one conditional stack effects (GH-129226)
* Remove all 'if (0)' and 'if (1)' conditional stack effects

* Use array instead of conditional for BUILD_SLICE args

* Refactor LOAD_GLOBAL to use a common conditional uop

* Remove conditional stack effects from LOAD_ATTR specializations

* Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array.

* Remove conditional stack effects from CALL_FUNCTION_EX
2025-01-27 16:24:48 +00:00
Sam GrossandGitHub a10f99375e Revert "GH-128914: Remove conditional stack effects from bytecodes.c and the code generators (GH-128918)" (GH-129202)
The commit introduced a ~2.5-3% regression in the free threading build.

This reverts commit ab61d3f430.
2025-01-23 09:26:25 +00:00
Mark ShannonandGitHub ab61d3f430 GH-128914: Remove conditional stack effects from bytecodes.c and the code generators (GH-128918) 2025-01-20 17:09:23 +00:00
Irit KatrielandGitHub 3893a92d95 gh-100239: specialize long tail of binary operations (#128722) 2025-01-16 15:22:13 +00:00
Mark ShannonandGitHub ddd959987c GH-128685: Specialize (rather than quicken) LOAD_CONST into LOAD_CONST_[IM]MORTAL (GH-128708) 2025-01-13 10:30:28 +00:00
Mark ShannonandGitHub f826beca0c GH-128375: Better instrument for FOR_ITER (GH-128445) 2025-01-06 17:54:47 +00:00
Mark ShannonandGitHub d2f1d917e8 GH-122548: Implement branch taken and not taken events for sys.monitoring (GH-122564) 2024-12-19 16:59:51 +00:00
Mark ShannonandGitHub faa3272fb8 GH-125837: Split LOAD_CONST into three. (GH-125972)
* Add LOAD_CONST_IMMORTAL opcode

* Add LOAD_SMALL_INT opcode

* Remove RETURN_CONST opcode
2024-10-29 11:15:42 +00:00
Mark ShannonandGitHub da071fa3e8 GH-119866: Spill the stack around escaping calls. (GH-124392)
* Spill the evaluation around escaping calls in the generated interpreter and JIT. 

* The code generator tracks live, cached values so they can be saved to memory when needed.

* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
2024-10-07 14:56:39 +01:00
Mark ShannonandGitHub 5d3201fe3f GH-123040: Specialize shadowed LOAD_ATTR. (GH-123219) 2024-08-23 10:22:35 +01:00
Mark ShannonandGitHub c13e7d98fb GH-118093: Specialize CALL_KW (GH-123006) 2024-08-16 17:11:24 +01:00
Mark ShannonandGitHub eec7bdaf01 GH-120024: Remove CHECK_EVAL_BREAKER macro. (GH-122968)
* Factor some instructions into micro-ops to isolate CHECK_EVAL_BREAKER for escape analysis

* Eliminate CHECK_EVAL_BREAKER macro
2024-08-14 12:04:05 +01:00
Mark ShannonandGitHub 7a65439b93 GH-122390: Replace _Py_GetbaseOpcode with _Py_GetBaseCodeUnit (GH-122942) 2024-08-13 14:22:57 +01:00
Mark ShannonandGitHub 95a73917cd GH-122029: Break INSTRUMENTED_CALL into micro-ops, so that its behavior is consistent with CALL (GH-122177) 2024-07-26 14:35:57 +01:00
Mark ShannonandGitHub afb0aa6ed2 GH-121131: Clean up and fix some instrumented instructions. (GH-121132)
* Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
2024-07-26 12:24:12 +01:00
Mark ShannonandGitHub 2e14a52cce GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164) 2024-07-25 16:24:29 +01:00
Mark ShannonandGitHub 9cefcc0ee7 GH-120507: Lower the BEFORE_WITH and BEFORE_ASYNC_WITH instructions. (#120640)
* Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions.

* Add LOAD_SPECIAL instruction

* Reimplement `with` and `async with` statements using LOAD_SPECIAL
2024-06-18 12:17:46 +01:00
98e855fcc1 gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <[email protected]>
2024-05-22 00:46:39 +00:00
Mark ShannonandGitHub 1ab6356ebe GH-118095: Use broader specializations of CALL in tier 1, for better tier 2 support of calls. (GH-118322)
* Add CALL_PY_GENERAL, CALL_BOUND_METHOD_GENERAL and call CALL_NON_PY_GENERAL specializations.

* Remove CALL_PY_WITH_DEFAULTS specialization

* Use CALL_NON_PY_GENERAL in more cases when otherwise failing to specialize
2024-05-04 12:11:11 +01:00
Ken JinandGitHub 41457c7fdb gh-116381: Remove bad specializations, add fail stats (GH-116464)
* Remove bad specializations, add fail stats
2024-03-08 00:21:21 +08:00
Ken JinGitHubblurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
7114cf20c0 gh-116381: Specialize CONTAINS_OP (GH-116385)
* 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>
2024-03-07 03:30:11 +08:00
Mark ShannonandGitHub de8a4e52a5 GH-111485: Generate TARGET table for computed goto dispatch. (GH-113319) 2023-12-20 15:09:12 +00:00
Irit KatrielandGitHub d49aba5a7a gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state (#111648) 2023-11-03 10:01:36 +00:00
Irit KatrielandGitHub 52cc4af6ae gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 (#111459) 2023-11-02 10:18:43 +00:00
Brandt BucherandGitHub 22e65eecaa GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300) 2023-09-13 10:25:45 -07:00
Irit KatrielandGitHub 8b55adfa8f gh-109256: allocate opcode IDs for internal opcodes in their own range (#109269) 2023-09-12 10:36:17 +00:00
Mark ShannonandGitHub 0858328ca2 GH-108614: Add RESUME_CHECK instruction (GH-108630) 2023-09-07 14:39:03 +01:00
Irit KatrielandGitHub 665a4391e1 gh-105481: generate op IDs from bytecode.c instead of hard coding them in opcode.py (#107971) 2023-08-16 22:25:18 +00:00
Brandt BucherandGitHub ea72c6fe3b GH-107596: Specialize str[int] (GH-107597) 2023-08-08 13:42:43 -07:00
Mark ShannonandGitHub 0c90e75610 GH-100288: Specialize LOAD_ATTR for simple class attributes. (#105990)
* Add two more specializations of LOAD_ATTR.
2023-07-10 11:40:35 +01:00
Brandt BucherandGitHub 7b2d94d875 GH-106008: Make implicit boolean conversions explicit (GH-106003) 2023-06-29 13:49:54 -07:00
hmsandGitHub 8bff940ad6 gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059)
This enables super-instruction formation,
removal of checks for uninitialized variables,
and frees up an instruction.
2023-06-29 09:34:00 -07:00
Mark ShannonandGitHub 04492cbc9a GH-91095: Specialize calls to normal Python classes. (GH-99331) 2023-06-22 09:48:19 +01:00
Irit KatrielandGitHub 33f0a8578b gh-105481: generate _specializations and _specialized_instructions from bytecodes.c (#105913) 2023-06-19 23:47:04 +01:00
Mark ShannonandGitHub 1d857da7f0 GH-77273: Better bytecodes for f-strings (GH-6132) 2023-06-14 16:15:08 +01:00
Mark ShannonandGitHub 09ffa69e2e GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680) 2023-06-13 09:51:05 +01:00
Mark ShannonandGitHub e830289c52 GH-105229: Remove remaining two-codeunit superinstructions (GH-105326)
* Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
2023-06-08 12:35:34 +01:00
Mark ShannonandGitHub 0689340366 GH-105229: Replace some superinstructions with single instruction equivalent. (GH-105230) 2023-06-05 11:07:04 +01:00