Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
ed570e4b
Commit
ed570e4b
authored
Jun 25, 2015
by
Damien George
Browse files
py: Remove mp_load_const_str and replace uses with inlined version.
parent
484adac0
Changes
6
Hide whitespace changes
Inline
Side-by-side
py/emitnative.c
View file @
ed570e4b
...
...
@@ -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_wit
h_imm
_arg
(
emit
,
MP_F_LOAD_CONST_
STR
,
qst
,
REG_ARG_1
);
emit_
post_pus
h_imm
(
emit
,
VTYPE_PYOBJ
,
(
mp_uint_t
)
MP_OBJ_NEW_Q
STR
(
qst
)
);
}
emit_post_push_reg
(
emit
,
VTYPE_PYOBJ
,
REG_RET
);
}
}
...
...
py/nativeglue.c
View file @
ed570e4b
...
...
@@ -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
,
...
...
py/runtime.c
View file @
ed570e4b
...
...
@@ -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
;
...
...
py/runtime.h
View file @
ed570e4b
...
...
@@ -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
);
...
...
py/runtime0.h
View file @
ed570e4b
...
...
@@ -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
,
...
...
py/vm.c
View file @
ed570e4b
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment