diff options
| author | Damien George <damien.p.george@gmail.com> | 2016-12-09 21:23:17 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2016-12-09 21:23:17 +1100 |
| commit | e920bab9768f71c7e22fcfc5af3e1c40f2db8eeb (patch) | |
| tree | 70fe0b48f904fed208fbf0726db09f0250101dba /py/emitinlinextensa.c | |
| parent | dd53b12193dca4800ab207170fcc883142dd0f22 (diff) | |
py/emitinline: Move common code for end of final pass to compiler.
This patch moves some common code from the individual inline assemblers to
the compiler, the code that calls the emit-glue to assign the machine code
to the functions scope.
Diffstat (limited to 'py/emitinlinextensa.c')
| -rw-r--r-- | py/emitinlinextensa.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/py/emitinlinextensa.c b/py/emitinlinextensa.c index 38a8629e1..3d3217f5b 100644 --- a/py/emitinlinextensa.c +++ b/py/emitinlinextensa.c @@ -38,7 +38,6 @@ struct _emit_inline_asm_t { asm_xtensa_t as; uint16_t pass; - scope_t *scope; mp_obj_t *error_slot; mp_uint_t max_num_labels; qstr *label_lookup; @@ -67,9 +66,8 @@ void emit_inline_xtensa_free(emit_inline_asm_t *emit) { m_del_obj(emit_inline_asm_t, emit); } -STATIC void emit_inline_xtensa_start_pass(emit_inline_asm_t *emit, pass_kind_t pass, scope_t *scope, mp_obj_t *error_slot) { +STATIC void emit_inline_xtensa_start_pass(emit_inline_asm_t *emit, pass_kind_t pass, mp_obj_t *error_slot) { emit->pass = pass; - emit->scope = scope; emit->error_slot = error_slot; if (emit->pass == MP_PASS_CODE_SIZE) { memset(emit->label_lookup, 0, emit->max_num_labels * sizeof(qstr)); @@ -81,12 +79,6 @@ STATIC void emit_inline_xtensa_start_pass(emit_inline_asm_t *emit, pass_kind_t p STATIC void emit_inline_xtensa_end_pass(emit_inline_asm_t *emit, mp_uint_t type_sig) { asm_xtensa_exit(&emit->as); asm_xtensa_end_pass(&emit->as); - - if (emit->pass == MP_PASS_EMIT) { - void *f = mp_asm_base_get_code(&emit->as.base); - mp_emit_glue_assign_native(emit->scope->raw_code, MP_CODE_NATIVE_ASM, f, - mp_asm_base_get_code_size(&emit->as.base), NULL, emit->scope->num_pos_args, 0, type_sig); - } } STATIC mp_uint_t emit_inline_xtensa_count_params(emit_inline_asm_t *emit, mp_uint_t n_params, mp_parse_node_t *pn_params) { |
