diff options
author | Damien George <damien.p.george@gmail.com> | 2019-02-19 14:15:39 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-03-08 15:53:04 +1100 |
commit | 636ed0ff8d4d3c43f7d9fb2d8852073f99c1e6cf (patch) | |
tree | 39eb6fb0942a247f94acd3fe2ada6bfee5aea06c /py/emitglue.h | |
parent | 3986820912acee0909643636f52c2c672b6427d0 (diff) |
py/emitglue: Remove union in mp_raw_code_t to combine bytecode & native.
Diffstat (limited to 'py/emitglue.h')
-rw-r--r-- | py/emitglue.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/py/emitglue.h b/py/emitglue.h index d39a10ee9..53049b161 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -52,22 +52,16 @@ typedef struct _mp_raw_code_t { mp_uint_t kind : 3; // of type mp_raw_code_kind_t mp_uint_t scope_flags : 7; mp_uint_t n_pos_args : 11; - union { - struct { - const byte *bytecode; - const mp_uint_t *const_table; - #if MICROPY_PERSISTENT_CODE_SAVE - mp_uint_t bc_len; - uint16_t n_obj; - uint16_t n_raw_code; - #endif - } u_byte; - struct { - void *fun_data; - const mp_uint_t *const_table; - mp_uint_t type_sig; // for viper, compressed as 2-bit types; ret is MSB, then arg0, arg1, etc - } u_native; - } data; + const void *fun_data; + const mp_uint_t *const_table; + #if MICROPY_PERSISTENT_CODE_SAVE + size_t fun_data_len; + uint16_t n_obj; + uint16_t n_raw_code; + #endif + #if MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM + mp_uint_t type_sig; // for viper, compressed as 2-bit types; ret is MSB, then arg0, arg1, etc + #endif } mp_raw_code_t; mp_raw_code_t *mp_emit_glue_new_raw_code(void); |