diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-08 21:32:29 +0100 | 
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-08 21:32:29 +0100 | 
| commit | f4c9b33abf0ac6ff97cd39331d125a74fd2bb897 (patch) | |
| tree | 64bdfb7d6d032d826640e1f9a43956b0b3947591 /py/emitbc.c | |
| parent | 4671392d90e98ea4edf6e9ce7023d21cc9957d8c (diff) | |
py: Remove DELETE_SUBSCR opcode, combine with STORE_SUBSCR.
This makes the runtime and object APIs more consistent.  mp_store_subscr
functionality now moved into objects (ie list and dict store_item).
Diffstat (limited to 'py/emitbc.c')
| -rw-r--r-- | py/emitbc.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/py/emitbc.c b/py/emitbc.c index 2a390a056..50bb0016e 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -37,6 +37,7 @@ struct _emit_t {  };  STATIC void emit_bc_rot_two(emit_t *emit); +STATIC void emit_bc_rot_three(emit_t *emit);  emit_t *emit_bc_new(uint max_num_labels) {      emit_t *emit = m_new0(emit_t, 1); @@ -515,8 +516,9 @@ STATIC void emit_bc_delete_attr(emit_t *emit, qstr qstr) {  }  STATIC void emit_bc_delete_subscr(emit_t *emit) { -    emit_bc_pre(emit, -2); -    emit_write_byte_code_byte(emit, MP_BC_DELETE_SUBSCR); +    emit_bc_load_null(emit); +    emit_bc_rot_three(emit); +    emit_bc_store_subscr(emit);  }  STATIC void emit_bc_dup_top(emit_t *emit) { | 
