diff --git a/lang/bytecode.c b/lang/bytecode.c index e56826f..69c76df 100644 --- a/lang/bytecode.c +++ b/lang/bytecode.c @@ -31,7 +31,7 @@ OP_JUMP_FALSE = 0x0C, OP_JUMP_ALWAYS = 0x0D, OP_TAIL_CALL = 0x0E, - OP_GET_ARG = 0x0F, + OP_MOD_USE = 0x0F, }; void bytecode_run(VmState state, Object obj, const unsigned char *bytecode, @@ -168,9 +168,9 @@ debug_msg("OP_RET\n"); return; } - // OP_GET_ARG pushes an argument on the stack - case OP_GET_ARG: { - debug_msg("OP_GET_ARG %i\n", *pos_code); + // OP_MOD_USE pushes an argument on the stack + case OP_MOD_USE: { + debug_msg("OP_MOD_USE %i\n", *pos_code); int index = *pos_code++; Object obj = module_runtime_use(state, module, index); vm_stack_push(state, obj); diff --git a/lang/bytecode.h b/lang/bytecode.h index a73a1d7..d845de9 100644 --- a/lang/bytecode.h +++ b/lang/bytecode.h @@ -9,7 +9,7 @@ // Runs bytecode // obj is used for OP_SELF -// module is used for OP_GET_ARG +// module is used for OP_MOD_USE void bytecode_run(VmState state, Object obj, const unsigned char *bytecode, Object module); diff --git a/lang/compile.py b/lang/compile.py index d146404..d6053da 100755 --- a/lang/compile.py +++ b/lang/compile.py @@ -871,7 +871,7 @@ bytes += index.to_bytes(1) elif isinstance(node, IRLoadArg): index = int(node.index) - bytes += b"\x0F" # OP_GET_ARG + bytes += b"\x0F" # OP_MOD_USE bytes += index.to_bytes(1) elif isinstance(node, IRStore): index = int(node.pos)