diff options
author | Damien George <damien.p.george@gmail.com> | 2018-10-14 23:23:25 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-15 00:20:49 +1100 |
commit | 6c6050ca43e5ee9d6d504eaad4cd1957aa6ffd7c (patch) | |
tree | 7322785137a8648cb0b639472cf9aad9de219ce7 /py | |
parent | 7c16bc0406044c3ecb978a03894d1a59bd4bd0d2 (diff) | |
download | micropython-6c6050ca43e5ee9d6d504eaad4cd1957aa6ffd7c.tar.gz micropython-6c6050ca43e5ee9d6d504eaad4cd1957aa6ffd7c.zip |
py/emitnative: Push internal None rather than const obj where possible.
This shifts the work of loading the constant None object on to
load_reg_stack_imm(), making the handling of None more centralised.
Diffstat (limited to 'py')
-rw-r--r-- | py/emitnative.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 459290befb..2f731f78e3 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1990,9 +1990,9 @@ STATIC void emit_native_with_cleanup(emit_t *emit, mp_uint_t label) { emit_native_label_assign(emit, *emit->label_slot + 2); // call __exit__ - emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)mp_const_none); - emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)mp_const_none); - emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)mp_const_none); + emit_post_push_imm(emit, VTYPE_PTR_NONE, 0); + emit_post_push_imm(emit, VTYPE_PTR_NONE, 0); + emit_post_push_imm(emit, VTYPE_PTR_NONE, 0); emit_get_stack_pointer_to_reg_for_pop(emit, REG_ARG_3, 5); emit_call_with_2_imm_args(emit, MP_F_CALL_METHOD_N_KW, 3, REG_ARG_1, 0, REG_ARG_2); @@ -2019,7 +2019,7 @@ STATIC void emit_native_with_cleanup(emit_t *emit, mp_uint_t label) { ASM_LOAD_REG_REG_OFFSET(emit->as, REG_ARG_2, REG_ARG_1, 0); // get type(exc) emit_post_push_reg(emit, VTYPE_PYOBJ, REG_ARG_2); // push type(exc) emit_post_push_reg(emit, VTYPE_PYOBJ, REG_ARG_1); // push exc value - emit_post_push_imm(emit, VTYPE_PYOBJ, (mp_uint_t)mp_const_none); // traceback info + emit_post_push_imm(emit, VTYPE_PTR_NONE, 0); // traceback info // Stack: (..., __exit__, self, type(exc), exc, traceback) // call __exit__ method |