- 12 May, 2015 2 commits
-
-
Damien George authored
mp_obj_get_int_truncated will raise a TypeError if the argument is not an integral type. Use mp_obj_int_get_truncated only when you know the argument is a small or big int.
-
Damien George authored
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as the operator argument. Hashing for int, str and bytes still go via fast-path in mp_unary_op since they are the most common objects which need to be hashed. This lead to quite a bit of code cleanup, and should be more efficient if anything. It saves 176 bytes code space on Thumb2, and 360 bytes on x86. The only loss is that the error message "unhashable type" is now the more generic "unsupported type for __hash__".
-
- 04 May, 2015 1 commit
-
-
Damien George authored
Addresses issue #1203.
-
- 16 Apr, 2015 2 commits
-
-
Damien George authored
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- 11 Apr, 2015 1 commit
-
-
Damien George authored
This simplifies the API for objects and reduces code size (by around 400 bytes on Thumb2, and around 2k on x86). Performance impact was measured with Pystone score, but change was barely noticeable.
-
- 04 Apr, 2015 2 commits
-
-
Damien George authored
Without this patch deleting a property, or class with descriptor, will call the setter with a NULL value and lead to a crash.
-
Damien George authored
-
- 30 Mar, 2015 1 commit
-
-
Paul Sokolovsky authored
Conditional on MICROPY_PY_ALL_SPECIAL_METHODS.
-
- 26 Mar, 2015 1 commit
-
-
stijn authored
Disabled by default. Enabled on unix and windows ports.
-
- 21 Mar, 2015 1 commit
-
-
Damien George authored
Despite initial guess, this code factoring does not hamper performance. In fact it seems to improve speed by a little: running pystone(1.2) on pyboard (which gives a very stable result) this patch takes pystones from 1729.51 up to 1742.16. Also, pystones on x64 increase by around the same proportion (but it's much noisier). Taking a look at the generated machine code, stack usage with this patch is unchanged, and call is tail-optimised with all arguments in registers. Code size decreases by about 50 bytes on Thumb2 archs.
-
- 19 Mar, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 17 Mar, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 16 Mar, 2015 4 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
We already have branch for lookup->is_type == true, so here it's guaranteed to be false.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
- 21 Feb, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 15 Feb, 2015 1 commit
-
-
Damien George authored
-
- 14 Feb, 2015 1 commit
-
-
stijn authored
-
- 09 Feb, 2015 2 commits
-
-
Damien George authored
-
Damien George authored
Addresses issue #1109.
-
- 08 Feb, 2015 1 commit
-
-
Damien George authored
-
- 30 Jan, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 27 Jan, 2015 1 commit
-
-
Damien George authored
Eg, "() + 1" now tells you that __add__ is not supported for tuple and int types (before it just said the generic "binary operator"). We reuse the table of names for slot lookup because it would be a waste of code space to store the pretty name for each operator.
-
- 20 Jan, 2015 2 commits
-
-
Damien George authored
Reduces stmhal code size by about 250 bytes.
-
Damien George authored
See issue #699.
-
- 11 Jan, 2015 1 commit
-
-
Damien George authored
Previous patch c38dc3cc allowed any object to be compared with any other, using pointer comparison for a fallback. As such, existing code which checked for this case is no longer needed.
-
- 08 Jan, 2015 1 commit
-
-
Damien George authored
-
- 07 Jan, 2015 1 commit
-
-
Damien George authored
This is a simple optimisation inspired by JITing technology: we cache in the bytecode (using 1 byte) the offset of the last successful lookup in a map. This allows us next time round to check in that location in the hash table (mp_map_t) for the desired entry, and if it's there use that entry straight away. Otherwise fallback to a normal map lookup. Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes. On a few tests it gives >90% cache hit and greatly improves speed of code. Disabled by default. Enabled for unix and stmhal ports.
-
- 01 Jan, 2015 1 commit
-
-
Damien George authored
Addresses issue #1022.
-
- 28 Dec, 2014 1 commit
-
-
Paul Sokolovsky authored
-
- 06 Nov, 2014 1 commit
-
-
Damien George authored
Going from MICROPY_ERROR_REPORTING_NORMAL to MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2, and 2200 bytes ROM for 32-bit x86. This is about a 2.5% code size reduction for bare-arm.
-
- 05 Nov, 2014 1 commit
-
-
Damien George authored
-
- 03 Nov, 2014 2 commits
-
-
Damien George authored
Uninitialised struct members get a default value of 0/false, so this is not strictly needed. But it actually decreases code size because when all members are initialised the compiler doesn't need to insert a call to memset to clear everything. In other words, setting 1 extra member to 0 uses less code than calling memset. ROM savings in bytes: 32-bit unix: 100; bare-arm: 44; stmhal: 52.
-
Damien George authored
Addresses issue #953.
-
- 23 Oct, 2014 1 commit
-
-
Damien George authored
-
- 30 Aug, 2014 1 commit
-
-
Damien George authored
Part of code cleanup, to resolve issue #50.
-
- 29 Aug, 2014 1 commit
-
-
Damien George authored
Addressing issue #50, still some way to go yet.
-
- 26 Aug, 2014 1 commit
-
-
Damien George authored
Addresses issue #827.
-