diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-05-24 15:19:06 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-25 09:41:21 +0900 |
| commit | eeb6d5658d9e29ad24f211a3236eb02abcdb136c (patch) | |
| tree | a8f7c8138a668857303f435c569d517b1c2e47fc /src/vm.c | |
| parent | a16885efe5125944316b48c644c3a9eae2fc568e (diff) | |
| download | mruby-eeb6d5658d9e29ad24f211a3236eb02abcdb136c.tar.gz mruby-eeb6d5658d9e29ad24f211a3236eb02abcdb136c.zip | |
New bytecode implementation of mruby VM.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1069,6 +1069,16 @@ RETRY_TRY_BLOCK: NEXT; } + CASE(OP_LOADI, BB) { + SET_INT_VALUE(regs[a], b); + NEXT; + } + + CASE(OP_LOADINEG, BB) { + SET_INT_VALUE(regs[a], -b); + NEXT; + } + CASE(OP_LOADI__1,B) goto L_LOADI; CASE(OP_LOADI_0,B) goto L_LOADI; CASE(OP_LOADI_1,B) goto L_LOADI; @@ -1131,12 +1141,12 @@ RETRY_TRY_BLOCK: } CASE(OP_GETIV, BB) { - regs[a] = mrb_vm_iv_get(mrb, syms[b]); + regs[a] = mrb_iv_get(mrb, regs[0], syms[b]); NEXT; } CASE(OP_SETIV, BB) { - mrb_vm_iv_set(mrb, syms[b], regs[a]); + mrb_iv_set(mrb, regs[0], syms[b], regs[a]); NEXT; } @@ -2470,7 +2480,7 @@ RETRY_TRY_BLOCK: #ifdef MRB_WORD_BOXING { mrb_float x = mrb_float(regs[a]); - SET_FLOAT_VALUE(mrb, regs[a], x - GETARG_C(i)); + SET_FLOAT_VALUE(mrb, regs[a], x - c); } #else mrb_float(regs_a[0]) -= c; |
