From dd11af209d226b7d18d5148b239662e30ed60bad Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 19 Apr 2017 09:45:59 +1000 Subject: py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls. 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 --- py/persistentcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/persistentcode.c') diff --git a/py/persistentcode.c b/py/persistentcode.c index 2a9a5b7cc..a71045a29 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -39,7 +39,7 @@ #include "py/smallint.h" // The current version of .mpy files -#define MPY_VERSION (1) +#define MPY_VERSION (2) // The feature flags byte encodes the compile-time config options that // affect the generate bytecode. -- cgit v1.2.3