Commit ed570e4b authored by Damien George's avatar Damien George
Browse files

py: Remove mp_load_const_str and replace uses with inlined version.

parent 484adac0
......@@ -167,7 +167,6 @@
STATIC byte mp_f_n_args[MP_F_NUMBER_OF] = {
[MP_F_CONVERT_OBJ_TO_NATIVE] = 2,
[MP_F_CONVERT_NATIVE_TO_OBJ] = 2,
[MP_F_LOAD_CONST_STR] = 1,
[MP_F_LOAD_CONST_BYTES] = 1,
[MP_F_LOAD_NAME] = 1,
[MP_F_LOAD_GLOBAL] = 1,
......@@ -1311,10 +1310,10 @@ STATIC void emit_native_load_const_str(emit_t *emit, qstr qst, bool bytes) {
{
if (bytes) {
emit_call_with_imm_arg(emit, MP_F_LOAD_CONST_BYTES, qst, REG_ARG_1);
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
} else {
emit_call_with_imm_arg(emit, MP_F_LOAD_CONST_STR, qst, REG_ARG_1);
emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)MP_OBJ_NEW_QSTR(qst));
}
emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET);
}
}
......
......@@ -92,7 +92,6 @@ void mp_native_raise(mp_obj_t o) {
void *const mp_fun_table[MP_F_NUMBER_OF] = {
mp_convert_obj_to_native,
mp_convert_native_to_obj,
mp_load_const_str,
mp_load_const_bytes,
mp_load_name,
mp_load_global,
......
......@@ -104,11 +104,6 @@ void mp_deinit(void) {
#endif
}
mp_obj_t mp_load_const_str(qstr qst) {
DEBUG_OP_printf("load '%s'\n", qstr_str(qst));
return MP_OBJ_NEW_QSTR(qst);
}
mp_obj_t mp_load_const_bytes(qstr qst) {
DEBUG_OP_printf("load b'%s'\n", qstr_str(qst));
mp_uint_t len;
......
......@@ -90,7 +90,6 @@ mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs);
mp_obj_t mp_load_const_int(qstr qst);
mp_obj_t mp_load_const_dec(qstr qst);
mp_obj_t mp_load_const_str(qstr qst);
mp_obj_t mp_load_const_bytes(qstr qst);
mp_obj_t mp_call_function_0(mp_obj_t fun);
......
......@@ -109,7 +109,6 @@ typedef enum {
typedef enum {
MP_F_CONVERT_OBJ_TO_NATIVE = 0,
MP_F_CONVERT_NATIVE_TO_OBJ,
MP_F_LOAD_CONST_STR,
MP_F_LOAD_CONST_BYTES,
MP_F_LOAD_NAME,
MP_F_LOAD_GLOBAL,
......
......@@ -213,7 +213,7 @@ dispatch_loop:
ENTRY(MP_BC_LOAD_CONST_STRING): {
DECODE_QSTR;
PUSH(mp_load_const_str(qst));
PUSH(MP_OBJ_NEW_QSTR(qst));
DISPATCH();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment