aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
Commit message (Collapse)AuthorAge
* Add extra stats for attribute misses (GH-26732)Mark Shannon2021-06-15
|
* 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
* Fix typos in multiple files (GH-26689)Binbin2021-06-12
| | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Add more const modifiers. (GH-26691)Serhiy Storchaka2021-06-12
|
* 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.
* Fix compiler errors for unused variables (GH-26601)Pablo Galindo2021-06-08
|
* 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-41299: Reduce lag in Windows threading timeouts by using a higher ↵Ryan Hileman2021-06-07
| | | | precision time source (GH-26568)
* 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-32280: Store _PyRuntime in a named section (GH-4802)Max Bélanger2021-06-04
| | | | | This commit stores the _PyRuntime structure in a section of the same name. This allows a debugging or crash reporting tool to quickly locate this structure at runtime without requiring the symbol table. Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)Batuhan Taskaya2021-06-03
| | | | | | | When compiling an AST object with a direct / indirect reference cycles, on the conversion phase because of exceeding amount of calls, a segfault was raised. This patch adds recursion guards to places for preventing user inputs to not to crash AST but instead raise a RecursionError.
* 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-44298: Fix line numbers for early exits in with statements. (GH-26513)Mark Shannon2021-06-03
|
* bpo-17792: more accurate error message for unbound variable access ↵Irit Katriel2021-06-02
| | | | exceptions (GH-24976)
* bpo-43693: Add _PyCode_New(). (gh-26375)Eric Snow2021-05-27
| | | | | This is an internal-only API that helps us manage the many values used to create a code object. https://bugs.python.org/issue43693
* 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.
* bpo-43879: Add native_thread_id field to PyThreadState (GH-25458)Gabriele N. Tornetta2021-05-26
|
* bpo-44156: Make cached string constants in compile.c subinterpreter ↵Ken Jin2021-05-25
| | | | compatible (GH-26161)
* bpo-44032: Delay deletion of stack chunks until thread state is deleted. ↵Mark Shannon2021-05-24
| | | | (GH-26285)
* bpo-28307: Tests and fixes for optimization of C-style formatting (GH-26318)Serhiy Storchaka2021-05-23
| | | | | | Fix errors: * "%10.s" should be equal to "%10.0s", not "%10s". * Tuples with starred expressions caused a SyntaxError.
* bpo-44032: Move data stack to thread from FrameObject. (GH-26076)Mark Shannon2021-05-21
| | | | | | | | | | | | | | | | * Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames. * Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells. * Move locals, cells and freevars out of frame object into separate memory buffer. * Use per-threadstate allocated memory chunks for local variables. * Move globals and builtins from frame object to per-thread stack. * Move (slow) locals frame object to per-thread stack. * Move internal frame functions to internal header.
* bpo-44131: Py_FrozenMain() uses PyConfig_SetBytesArgv() (GH-26201)Victor Stinner2021-05-20
| | | | | Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to handle the PYTHONUNBUFFERED environment variable and configure C stdio streams like stdout (make the stream unbuffered).
* Remove unused function in ceval.c (GH-26246)Pablo Galindo2021-05-19
|
* bpo-44131: Test Py_FrozenMain() (GH-26126)Victor Stinner2021-05-17
| | | | | | | | | * Add test_frozenmain to test_embed * Add Programs/test_frozenmain.py * Add Programs/freeze_test_frozenmain.py * Add Programs/test_frozenmain.h * Add make regen-test-frozenmain * Add test_frozenmain command to Programs/_testembed * _testembed.c: add error(msg) function
* bpo-26110: Add ``CALL_METHOD_KW`` opcode to speedup method calls with ↵Ken Jin2021-05-15
| | | | | | | | | keywords (GH-26014) * Add CALL_METHOD_KW * Make CALL_METHOD branchless too since it shares the same code * Place parentheses in STACK_SHRINK
* bpo-28146: Fix a confusing error message in str.format() (GH-24213)Irit Katriel2021-05-13
| | | Automerge-Triggered-By: GH:pitrou
* bpo-44094: Remove deprecated PyErr_ APIs. (GH-26011)Inada Naoki2021-05-13
| | | These APIs are deprecated since Python 3.3. They are not documented too.
* bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085)Dong-hee Na2021-05-13
|
* bpo-44113: Fix compiler warning in PySys_AddWarnOption() (GH-26084)Victor Stinner2021-05-13
| | | Ignore Py_DEPRECATED() warning on purpose.
* Remove PyTryblock struct (GH-26059)Mark Shannon2021-05-12
|
* bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26054)Mark Shannon2021-05-12
|
* Prevent access outside buffer (GH-26012)Dennis Sweeney2021-05-10
|
* bpo-28307: Convert simple C-style formatting with literal format into ↵Serhiy Storchaka2021-05-08
| | | | | | | | | | | f-string. (GH-5012) C-style formatting with literal format containing only format codes %s, %r and %a (with optional width, precision and alignment) will be converted to an equivalent f-string expression. It can speed up formatting more than 2 times by eliminating runtime parsing of the format string and creating temporary tuple.
* bpo-44063: set the missing end locations on the compiler (GH-25956)Batuhan Taskaya2021-05-07
|
* bpo-40222: "Zero cost" exception handling (GH-25729)Mark Shannon2021-05-07
| | | | | | | | "Zero cost" exception handling. * Uses a lookup table to determine how to handle exceptions. * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements. * Reduces the size of the frame object by about 60%.
* bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937)Inada Naoki2021-05-07
| | | | `convertitem()` raises `SystemError` when '#' is used without `PY_SSIZE_T_CLEAN`. This commit makes `skipitem()` raise it too.
* bpo-38530: Refactor and improve AttributeError suggestions (GH-25776)Dennis Sweeney2021-05-03
| | | | | | | | | | | | | | | | | | | | - Make case-swaps half the cost of any other edit - Refactor Levenshtein code to not use memory allocator, and to bail early on no match. - Add comments to Levenshtein distance code - Add test cases for Levenshtein distance behind a debug macro - Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`. - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3: ``` "Multiset Jaccard similarity" >= 2/3 matching letters / total letters >= 2/3 (name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3 1 - (2*distance) / (name_size + item_size) >= 2/3 1/3 >= (2*distance) / (name_size + item_size) (name_size + item_size) / 6 >= distance With rounding: (name_size + item_size + 3) // 6 >= distance ``` Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-43754: Fix compiler warning in Python/compile.c (GH-25855)Pablo Galindo2021-05-03
| | | | | This fixes the following warning: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
* bpo-43916: Move the _PyStructSequence_InitType function to the internal API ↵Pablo Galindo2021-05-03
| | | | (GH-25854)
* bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583)Batuhan Taskaya2021-05-03
|
* bpo-43754: Eliminate bindings for partial pattern matches (GH-25229)Brandt Bucher2021-05-02
|
* bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)Mark Shannon2021-04-30
| | | * Set line number of __exit__ call in a with statement to be that of the with keyword.
* bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096)Jakub Kulík2021-04-30
|