summaryrefslogtreecommitdiffhomepage
path: root/mruby-source.gemspec
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-07-16 07:52:21 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-07-16 07:52:21 +0900
commit1a3564f2f1fce239d7982cd5b3850bfff32222c0 (patch)
tree24819d54f6edf26c88e6b84a322736befe3de6f3 /mruby-source.gemspec
parentd4abbf1b77b225448a8914bbe48b400008bb40cb (diff)
downloadmruby-1a3564f2f1fce239d7982cd5b3850bfff32222c0.tar.gz
mruby-1a3564f2f1fce239d7982cd5b3850bfff32222c0.zip
codegen.c: add new peephole optimization for `OP_GETUPVAR`.
When `OP_GETUPVAR` is generated right after `OP_SETUPVAR`, there is no need to read the upvar back to the register, e.g. 3 008 OP_ADDI R2 1 3 011 OP_SETUPVAR R2 1 0 4 015 OP_GETUPVAR R2 1 0 4 019 OP_LOADI_2 R3 `OP_GETUPVAR` at the address `015` is useless. We can skip it like: 3 008 OP_ADDI R2 1 3 011 OP_SETUPVAR R2 1 0 4 015 OP_LOADI_2 R3
Diffstat (limited to 'mruby-source.gemspec')
0 files changed, 0 insertions, 0 deletions