py/bc0: Order opcodes into groups based on their size and format.

This commit is contained in:
Damien George
2019-09-02 20:24:01 +10:00
parent fe4e1fe4b9
commit 5889cf58db
5 changed files with 111 additions and 96 deletions

View File

@@ -109,15 +109,15 @@ MP_OPCODE_VAR_UINT = 2
MP_OPCODE_OFFSET = 3
# extra bytes:
MP_BC_UNWIND_JUMP = 0x46
MP_BC_MAKE_CLOSURE = 0x62
MP_BC_MAKE_CLOSURE_DEFARGS = 0x63
MP_BC_RAISE_VARARGS = 0x5c
MP_BC_UNWIND_JUMP = 0x40
MP_BC_MAKE_CLOSURE = 0x20
MP_BC_MAKE_CLOSURE_DEFARGS = 0x21
MP_BC_RAISE_VARARGS = 0x60
# extra byte if caching enabled:
MP_BC_LOAD_NAME = 0x1b
MP_BC_LOAD_GLOBAL = 0x1c
MP_BC_LOAD_ATTR = 0x1d
MP_BC_STORE_ATTR = 0x26
MP_BC_LOAD_NAME = 0x11
MP_BC_LOAD_GLOBAL = 0x12
MP_BC_LOAD_ATTR = 0x13
MP_BC_STORE_ATTR = 0x18
def make_opcode_format():
def OC4(a, b, c, d):