summaryrefslogtreecommitdiff
path: root/py/persistentcode.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-09-02 21:35:26 +1000
committerDamien George <damien.p.george@gmail.com>2019-09-26 15:27:11 +1000
commit1f7202d122a478b0c8cedcf7cf252849b2d3d881 (patch)
tree3dc90802a8704a4995cf0c41244be946b3bbe12b /py/persistentcode.c
parent67fdfebe645d5df69cfa01b81a6776ecae3b6625 (diff)
py/bc: Replace big opcode format table with simple macro.
Diffstat (limited to 'py/persistentcode.c')
-rw-r--r--py/persistentcode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/persistentcode.c b/py/persistentcode.c
index 5e970b553..3b59746ba 100644
--- a/py/persistentcode.c
+++ b/py/persistentcode.c
@@ -32,7 +32,7 @@
#include "py/reader.h"
#include "py/emitglue.h"
#include "py/persistentcode.h"
-#include "py/bc.h"
+#include "py/bc0.h"
#if MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE
@@ -307,12 +307,12 @@ STATIC void load_bytecode(mp_reader_t *reader, qstr_window_t *qw, byte *ip, byte
uint f = mp_opcode_format(ip, &sz, false);
++ip;
--sz;
- if (f == MP_OPCODE_QSTR) {
+ if (f == MP_BC_FORMAT_QSTR) {
qstr qst = load_qstr(reader, qw);
*ip++ = qst;
*ip++ = qst >> 8;
sz -= 2;
- } else if (f == MP_OPCODE_VAR_UINT) {
+ } else if (f == MP_BC_FORMAT_VAR_UINT) {
while ((*ip++ = read_byte(reader)) & 0x80) {
}
}
@@ -600,7 +600,7 @@ STATIC void save_bytecode(mp_print_t *print, qstr_window_t *qw, const byte *ip,
while (ip < ip_top) {
size_t sz;
uint f = mp_opcode_format(ip, &sz, true);
- if (f == MP_OPCODE_QSTR) {
+ if (f == MP_BC_FORMAT_QSTR) {
mp_print_bytes(print, ip, 1);
qstr qst = ip[1] | (ip[2] << 8);
save_qstr(print, qw, qst);