[python] Upgrade to micropython 1.11

This commit is contained in:
Léa Saviot
2019-08-21 09:59:33 +02:00
parent 127a166762
commit 0975ba0f10
115 changed files with 4605 additions and 2450 deletions

View File

@@ -46,6 +46,7 @@ typedef struct mp_dynamic_compiler_t {
uint8_t small_int_bits; // must be <= host small_int_bits
bool opt_cache_map_lookup_in_bytecode;
bool py_builtins_str_unicode;
uint8_t native_arch;
} mp_dynamic_compiler_t;
extern mp_dynamic_compiler_t mp_dynamic_compiler;
#endif
@@ -77,7 +78,7 @@ typedef struct _mp_state_mem_t {
byte *gc_pool_end;
int gc_stack_overflow;
size_t gc_stack[MICROPY_ALLOC_GC_STACK_SIZE];
MICROPY_GC_STACK_ENTRY_TYPE gc_stack[MICROPY_ALLOC_GC_STACK_SIZE];
uint16_t gc_lock_depth;
// This variable controls auto garbage collection. If set to 0 then the
@@ -105,10 +106,11 @@ typedef struct _mp_state_mem_t {
// This structure hold runtime and VM information. It includes a section
// which contains root pointers that must be scanned by the GC.
typedef struct _mp_state_vm_t {
////////////////////////////////////////////////////////////
// START ROOT POINTER SECTION
// everything that needs GC scanning must go here
// this must start at the start of this structure
//
// CONTINUE ROOT POINTER SECTION
// This must start at the start of this structure and follows
// the state in the mp_state_thread_t structure, continuing
// the root pointer section from there.
//
qstr_pool_t *last_pool;
@@ -139,8 +141,6 @@ typedef struct _mp_state_vm_t {
volatile mp_obj_t mp_pending_exception;
#if MICROPY_ENABLE_SCHEDULER
volatile int16_t sched_state;
uint16_t sched_sp;
mp_sched_item_t sched_stack[MICROPY_SCHEDULER_DEPTH];
#endif
@@ -172,7 +172,6 @@ typedef struct _mp_state_vm_t {
#if MICROPY_PY_OS_DUPTERM
mp_obj_t dupterm_objs[MICROPY_PY_OS_DUPTERM];
mp_obj_t dupterm_arr_obj;
#endif
#if MICROPY_PY_LWIP_SLIP
@@ -208,6 +207,12 @@ typedef struct _mp_state_vm_t {
mp_int_t mp_emergency_exception_buf_size;
#endif
#if MICROPY_ENABLE_SCHEDULER
volatile int16_t sched_state;
uint8_t sched_len;
uint8_t sched_idx;
#endif
#if MICROPY_PY_THREAD_GIL
// This is a global mutex used to make the VM/runtime thread-safe.
mp_thread_mutex_t gil_mutex;
@@ -217,11 +222,6 @@ typedef struct _mp_state_vm_t {
// This structure holds state that is specific to a given thread.
// Everything in this structure is scanned for root pointers.
typedef struct _mp_state_thread_t {
mp_obj_dict_t *dict_locals;
mp_obj_dict_t *dict_globals;
nlr_buf_t *nlr_top; // ROOT POINTER
// Stack top at the start of program
char *stack_top;
@@ -234,12 +234,21 @@ typedef struct _mp_state_thread_t {
uint8_t *pystack_end;
uint8_t *pystack_cur;
#endif
////////////////////////////////////////////////////////////
// START ROOT POINTER SECTION
// Everything that needs GC scanning must start here, and
// is followed by state in the mp_state_vm_t structure.
//
mp_obj_dict_t *dict_locals;
mp_obj_dict_t *dict_globals;
nlr_buf_t *nlr_top;
} mp_state_thread_t;
// This structure combines the above 3 structures.
// The order of the entries are important for root pointer scanning in the GC to work.
// Note: if this structure changes then revisit all nlr asm code since they
// have the offset of nlr_top hard-coded.
typedef struct _mp_state_ctx_t {
mp_state_thread_t thread;
mp_state_vm_t vm;