From 401d316bcfc275227bf1c567092540cecbb34ed2 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 19 Feb 2022 14:39:17 +0900 Subject: [PATCH] Update `doc/mruby3.1.md` - `OP_GETIDX`, `OP_SETIDX` : Fix operand number - `OP_SYMBOL` : Add entry --- doc/mruby3.1.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/mruby3.1.md b/doc/mruby3.1.md index 0c9ba8108..5588ae24d 100644 --- a/doc/mruby3.1.md +++ b/doc/mruby3.1.md @@ -72,10 +72,11 @@ Those instructions for method calls with variable number of arguments are no lon `mruby3.1` introduces following new instructions. -* `OP_GETIDX`: takes 2 operands `a[b]` -* `OP_SETIDX`: takes 3 operands `a[b]=c` +* `OP_GETIDX`: takes 1 operands `R[a][a+1]` +* `OP_SETIDX`: takes 1 operands `R[a][a+1]=R[a+2]` * `OP_SSEND`: takes 3 operands `a=self.b(c...)`; see `OP_SEND` * `OP_SSENDB`: takes 3 operands `a=self.b(c...){...}`; see `OP_SEND` +* `OP_SYMBOL`: takes 2 operands `R[a] = intern(Pool[b])` ### `OP_GETIDX` and `OP_SETIDX` @@ -85,6 +86,10 @@ Execute `obj[int]` and `obj[int] = value` respectively, where `obj` is `string|a They are similar to `OP_SEND` and `OP_SENDB` respectively. They initialize the `R[a]` by `self` first so that we can skip one `OP_LOADSELF` instruction for each call. +### `OP_SYMBOL` + +Extracts the character string placed in the pool as a symbol. + ## Changed Instructions ### `OP_SEND` and `OP_SENDB`