diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-30 14:00:53 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-30 22:41:13 +0900 |
| commit | 99dbcec89c892bc90f36fbf38e46a9ec971e3a77 (patch) | |
| tree | b1ccd264473639b8d58d5301c90c204ba62f4aa2 /doc | |
| parent | b2b0329d2983230508fa79766c0651e78f30b99f (diff) | |
| download | mruby-99dbcec89c892bc90f36fbf38e46a9ec971e3a77.tar.gz mruby-99dbcec89c892bc90f36fbf38e46a9ec971e3a77.zip | |
Revert "Remove `OP_EXT[123]` from operands."
This reverts commit fd10c7231906ca48cb35892d2a86460004b62249.
I thought it was OK to restrict index value within 1 byte, but in some
cases index value could be 16 bits (2 bytes). I had several ideas to
address the issue, but reverting `fd10c72` is the easiest way. The
biggest reason is `mruby/c` still supports `OP_EXT[123]`, so that they
don't need any additional work.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/mruby3.md | 9 | ||||
| -rw-r--r-- | doc/opcode.md | 10 |
2 files changed, 5 insertions, 14 deletions
diff --git a/doc/mruby3.md b/doc/mruby3.md index c5da856d1..a64e3c73e 100644 --- a/doc/mruby3.md +++ b/doc/mruby3.md @@ -111,14 +111,9 @@ $ bin/mruby -r lib1.rb -r lib2.rb < app.mrb `mruby3` introduces a few new instructions. -Instructions that access pool[i]/syms[i] where i>255. - -* `OP_LOADL16` -* `OP_STRING16` -* `OP_LOADSYM16` - -Instructions that load a 32-bit integer. +Instructions that load a 16/32-bit integer. +* `OP_LOADI16` * `OP_LOADI32` Instruction that unwinds jump table for rescue/ensure. diff --git a/doc/opcode.md b/doc/opcode.md index 4e9a3292e..21dc2ef9d 100644 --- a/doc/opcode.md +++ b/doc/opcode.md @@ -27,7 +27,6 @@ sign) of operands. | `OP_NOP` | `-` | `no operation` | | `OP_MOVE` | `BB` | `R(a) = R(b)` | | `OP_LOADL` | `BB` | `R(a) = Pool(b)` | -| `OP_LOADL16` | `BS` | `R(a) = Pool(b)` | | `OP_LOADI` | `BB` | `R(a) = mrb_int(b)` | | `OP_LOADINEG` | `BB` | `R(a) = mrb_int(-b)` | | `OP_LOADI__1` | `B` | `R(a) = mrb_int(-1)` | @@ -42,7 +41,6 @@ sign) of operands. | `OP_LOADI16` | `BS` | `R(a) = mrb_int(b)` | | `OP_LOADI32` | `BSS` | `R(a) = mrb_int((b<<16)+c)` | | `OP_LOADSYM` | `BB` | `R(a) = Syms(b)` | -| `OP_LOADSYM16` | `BS` | `R(a) = Syms(b)` | | `OP_LOADNIL` | `B` | `R(a) = nil` | | `OP_LOADSELF` | `B` | `R(a) = self` | | `OP_LOADT` | `B` | `R(a) = true` | @@ -106,24 +104,19 @@ sign) of operands. | `OP_APOST` | `BBB` | `*R(a),R(a+1)..R(a+c) = R(a)[b..]` | | `OP_INTERN` | `B` | `R(a) = intern(R(a))` | | `OP_STRING` | `BB` | `R(a) = str_dup(Lit(b))` | -| `OP_STRING16` | `BS` | `R(a) = str_dup(Lit(b))` | | `OP_STRCAT` | `B` | `str_cat(R(a),R(a+1))` | | `OP_HASH` | `BB` | `R(a) = hash_new(R(a),R(a+1)..R(a+b*2-1))` | | `OP_HASHADD` | `BB` | `R(a) = hash_push(R(a),R(a+1)..R(a+b*2))` | | `OP_HASHCAT` | `B` | `R(a) = hash_cat(R(a),R(a+1))` | | `OP_LAMBDA` | `BB` | `R(a) = lambda(SEQ[b],OP_L_LAMBDA)` | -| `OP_LAMBDA16` | `BS` | `R(a) = lambda(SEQ[b],OP_L_LAMBDA)` | | `OP_BLOCK` | `BB` | `R(a) = lambda(SEQ[b],OP_L_BLOCK)` | -| `OP_BLOCK16` | `BS` | `R(a) = lambda(SEQ[b],OP_L_BLOCK)` | | `OP_METHOD` | `BB` | `R(a) = lambda(SEQ[b],OP_L_METHOD)` | -| `OP_METHOD16` | `BS` | `R(a) = lambda(SEQ[b],OP_L_METHOD)` | | `OP_RANGE_INC` | `B` | `R(a) = range_new(R(a),R(a+1),FALSE)` | | `OP_RANGE_EXC` | `B` | `R(a) = range_new(R(a),R(a+1),TRUE)` | | `OP_OCLASS` | `B` | `R(a) = ::Object` | | `OP_CLASS` | `BB` | `R(a) = newclass(R(a),Syms(b),R(a+1))` | | `OP_MODULE` | `BB` | `R(a) = newmodule(R(a),Syms(b))` | | `OP_EXEC` | `BB` | `R(a) = blockexec(R(a),SEQ[b])` | -| `OP_EXEC16` | `BS` | `R(a) = blockexec(R(a),SEQ[b])` | | `OP_DEF` | `BB` | `R(a).newmethod(Syms(b),R(a+1))` | | `OP_ALIAS` | `BB` | `alias_method(target_class,Syms(a),Syms(b))` | | `OP_UNDEF` | `B` | `undef_method(target_class,Syms(a))` | @@ -131,5 +124,8 @@ sign) of operands. | `OP_TCLASS` | `B` | `R(a) = target_class` | | `OP_DEBUG` | `BBB` | `print a,b,c` | | `OP_ERR` | `B` | `raise(LocalJumpError, Lit(a))` | +| `OP_EXT1` | `-` | `make 1st operand 16bit` | +| `OP_EXT2` | `-` | `make 2nd operand 16bit` | +| `OP_EXT3` | `-` | `make 1st and 2nd operands 16bit` | | `OP_STOP` | `-` | `stop VM` | |------------------|--------------|--------------------------------------------------------| |
