summaryrefslogtreecommitdiff
path: root/py/emitglue.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-31 22:19:00 +0000
committerDamien George <damien.p.george@gmail.com>2016-04-13 16:05:43 +0100
commit6d24dc23b82ea7cc62b9c55de91c98330c2675ee (patch)
treece7ad7cf3897daca58d64a30e4038eb3b7a8f53e /py/emitglue.h
parentc2a519bab9d76f64216cb37a6c54c8645e293130 (diff)
py/emitglue: Move typedef of mp_raw_code_t from .c to .h file.
It's needed by frozen bytecode.
Diffstat (limited to 'py/emitglue.h')
-rw-r--r--py/emitglue.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/py/emitglue.h b/py/emitglue.h
index b31e8dbb2..03a9e2f65 100644
--- a/py/emitglue.h
+++ b/py/emitglue.h
@@ -39,7 +39,27 @@ typedef enum {
MP_CODE_NATIVE_ASM,
} mp_raw_code_kind_t;
-typedef struct _mp_raw_code_t mp_raw_code_t;
+typedef struct _mp_raw_code_t {
+ mp_raw_code_kind_t kind : 3;
+ 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;
+} mp_raw_code_t;
mp_raw_code_t *mp_emit_glue_new_raw_code(void);