| Age | Commit message (Collapse) | Author |
|
|
|
So accessing the seek offset (at the C level) doesn't cause an
OverflowError on 32-bit targets.
|
|
|
|
Because MICROPY_ALLOC_PATH_MAX is only 128 for this port.
|
|
Because CPython 3.8.0 now produces different output:
- basics/parser.py: CPython does not allow '\\\n' as input.
- import/import_override: CPython imports _io.
|
|
|
|
|
|
|
|
|
|
To prevent a crash returning MP_OBJ_NULL. A test is added for this case.
|
|
Following CPython, OrderedDict are dumped with the syntax of dict.
|
|
This commit adds a sys.implementation.mpy entry when the system supports
importing .mpy files. This entry is a 16-bit integer which encodes two
bytes of information from the header of .mpy files that are supported by
the system being run: the second and third bytes, .mpy version, and flags
and native architecture. This allows determining the supported .mpy file
dynamically by code, and also for the user to find it out by inspecting
this value. It's further possible to dynamically detect if the system
supports importing .mpy files by `hasattr(sys.implementation, 'mpy')`.
|
|
Replace the is_running field with a tri-state variable to indicate
running/not-running/pending-exception.
Update tests to cover the various cases.
This allows cancellation in uasyncio even if the coroutine hasn't been
executed yet. Fixes #5242
|
|
|
|
|
|
POSIX poll should always return POLLERR and POLLHUP in revents, regardless
of whether they were requested in the input events flags.
See issues #4290 and #5172.
|
|
Fixes issue #5280.
|
|
|
|
|
|
|
|
|
|
So they can be automatically skipped if slice is not enabled.
|
|
|
|
Using bytes will test the same path for the buffer protocol in
py/objtype.c.
|
|
So they can be automatically skipped if bytearray is not enabled.
|
|
|
|
Because "version" will always be there, but "exit" may not.
|
|
Only use % formatting when testing % itself, because only str.format is
guaranteed to be available on any port.
|
|
Also rename SEC_COUNT to BLOCK_COUNT and SEC_SIZE to BLOCK_SIZE.
|
|
|
|
|
|
|
|
|
|
Enabled as part of MICROPY_CPYTHON_COMPAT.
|
|
Fixes issues #3178 and #5220.
Tests are added, including all the cases mentioned in both bugs.
|
|
Instead of encoding 4 zero bytes as placeholders for the simple_name and
source_file qstrs, and storing the qstrs after the bytecode, store the
qstrs at the location of these 4 bytes. This saves 4 bytes per bytecode
function stored in a .mpy file (for example lcd160cr.mpy drops by 232
bytes, 4x 58 functions). And resulting code size is slightly reduced on
ports that use this feature.
|
|
|
|
|
|
This is mostly a test of complex number performance.
The FFT implementation is from Project Nayuki and is MIT licensed.
|
|
This test was found by missing coverage of a branch in py/nativeglue.c.
|
|
Commit 3f6ffe059f64b3ebc44dc0bbc63452cb8850702b implemented PEP479 but did
not catch the case fixed in this commit. Found by coverage analysis, that
the VM had uncovered code.
|
|
Prior to this commit, when unwinding through an active finally the stack
was not being correctly popped/folded, which resulting in the VM crashing
for complicated unwinding of nested finallys.
This should be fixed with this commit, and more tests for return/break/
continue within a finally have been added to exercise this.
|
|
This check follows CPython's behaviour, because 'import *' always populates
the globals with the imported names, not locals.
Since it's safe to do this (doesn't lead to a crash or undefined behaviour)
the check is only enabled for MICROPY_CPYTHON_COMPAT.
Fixes issue #5121.
|
|
Tests correct decoding of the prelude to get the function name.
|
|
This patch compresses the second part of the bytecode prelude which
contains the source file name, function name, source-line-number mapping
and cell closure information. This part of the prelude now begins with a
single varible length unsigned integer which encodes 2 numbers, being the
byte-size of the following 2 sections in the header: the "source info
section" and the "closure section". After decoding this variable unsigned
integer it's possible to skip over one or both of these sections very
easily.
This scheme saves about 2 bytes for most functions compared to the original
format: one in the case that there are no closure cells, and one because
padding was eliminated.
|
|
The start of the bytecode prelude contains 6 numbers telling the amount of
stack needed for the Python values and exceptions, and the signature of the
function. Prior to this patch these numbers were all encoded one after the
other (2x variable unsigned integers, then 4x bytes), but using so many
bytes is unnecessary.
An entropy analysis of around 150,000 bytecode functions from the CPython
standard library showed that the optimal Shannon coding would need about
7.1 bits on average to encode these 6 numbers, compared to the existing 48
bits.
This patch attempts to get close to this optimal value by packing the 6
numbers into a single, varible-length unsigned integer via bit-wise
interleaving. The interleaving scheme is chosen to minimise the average
number of bytes needed, and at the same time keep the scheme simple enough
so it can be implemented without too much overhead in code size or speed.
The scheme requires about 10.5 bits on average to store the 6 numbers.
As a result most functions which originally took 6 bytes to encode these 6
numbers now need only 1 byte (in 80% of cases).
|
|
|
|
|
|
The bytecode opcodes have changed (there are more, and they have been
reordered).
|
|
Fixes #5140.
|