summaryrefslogtreecommitdiff
path: root/py/emitbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-17 22:10:53 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-17 22:10:53 +0100
commit729f7b42d65c016c9d5f27fb8a8122869f06c129 (patch)
tree8d8d8c2a89ff9011b06650c256a2d5f2458c930c /py/emitbc.c
parentde7c425139c92745280b62f7ebb756def96d072a (diff)
py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
mp_obj_t->subscr now does load/store/delete.
Diffstat (limited to 'py/emitbc.c')
-rw-r--r--py/emitbc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/emitbc.c b/py/emitbc.c
index 4dad61bb2..d7b309a37 100644
--- a/py/emitbc.c
+++ b/py/emitbc.c
@@ -477,6 +477,11 @@ STATIC void emit_bc_load_build_class(emit_t *emit) {
emit_write_byte_code_byte(emit, MP_BC_LOAD_BUILD_CLASS);
}
+STATIC void emit_bc_load_subscr(emit_t *emit) {
+ emit_bc_pre(emit, -1);
+ emit_write_byte_code_byte(emit, MP_BC_LOAD_SUBSCR);
+}
+
STATIC void emit_bc_store_fast(emit_t *emit, qstr qstr, int local_num) {
assert(local_num >= 0);
emit_bc_pre(emit, -1);
@@ -873,6 +878,7 @@ const emit_method_table_t emit_bc_method_table = {
emit_bc_load_attr,
emit_bc_load_method,
emit_bc_load_build_class,
+ emit_bc_load_subscr,
emit_bc_store_fast,
emit_bc_store_deref,
emit_bc_store_name,