Browse Source

py/emit: Change type of arg of load_const_obj from void* to mp_obj_t.

pull/1655/merge
Damien George 9 years ago
parent
commit
5d66b427e2
  1. 4
      py/emit.h
  2. 2
      py/emitbc.c
  3. 2
      py/emitnative.c

4
py/emit.h

@ -85,7 +85,7 @@ typedef struct _emit_method_table_t {
void (*load_const_tok)(emit_t *emit, mp_token_kind_t tok);
void (*load_const_small_int)(emit_t *emit, mp_int_t arg);
void (*load_const_str)(emit_t *emit, qstr qst);
void (*load_const_obj)(emit_t *emit, void *obj);
void (*load_const_obj)(emit_t *emit, mp_obj_t obj);
void (*load_null)(emit_t *emit);
void (*load_attr)(emit_t *emit, qstr qst);
void (*load_method)(emit_t *emit, qstr qst);
@ -205,7 +205,7 @@ void mp_emit_bc_import_star(emit_t *emit);
void mp_emit_bc_load_const_tok(emit_t *emit, mp_token_kind_t tok);
void mp_emit_bc_load_const_small_int(emit_t *emit, mp_int_t arg);
void mp_emit_bc_load_const_str(emit_t *emit, qstr qst);
void mp_emit_bc_load_const_obj(emit_t *emit, void *obj);
void mp_emit_bc_load_const_obj(emit_t *emit, mp_obj_t obj);
void mp_emit_bc_load_null(emit_t *emit);
void mp_emit_bc_load_attr(emit_t *emit, qstr qst);
void mp_emit_bc_load_method(emit_t *emit, qstr qst);

2
py/emitbc.c

@ -542,7 +542,7 @@ void mp_emit_bc_load_const_str(emit_t *emit, qstr qst) {
emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_CONST_STRING, qst);
}
void mp_emit_bc_load_const_obj(emit_t *emit, void *obj) {
void mp_emit_bc_load_const_obj(emit_t *emit, mp_obj_t obj) {
emit_bc_pre(emit, 1);
emit_write_bytecode_byte_obj(emit, MP_BC_LOAD_CONST_OBJ, obj);
}

2
py/emitnative.c

@ -1344,7 +1344,7 @@ STATIC void emit_native_load_const_str(emit_t *emit, qstr qst) {
}
}
STATIC void emit_native_load_const_obj(emit_t *emit, void *obj) {
STATIC void emit_native_load_const_obj(emit_t *emit, mp_obj_t obj) {
emit_native_pre(emit);
need_reg_single(emit, REG_RET, 0);
ASM_MOV_ALIGNED_IMM_TO_REG(emit->as, (mp_uint_t)obj, REG_RET);

Loading…
Cancel
Save