- Apr 22, 2017
-
-
Damien George authored
This patch allows the following code to run without allocating on the heap: super().foo(...) Before this patch such a call would allocate a super object on the heap and then load the foo method and call it right away. The super object is only needed to perform the lookup of the method and not needed after that. This patch makes an optimisation to allocate the super object on the C stack and discard it right after use. Changes in code size due to this patch are: bare-arm: +128 minimal: +232 unix x64: +416 unix nanbox: +364 stmhal: +184 esp8266: +340 cc3200: +128
-
Damien George authored
This patch refactors the handling of the special super() call within the compiler. It removes the need for a global (to the compiler) state variable which keeps track of whether the subject of an expression is super. The handling of super() is now done entirely within one function, which makes the compiler a bit cleaner and allows to easily add more optimisations to super calls. Changes to the code size are: bare-arm: +12 minimal: +0 unix x64: +48 unix nanbox: -16 stmhal: +4 cc3200: +0 esp8266: -56
-
Damien George authored
If we get to this point in the code then pn_iter is guaranteed to be a struct.
-
Damien George authored
Prior to making this a config option it was previously available on these (and all other) ports, and it makes sense to keep it enabled for mpy-cross as well as ports that have a decent amount of space for the code.
-
Damien George authored
With this optimisation enabled the compiler optimises the if-else expression within a return statement. The optimisation reduces bytecode size by 2 bytes for each use of such a return-if-else statement. Since such a statement is not often used, and costs bytes for the code, the feature is disabled by default. For example the following code: def f(x): return 1 if x else 2 compiles to this bytecode with the optimisation disabled (left column is bytecode offset in bytes): 00 LOAD_FAST 0 01 POP_JUMP_IF_FALSE 8 04 LOAD_CONST_SMALL_INT 1 05 JUMP 9 08 LOAD_CONST_SMALL_INT 2 09 RETURN_VALUE and to this bytecode with the optimisation enabled: 00 LOAD_FAST 0 01 POP_JUMP_IF_FALSE 6 04 LOAD_CONST_SMALL_INT 1 05 RETURN_VALUE 06 LOAD_CONST_SMALL_INT 2 07 RETURN_VALUE So the JUMP to RETURN_VALUE is optimised and replaced by RETURN_VALUE, saving 2 bytes and making the code a bit faster.
-
Damien George authored
Otherwise the type of parse-node and its kind has to be re-extracted multiple times. This optimisation reduces code size by a bit (16 bytes on bare-arm).
-
Damien George authored
PN_atom_expr_normal parse nodes always have structs for their second sub-node, so simplify the check for the sub-node kind to save code size.
-
Damien George authored
Saves code size (20 bytes on bare-arm) and makes it a tiny bit more efficient.
-
- Apr 21, 2017
-
-
Paul Sokolovsky authored
-
stijn authored
Add definitions/source files for features which work on the windows ports but weren't yet enabled. UTIME related lines are moved a couple of lines up to make comparision with unix/mpconfigport.h easier in the future.
-
Damien George authored
With 30-bit floats there aren't enough bits to faithfully print 7 decimal digits, so reduce the precision to 6 digits.
-
- Apr 19, 2017
-
-
Paul Sokolovsky authored
-
- Apr 18, 2017
-
-
Henrik Sölver authored
Sometimes when setting a channel callback the callback fires immediately, even if the compare register is set to a value far into the future. This happens when the free running counter has previously been equal to what happens to be in the compare register. This patch make sure that there is no pending interrupt when setting a callback.
-
Damien George authored
-
Damien George authored
It controls the character that's used to (asynchronously) raise a KeyboardInterrupt exception. Passing "-1" allows to disable the interception of the interrupt character (as long as a port allows such a behaviour).
-
Damien George authored
-
Damien George authored
cc3200 has been updated to conform to the API and now returns None.
-
Damien George authored
This aligns the I2C class to match the standard machine.I2C API. Note that this is a (small) breaking change to the existing cc3200 API. The original API just returned the size of the input buffer so there's no information lost by this change. To update scripts users should just use the size of the buffer passed to these functions to get the number of bytes that are read/written.
-
Damien George authored
-
Damien George authored
-
Damien George authored
The cc3200 port is now similar enough to the standard machine.I2C API so that all conditionals can be removed.
-
Damien George authored
-
Damien George authored
-
Damien George authored
This is a user-facing change to the cc3200's API, to make it conform to the new machine hardware API. The changes are: - change I2C constructor to: I2C(id=0, *, freq=100000, scl=None, sda=None) - change I2C init to: init(*, freq, scl, sda) - removal of machine.I2C.MASTER constant - I2C str/repr no longer prints I2C.MASTER To update existing code it should be enough to just remove the I2C.MASTER constant from contructor/init for I2C.
-
Damien George authored
stmhal doesn't have a machine.UART class so this section is not needed.
-
Damien George authored
-
- Apr 16, 2017
-
-
Paul Sokolovsky authored
If we got a CRASH result, return early, similar to SKIP. This is important because previous refactor changed branching logic a bit, so CRASH now gets post-processed into CRASH\n, which broke remote hardware tests.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Don't give a guarantee of HW RNG, only a possibility of its usage.
-
Paul Sokolovsky authored
-
- Apr 15, 2017
-
-
Damien George authored
A shorter name takes less code size, less room in scripts and is faster to type at the REPL. Tests and HW-API examples are updated to reflect the change.
-
- Apr 14, 2017
-
-
Paul Sokolovsky authored
As Zephyr currently doesn't handle MTU itself (ZEP-1998), limit amount of data we send on our side. Also, if we get unsuccessful result from net_nbuf_append(), calculate how much data it has added still. This works around ZEP-1984.
-
Paul Sokolovsky authored
If run-tests script is run from another dir, we still want to look up feature checks in run-tests' dir.
-
- Apr 13, 2017
-
-
Paul Sokolovsky authored
Give a clearly dissuading tone on end users trying 512KB version - it has to many end-usery features lacking.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Instead of complicating recv() implementation.
-