| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
| |
This effectively reverts bb578a0, restoring the original DEOPT_IF() macro in ceval_macros.h, and redefining it in the Tier 2 interpreter. We can get rid of the PREDICTED() macros there as well!
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove old aliases which were kept backwards compatibility with
Python 3.8:
* _PyObject_CallMethodNoArgs()
* _PyObject_CallMethodOneArg()
* _PyObject_CallOneArg()
* _PyObject_FastCallDict()
* _PyObject_Vectorcall()
* _PyObject_VectorcallMethod()
* _PyVectorcall_Function()
Update code which used these aliases to use new names.
|
| |
|
|
|
|
|
|
| |
(GH-106034)
These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt. They should not be
used in new code.
|
| |
|
|
|
|
|
|
|
|
| |
* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks.
|
| | |
|
| |
|
|
|
|
|
| |
It now raises an exception if sys.modules doesn't hold a strong
reference to the module.
Elaborate the comment explaining why a weak reference is used to
create a borrowed reference.
|
| |
|
|
| |
Replace PyImport_AddModuleObject() + Py_XNewRef() with
PyImport_AddModuleRef() to get directly a strong reference.
|
| |
|
|
| |
(`Python/import.c`) (#105980)
|
| |
|
|
|
|
|
| |
* Replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* _sqlite/blob.c now holds a strong reference to the blob object
while calling close_blob().
* _xidregistry_find_type() now holds a strong reference to registered
while using it.
|
| |
|
|
| |
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
| | |
|
| |
|
|
|
| |
finalize_modules_clear_weaklist() now holds a strong reference to the
module longer than before: replace PyWeakref_GET_OBJECT() with
_PyWeakref_GET_REF().
|
| |
|
|
|
|
| |
* Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and
PyImport_AddModuleObject().
* pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with
PyImport_AddModuleRef(name).
|
| |
|
|
|
|
|
|
|
|
|
| |
Refactor PyRun_InteractiveOneObjectEx(), _PyRun_SimpleFileObject()
and PyRun_SimpleStringFlags():
* Keep a strong reference to the __main__ module while using its
dictionary (PyModule_GetDict()). Use PyImport_AddModule() with
Py_XNewRef().
* Declare variables closer to where they are defined.
* Rename variables to use name longer than 1 character.
* Add pyrun_one_parse_ast() sub-function.
|
| |
|
|
| |
bytecodes.c (#105913)
|
| | |
|
| |
|
|
|
|
| |
* Add test for long loops
* Clear ENTER_EXECUTOR when deopting code objects.
|
| |
|
|
| |
replace by their new versions (#105865)
|
| |
|
|
| |
__defaults__ (GH-105847)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time. To solve this we add a thread-local variable for the value. We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
|
| |
|
| |
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
|
| |
|
|
| |
opcode.hasarg/hasname/hasconst (#105482)
|
| |
|
| |
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
|
| |
|
|
| |
(GH-105680)
|
| |
|
| |
In sys_add_xoption(), 'value' may be uninitialized for some error paths.
|
| | |
|
| |
|
|
|
| |
In _PySys_AddXOptionWithError() and sys_add_xoption(),
bail on first error to prevent exceptions from possibly being
overwritten.
|
| |
|
|
| |
Bail on first error to prevent exceptions from possibly being
overwritten.
|
| | |
|
| | |
|
| |
|
|
| |
(#105565)
|
| |
|
|
| |
Deprecate the PyImport_ImportModuleNoBlock() function which is just
an alias to PyImport_ImportModule() since Python 3.3.
|
| |
|
| |
The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
|
| |
|
| |
The risk of a race with this state is relatively low, but we play it safe anyway.
|
| |
|
| |
The risk of a race with this state is relatively low, but we play it safe anyway.
|
| |
|
|
| |
* Remove LOAD_CONST__LOAD_FAST and LOAD_FAST__LOAD_CONST superinstructions.
|
| |
|
|
| |
(gh-105320)
|
| | |
|
| | |
|
| |
|
|
| |
newline (#105442)
|
| |
|
|
| |
errors (#105399)
|
| |
|
|
| |
tokens (#105364)
|