diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-17 23:24:13 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-17 23:24:13 +0100 |
commit | 5b65f0c7d386646229b6647332e7a09277872e4c (patch) | |
tree | 06e46eaf0b82fe600109ccaeefa76f3512175922 /py | |
parent | 559d8239cac950cc011edd9605010a311b2b9be6 (diff) | |
download | micropython-5b65f0c7d386646229b6647332e7a09277872e4c.tar.gz micropython-5b65f0c7d386646229b6647332e7a09277872e4c.zip |
py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.
On stmhal, computed gotos make the binary about 1k bigger, but makes it
run faster, and we have the room, so why not. All tests pass on
pyboard using computed gotos.
Diffstat (limited to 'py')
-rw-r--r-- | py/mpconfig.h | 4 | ||||
-rw-r--r-- | py/vm.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 43c931cd66..4c3e0706a7 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -166,8 +166,8 @@ typedef double mp_float_t; // Whether to use computed gotos in the VM, or a switch // Computed gotos are roughly 10% faster, and increase VM code size by a little -#ifndef MICROPY_USE_COMPUTED_GOTOS -#define MICROPY_USE_COMPUTED_GOTOS (0) +#ifndef MICROPY_USE_COMPUTED_GOTO +#define MICROPY_USE_COMPUTED_GOTO (0) #endif // Additional builtin function definitions - see builtintables.c:builtin_object_table for format. @@ -165,7 +165,7 @@ mp_vm_return_kind_t mp_execute_byte_code_2(const byte *code_info, const byte **i mp_obj_t *fastn, mp_obj_t **sp_in_out, mp_exc_stack_t *exc_stack, mp_exc_stack_t **exc_sp_in_out, volatile mp_obj_t inject_exc) { -#if MICROPY_USE_COMPUTED_GOTOS +#if MICROPY_USE_COMPUTED_GOTO #include "vmentrytable.h" #define DISPATCH() do { \ save_ip = ip; \ @@ -220,7 +220,7 @@ outer_dispatch_loop: // loop to execute byte code for (;;) { dispatch_loop: -#if MICROPY_USE_COMPUTED_GOTOS +#if MICROPY_USE_COMPUTED_GOTO DISPATCH(); #else save_ip = ip; @@ -935,7 +935,7 @@ yield: fastn[0] = obj1; return MP_VM_RETURN_EXCEPTION; -#if !MICROPY_USE_COMPUTED_GOTOS +#if !MICROPY_USE_COMPUTED_GOTO } // switch #endif } // for loop |