From fa8668c77d181a5075dc56fb63d6fa087ab4b1d3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 17 Jan 2020 09:28:21 +0900 Subject: Add a new instruction `OP_LOADI16`. Which loads 16bit integer to the register. The instruction number should be reorder on massive instruction refactoring. The instruction is added for `mruby/c` which had performance issue with `OP_EXT`. With this instruction, `mruby/c` VM can just raise errors on `OP_EXT` extension instructions. --- src/vm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/vm.c') diff --git a/src/vm.c b/src/vm.c index ea1bb5087..26da5831e 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1047,6 +1047,11 @@ RETRY_TRY_BLOCK: NEXT; } + CASE(OP_LOADI16, BS) { + SET_INT_VALUE(regs[a], (mrb_int)(int16_t)b); + NEXT; + } + CASE(OP_LOADSYM, BB) { SET_SYM_VALUE(regs[a], syms[b]); NEXT; -- cgit v1.2.3