Commit c1075ddc authored by Damien's avatar Damien
Browse files

py: add some more opcodes to showbc.

parent 1895cf91
...@@ -45,12 +45,14 @@ void py_show_byte_code(const byte *ip, int len) { ...@@ -45,12 +45,14 @@ void py_show_byte_code(const byte *ip, int len) {
DECODE_QSTR; DECODE_QSTR;
PUSH(rt_load_const_dec(qstr)); PUSH(rt_load_const_dec(qstr));
break; break;
*/
case PYBC_LOAD_CONST_ID: case PYBC_LOAD_CONST_ID:
DECODE_QSTR; DECODE_QSTR;
PUSH(rt_load_const_str(qstr)); // TODO printf("LOAD_CONST_ID %s", qstr_str(qstr));
break; break;
/*
case PYBC_LOAD_CONST_STRING: case PYBC_LOAD_CONST_STRING:
DECODE_QSTR; DECODE_QSTR;
PUSH(rt_load_const_str(qstr)); PUSH(rt_load_const_str(qstr));
...@@ -86,23 +88,19 @@ void py_show_byte_code(const byte *ip, int len) { ...@@ -86,23 +88,19 @@ void py_show_byte_code(const byte *ip, int len) {
printf("LOAD_GLOBAL %s", qstr_str(qstr)); printf("LOAD_GLOBAL %s", qstr_str(qstr));
break; break;
/*
case PYBC_LOAD_ATTR: case PYBC_LOAD_ATTR:
DECODE_QSTR; DECODE_QSTR;
*sp = rt_load_attr(*sp, qstr); printf("LOAD_ATTR %s", qstr_str(qstr));
break; break;
*/
case PYBC_LOAD_METHOD: case PYBC_LOAD_METHOD:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_METHOD %s", qstr_str(qstr)); printf("LOAD_METHOD %s", qstr_str(qstr));
break; break;
/*
case PYBC_LOAD_BUILD_CLASS: case PYBC_LOAD_BUILD_CLASS:
PUSH(rt_load_build_class()); printf("LOAD_BUILD_CLASS");
break; break;
*/
case PYBC_STORE_FAST_0: case PYBC_STORE_FAST_0:
printf("STORE_FAST_0"); printf("STORE_FAST_0");
...@@ -133,13 +131,14 @@ void py_show_byte_code(const byte *ip, int len) { ...@@ -133,13 +131,14 @@ void py_show_byte_code(const byte *ip, int len) {
DECODE_QSTR; DECODE_QSTR;
rt_store_global(qstr, POP()); rt_store_global(qstr, POP());
break; break;
*/
case PYBC_STORE_ATTR: case PYBC_STORE_ATTR:
DECODE_QSTR; DECODE_QSTR;
rt_store_attr(sp[0], qstr, sp[1]); printf("STORE_ATTR %s", qstr_str(qstr));
sp += 2;
break; break;
/*
case PYBC_STORE_SUBSCR: case PYBC_STORE_SUBSCR:
rt_store_subscr(sp[1], sp[0], sp[2]); rt_store_subscr(sp[1], sp[0], sp[2]);
sp += 3; sp += 3;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment