diff options
author | Damien George <damien.p.george@gmail.com> | 2014-06-01 12:06:17 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-06-01 12:06:17 +0100 |
commit | 1b87d1098a2a4fb804a116b1c43c985b53d1d762 (patch) | |
tree | 324fcab797c0cfe3d9c6c4fc035755586b5a81d9 /py/bc.h | |
parent | 6c13d7965ef23bcfd731cca83ebd7b9a248768b0 (diff) | |
parent | b4ebad3310b238bb85ea1f0d7b78b4fcb3d146df (diff) | |
download | micropython-1b87d1098a2a4fb804a116b1c43c985b53d1d762.tar.gz micropython-1b87d1098a2a4fb804a116b1c43c985b53d1d762.zip |
Merge branch 'vm-alloca' of github.com:pfalcon/micropython into pfalcon-vm-alloca
Conflicts:
py/vm.c
Fixed stack underflow check. Use UINT_FMT/INT_FMT where necessary.
Specify maximum VM-stack byte size by multiple of machine word size, so
that on 64 bit machines it has same functionality as 32 bit.
Diffstat (limited to 'py/bc.h')
-rw-r--r-- | py/bc.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -36,8 +36,21 @@ typedef struct _mp_exc_stack { byte opcode; } mp_exc_stack_t; +typedef struct _mp_code_state { + const byte *code_info; + const byte *ip; + mp_obj_t *sp; + // bit 0 is saved currently_in_except_block value + mp_exc_stack_t *exc_sp; + uint n_state; + // Variable-length + mp_obj_t state[0]; + // Variable-length, never accessed by name, only as (void*)(state + n_state) + //mp_exc_stack_t exc_state[0]; +} mp_code_state; + mp_vm_return_kind_t mp_execute_bytecode(const byte *code, const mp_obj_t *args, uint n_args, const mp_obj_t *args2, uint n_args2, mp_obj_t *ret); -mp_vm_return_kind_t mp_execute_bytecode2(const byte *code_info, const byte **ip_in_out, 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); +mp_vm_return_kind_t mp_execute_bytecode2(mp_code_state *code_state, volatile mp_obj_t inject_exc); void mp_bytecode_print(const byte *code, int len); void mp_bytecode_print2(const byte *code, int len); |