- 07 Jan, 2016 1 commit
-
-
Damien George authored
Before this patch, (x+y)*z would be parsed to a tree that contained a redundant identity parse node corresponding to the parenthesis. With this patch such nodes are optimised away, which reduces memory requirements for expressions with parenthesis, and simplifies the compiler because it doesn't need to handle this identity case. A parenthesis parse node is still needed for tuples.
-
- 04 Jan, 2016 2 commits
-
-
Damien George authored
-
Damien George authored
Handles, eg, "{:>20}".format("foo"), where there is no explicit spec for the type of the argument.
-
- 03 Jan, 2016 5 commits
-
-
stijn authored
Note that even though wrapped in MICROPY_CPYTHON_COMPAT, it is not fully compatible because the modifications to the dictionary do not propagate to the actual instance members.
-
Dave Hylands authored
-
Damien George authored
Only types whose iterator instances still fit in 4 machine words have been changed to use the polymorphic iterator. Reduces Thumb2 arch code size by 264 bytes.
-
Paul Sokolovsky authored
-
Damien George authored
-
- 02 Jan, 2016 1 commit
-
-
Damien George authored
The traceback array stores qstrs and line numbers. qstrs are typed as size_t, and line numbers should safely fit in size_t as well.
-
- 01 Jan, 2016 4 commits
-
-
Paul Sokolovsky authored
To comply with already established scheme for extmod's.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
That's just function which sets/gets dup terminal object, and can be easily reused across ports.
-
Paul Sokolovsky authored
To allow simple zero-terminated lexers.
-
- 31 Dec, 2015 1 commit
-
-
Damien George authored
It's possible to have a fixed map that is properly hashed (ie not simply ordered).
-
- 28 Dec, 2015 1 commit
-
-
Dave Hylands authored
Otherwise build fails if uctypes is disabled.
-
- 27 Dec, 2015 1 commit
-
-
Paul Sokolovsky authored
Previously, mark operation weren't logged at all, while it's quite useful to see cascade of marks in case of over-marking (and in other cases too). Previously, sweep was logged for each block of object in memory, but that doesn't make much sense and just lead to longer output, harder to parse by a human. Instead, log sweep only once per object. This is similar to other memory manager operations, e.g. an object is allocated, then freed. Or object is allocated, then marked, otherwise swept (one log entry per operation, with the same memory address in each case).
-
- 26 Dec, 2015 2 commits
-
-
Damien George authored
Map indicies are most commonly a qstr, and adding a fast-path for hashing of a qstr increases overall performance of the runtime. On pyboard there is a 4% improvement in the pystone benchmark for a cost of 20 bytes of code size. It's about a 2% improvement on unix.
-
Damien George authored
When looking up and extracting an attribute of an instance, some attributes must bind self as the first argument to make a working method call. Previously to this patch, any attribute that was callable had self bound as the first argument. But Python specs require the check to be more restrictive, and only functions, closures and generators should have self bound as the first argument Addresses issue #1675.
-
- 25 Dec, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 24 Dec, 2015 1 commit
-
-
Damien George authored
Addresses issue #1636.
-
- 22 Dec, 2015 1 commit
-
-
Paul Sokolovsky authored
POSIX doesn't guarantee something like that to work, but it works on any system with careful signal implementation. Roughly, the requirement is that signal handler is executed in the context of the process, its main thread, etc. This is true for Linux. Also tested to work without issues on MacOSX.
-
- 20 Dec, 2015 2 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
I.e. the expected result for above is b"foo", whereas previously we got b"b'foo'".
-
- 19 Dec, 2015 1 commit
-
-
stijn authored
This makes all tests pass again for 64bit windows builds which would previously fail for anything printing ranges (builtin_range/unpack1) because they were printed as range( ld, ld ). This is done by reusing the mp_vprintf implementation for MICROPY_OBJ_REPR_D for 64bit windows builds (both msvc and mingw-w64) since the format specifier used for 64bit integers is also %lld, or %llu for the unsigned version. Note these specifiers used to be fetched from inttypes.h, which is the C99 way of working with printf/scanf in a portable way, but mingw-w64 wants to be backwards compatible with older MS C runtimes and uses the non-portable %I64i instead of %lld in inttypes.h, so remove the use of said header again in mpconfig.h and define the specifiers manually.
-
- 18 Dec, 2015 6 commits
-
-
Damien George authored
-
Damien George authored
Ideally we'd use %zu for size_t args, but that's unlikely to be supported by all runtimes, and we would then need to implement it in mp_printf. So simplest and most portable option is to use %u and cast the argument to uint(=unsigned int). Note: reason for the change is that UINT_FMT can be %llu (size suitable for mp_uint_t) which is wider than size_t and prints incorrect results.
-
Damien George authored
MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler, which is useful when only loading of pre-compiled bytecode is supported. It is enabled by default. MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin functions. By default they are only included if MICROPY_ENABLE_COMPILER is enabled. Disabling both options saves about 40k of code size on 32-bit x86.
-
Damien George authored
-
Damien George authored
Saves 88 bytes on Thumb2, and 200 bytes on x86-64 archs.
-
Paul Sokolovsky authored
To let unix port implement "machine" functionality on Python level, and keep consistent naming in other ports (baremetal ports will use magic module "symlinking" to still load it on "import machine"). Fixes #1701.
-
- 17 Dec, 2015 10 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
For builds where mp_uint_t is larger than size_t, it doesn't make sense to use such a wide type for qstrs. There can only be as many qstrs as there is address space on the machine, so size_t is the correct type to use. Saves about 3000 bytes of code size when building unix/ port with MICROPY_OBJ_REPR_D.
-
Damien George authored
-
Damien George authored
-
Damien George authored
-
Damien George authored
Only enabled for MICROPY_OBJ_REPR_D.
-
Damien George authored
size_t is the correct type to use to count things related to the size of the address space. Using size_t (instead of mp_uint_t) is important for the efficiency of ports that configure mp_uint_t to larger than the machine word size.
-