From ea23520403777f9b026f49245d39f8be1ccdbdac Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 11 Feb 2016 22:30:53 +0000 Subject: py: Add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime. This new compile-time option allows to make the bytecode compiler configurable at runtime by setting the fields in the mp_dynamic_compiler structure. By using this feature, the compiler can generate bytecode that targets any MicroPython runtime/VM, regardless of the host and target compile-time settings. Options so far that fall under this dynamic setting are: - maximum number of bits that a small int can hold; - whether caching of lookups is used in the bytecode; - whether to use unicode strings or not (lexer behaviour differs, and therefore generated string constants differ). --- py/mpstate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'py/mpstate.c') diff --git a/py/mpstate.c b/py/mpstate.c index 2ba3402ef..4fc8bc506 100644 --- a/py/mpstate.c +++ b/py/mpstate.c @@ -26,4 +26,8 @@ #include "py/mpstate.h" +#if MICROPY_DYNAMIC_COMPILER +mp_dynamic_compiler_t mp_dynamic_compiler = {0}; +#endif + mp_state_ctx_t mp_state_ctx; -- cgit v1.2.3