py: Implement (non-compliant) support for delete_fast in native emitter.

This implementation is smaller (in code size) than #1024.
This commit is contained in:
Damien George 2015-04-03 14:29:30 +01:00
parent c0dcf6e878
commit 2cc5473021

View File

@ -1614,14 +1614,11 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
} }
STATIC void emit_native_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_native_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
// TODO implement me! // TODO: This is not compliant implementation. We could use MP_OBJ_SENTINEL
// could support for Python types, just set to None (so GC can reclaim it) // to mark deleted vars but then every var would need to be checked on
// local is automatically deleted for exception block "as" var, and the message // each access. Very inefficient, so just set value to None to enable GC.
// breaks tests. emit_native_load_const_tok(emit, MP_TOKEN_KW_NONE);
//mp_emitter_warning(emit->pass, "Native codegeneration doesn't support deleting local"); emit_native_store_fast(emit, qst, local_num);
(void)emit;
(void)qst;
(void)local_num;
} }
STATIC void emit_native_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_native_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {