Skip to content

Commit

Permalink
Merge pull request #5651 from dearblue/doc3.1
Browse files Browse the repository at this point in the history
Update `doc/mruby3.1.md`
  • Loading branch information
matz committed Feb 19, 2022
2 parents 5a01499 + 401d316 commit f906ac3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions doc/mruby3.1.md
Expand Up @@ -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`

Expand All @@ -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`
Expand Down

0 comments on commit f906ac3

Please sign in to comment.