diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-09-17 07:49:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-09-17 07:49:47 +0900 |
| commit | 7c99df8416aa866725c11e5ced7f2c5a818a8c74 (patch) | |
| tree | 827ad7d0074e44eb28672ca8b41788a3c1bc28a4 /src/codedump.c | |
| parent | 6f044de578bd9b1056e59bb499d49a5dc7ebef2b (diff) | |
| download | mruby-7c99df8416aa866725c11e5ced7f2c5a818a8c74.tar.gz mruby-7c99df8416aa866725c11e5ced7f2c5a818a8c74.zip | |
ops.h: add `OP_ARYPUSH_N` instruction.
Add n elements at once. Reduces instructions for huge array
initialization. In addition, `gen_value` function in `codegen.c` was
refactored and clarified.
Diffstat (limited to 'src/codedump.c')
| -rw-r--r-- | src/codedump.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/codedump.c b/src/codedump.c index 87faa589c..3128d7467 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -428,13 +428,17 @@ codedump(mrb_state *mrb, const mrb_irep *irep) print_lv_ab(mrb, irep, a, b); break; CASE(OP_ARYCAT, B): - printf("OP_ARYCAT\tR%d\t", a); + printf("OP_ARYCAT\tR%d\tR%d\t", a, a+1); print_lv_a(mrb, irep, a); break; CASE(OP_ARYPUSH, B): printf("OP_ARYPUSH\tR%d\t", a); print_lv_a(mrb, irep, a); break; + CASE(OP_ARYPUSH_N, BB): + printf("OP_ARYPUSH_N\tR%d\t%d\t", a, b); + print_lv_a(mrb, irep, a); + break; CASE(OP_ARYDUP, B): printf("OP_ARYDUP\tR%d\t", a); print_lv_a(mrb, irep, a); |
