aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/ceval.c
Commit message (Collapse)AuthorAge
* bpo-40116: Add insertion order bit-vector to dict values to allow dicts to ↵Mark Shannon2021-10-06
| | | | share keys more freely. (GH-28520)
* Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)Mark Shannon2021-10-06
|
* bpo-43760: Check for tracing using 'bitwise or' instead of branch in ↵Mark Shannon2021-10-05
| | | | dispatch. (GH-28723)
* Fix compiler warning in ceval.c regarding signed comparison (GH-28716)Pablo Galindo Salgado2021-10-04
|
* bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the ↵Serhiy Storchaka2021-10-03
| | | | code unit (GH-28711)
* Fix a couple of compiler warnings. (GH-28677)Mark Shannon2021-10-01
|
* bpo-45107: Make LOAD_METHOD_CLASS safer and faster, clean up comments (GH-28177)Ken Jin2021-09-17
| | | | | * Improve comments * Check cls is a type, remove dict calculation
* bpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043)Dong-hee Na2021-08-30
|
* bpo-44945: Specialize BINARY_ADD (GH-27967)Mark Shannon2021-08-27
|
* bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933)Mark Shannon2021-08-25
| | | Places the locals between the specials and stack. This is the more "natural" layout for a C struct, makes the code simpler and gives a slight speedup (~1%)
* bpo-44889: Specialize LOAD_METHOD with PEP 659 adaptive interpreter (GH-27722)Ken Jin2021-08-17
| | | | | | | | Adds four new instructions: * LOAD_METHOD_ADAPTIVE * LOAD_METHOD_CACHED * LOAD_METHOD_MODULE * LOAD_METHOD_CLASS
* bpo-44900: Add five superinstructions. (GH-27741)Mark Shannon2021-08-16
| | | | | | | | * LOAD_FAST LOAD_FAST * STORE_FAST LOAD_FAST * LOAD_FAST LOAD_CONST * LOAD_CONST LOAD_FAST * STORE_FAST STORE_FAST
* bpo-44890: collect specialization stats if Py_DEBUG (GH-27731)Irit Katriel2021-08-12
|
* bpo-44878: Remove loop from interpreter. All dispatching is done by gotos. ↵Mark Shannon2021-08-12
| | | | (GH-27727)
* bpo-44878: Remove the switch from the main interpreter loop when using ↵Mark Shannon2021-08-11
| | | | | | | | computed gotos. (GH-27726) * Refactor dispatch logic to make flow of control clearer. Moves lltrace and dxprofile instrumentation into DISPATCH macro. * Remove switch in interpreter loop when using computed gotos. There is no need for two nearly-duplicate dispatch tables.
* bpo-44878: _PyEval_EvalFrameDefault readability improvements (GH-27725)Mark Shannon2021-08-11
| | | | | * Move a few variable declarations to point of definition. * Factor out tracing of function entry into helper function.
* Add missing DISPATCH() (GH-27715)Mark Shannon2021-08-11
|
* Fix stats for STORE_ATTR specialization. (GH-27708)Mark Shannon2021-08-10
|
* bpo-44826: Specialize STORE_ATTR (GH-27590)Mark Shannon2021-08-09
| | | | | | | * Generalize cache names for LOAD_ATTR to allow store and delete specializations. * Factor out specialization of attribute dictionary access. * Specialize STORE_ATTR.
* Add option to write specialization stats to files and script to summarize. ↵Mark Shannon2021-08-04
| | | | | | | (GH-27575) * Add option to write stats to random file in a directory. * Add script to summarize stats.
* Minor fixes to specialization stats. (GH-27457)Mark Shannon2021-07-29
| | | | | * Use class, not value for fail stats for BINARY_SUBSCR. * Fix counts for unquickened instructions.
* bpo-44590: Lazily allocate frame objects (GH-27077)Mark Shannon2021-07-26
| | | | | | | | | | | | | | * Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it. * Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector. * Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation. * Move ownership of InterpreterFrame in generator from frame object to generator object. * Do not create frame objects for Python calls. * Do not create frame objects for generators.
* bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216)Mark Shannon2021-07-19
|
* Revert "bpo-44645: Check for interrupts on any potentially backwards edge. ↵Pablo Galindo Salgado2021-07-16
| | | | | (GH-27167)" (#27194) This reverts commit 000e70ad5246732fcbd27cf59268185cbd5ad734.
* bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)Mark Shannon2021-07-16
|
* Remove sys._deactivate_opcache() now that is not needed (GH-27154)Pablo Galindo Salgado2021-07-15
|
* bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043)Irit Katriel2021-07-15
|
* bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)Mark Shannon2021-07-08
|
* bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064)Mark Shannon2021-07-08
|
* bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)Gabriele N. Tornetta2021-07-07
|
* bpo-12022: Change error type for bad objects in "with" and "async with" ↵Serhiy Storchaka2021-06-29
| | | | | | | | | (GH-26809) A TypeError is now raised instead of an AttributeError in "with" and "async with" statements for objects which do not support the context manager or asynchronous context manager protocols correspondingly.
* bpo-44486: Make sure that modules always have a dictionary. (GH-26847)Mark Shannon2021-06-23
| | | * Make sure that modules always have a dictionary.
* bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)Pablo Galindo2021-06-21
|
* bpo-44337: Improve LOAD_ATTR specialization (GH-26759)Mark Shannon2021-06-21
| | | | | | | | * Specialize obj.__class__ with LOAD_ATTR_SLOT * Specialize instance attribute lookup with attribute on class, provided attribute on class is not an overriding descriptor. * Add stat for how many times the unquickened instruction has executed.
* bpo-44032: Move pointer to code object from frame-object to frame specials ↵Mark Shannon2021-06-18
| | | | array. (GH-26771)
* bpo-43693: Eliminate unused "fast locals". (gh-26587)Eric Snow2021-06-15
| | | | | Currently, if an arg value escapes (into the closure for an inner function) we end up allocating two indices in the fast locals even though only one gets used. Additionally, using the lower index would be better in some cases, such as with no-arg `super()`. To address this, we update the compiler to fix the offsets so each variable only gets one "fast local". As a consequence, now some cell offsets are interspersed with the locals (only when an arg escapes to an inner function). https://bugs.python.org/issue43693
* Remove accidentally duplicated STAT_INC (GH-26718)Mark Shannon2021-06-14
|
* bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638)Mark Shannon2021-06-14
| | | | | | | | | | * Add specializations of LOAD_GLOBAL. * Add more stats. * Remove old opcache; it is no longer used. * Add NEWS
* bpo-44348: Move trace-info to thread-state (GH-26623)Mark Shannon2021-06-10
| | | | | * Move trace-info to thread state. * Correct output for pdb when turning on tracing in middle of line
* bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595)Mark Shannon2021-06-10
| | | | | | | | | | | | | | * Specialize LOAD_ATTR with LOAD_ATTR_SLOT and LOAD_ATTR_SPLIT_KEYS * Move dict-common.h to internal/pycore_dict.h * Add LOAD_ATTR_WITH_HINT specialized opcode. * Quicken in function if loopy * Specialize LOAD_ATTR for module attributes. * Add specialization stats
* bpo-43693: Un-revert commit f3fa63e. (#26609)Eric Snow2021-06-08
| | | | | | | | | This was reverted in GH-26596 (commit 6d518bb) due to some bad memory accesses. * Add the MAKE_CELL opcode. (gh-26396) The memory accesses have been fixed. https://bugs.python.org/issue43693
* Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast locals ↵Pablo Galindo2021-06-08
| | | | | offsets. (gh-26396)" (GH-26597) This reverts commit 631f9938b1604d4f893417ec339b9e0fa9196fb1.
* bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. ↵Eric Snow2021-06-07
| | | | | | | (gh-26396) This moves logic out of the frame initialization code and into the compiler and eval loop. Doing so simplifies the runtime code and allows us to optimize it better. https://bugs.python.org/issue43693
* bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)Eric Snow2021-06-07
| | | | | | | | | | These were reverted in gh-26530 (commit 17c4edc) due to refleaks. * 2c1e258 - Compute deref offsets in compiler (gh-25152) * b2bf2bc - Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388) This change fixes the refleaks. https://bugs.python.org/issue43693
* bpo-44187: Quickening infrastructure (GH-26264)Mark Shannon2021-06-07
| | | | | | | | | | | | | | * Add co_firstinstr field to code object. * Implement barebones quickening. * Use non-quickened bytecode when tracing. * Add NEWS item * Add new file to Windows build. * Don't specialize instructions with EXTENDED_ARG.
* bpo-43693: Revert commits 2c1e2583fdc4db6b43d163239ea42b0e8394171f and ↵Pablo Galindo2021-06-04
| | | | | | | | | | | | | b2bf2bc1ece673d387341e06c8d3c2bc6e259747 (GH-26530) * Revert "bpo-43693: Compute deref offsets in compiler (gh-25152)" This reverts commit b2bf2bc1ece673d387341e06c8d3c2bc6e259747. * Revert "bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)" This reverts commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f. These two commits are breaking the refleak buildbots.
* bpo-43693: Compute deref offsets in compiler (gh-25152)Mark Shannon2021-06-03
| | | | | | Merges locals and cells into a single array. Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more https://bugs.python.org/issue43693
* bpo-43693: Add new internal code objects fields: co_fastlocalnames and ↵Eric Snow2021-06-03
| | | | | | | | | | | | | | | | | co_fastlocalkinds. (gh-26388) A number of places in the code base (notably ceval.c and frameobject.c) rely on mapping variable names to indices in the frame "locals plus" array (AKA fast locals), and thus opargs. Currently the compiler indirectly encodes that information on the code object as the tuples co_varnames, co_cellvars, and co_freevars. At runtime the dependent code must calculate the proper mapping from those, which isn't ideal and impacts performance-sensitive sections. This is something we can easily address in the compiler instead. This change addresses the situation by replacing internal use of co_varnames, etc. with a single combined tuple of names in locals-plus order, along with a minimal array mapping each to its kind (local vs. cell vs. free). These two new PyCodeObject fields, co_fastlocalnames and co_fastllocalkinds, are not exposed to Python code for now, but co_varnames, etc. are still available with the same values as before (though computed lazily). Aside from the (mild) performance impact, there are a number of other benefits: * there's now a clear, direct relationship between locals-plus and variables * code that relies on the locals-plus-to-name mapping is simpler * marshaled code objects are smaller and serialize/de-serialize faster Also note that we can take this approach further by expanding the possible values in co_fastlocalkinds to include specific argument types (e.g. positional-only, kwargs). Doing so would allow further speed-ups in _PyEval_MakeFrameVector(), which is where args get unpacked into the locals-plus array. It would also allow us to shrink marshaled code objects even further. https://bugs.python.org/issue43693
* bpo-17792: more accurate error message for unbound variable access ↵Irit Katriel2021-06-02
| | | | exceptions (GH-24976)
* bpo-43693: Clean up the PyCodeObject fields. (GH-26364)Eric Snow2021-05-26
| | | | | | | | | | * Move up the comment about fields using in hashing/comparision. * Group the fields more clearly. * Add co_ncellvars and co_nfreevars. * Raise ValueError if nlocals != len(varnames), rather than aborting.