mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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.
This commit is contained in:
@@ -86,6 +86,7 @@ OPCODE(ARRAY, BB) /* R(a) = ary_new(R(a),R(a+1)..R(a+b)) */
|
||||
OPCODE(ARRAY2, BBB) /* R(a) = ary_new(R(b),R(b+1)..R(b+c)) */
|
||||
OPCODE(ARYCAT, B) /* ary_cat(R(a),R(a+1)) */
|
||||
OPCODE(ARYPUSH, B) /* ary_push(R(a),R(a+1)) */
|
||||
OPCODE(ARYPUSH_N, BB) /* ary_push(R(a),R(a+1)..R(a+b)) */
|
||||
OPCODE(ARYDUP, B) /* R(a) = ary_dup(R(a)) */
|
||||
OPCODE(AREF, BBB) /* R(a) = R(b)[c] */
|
||||
OPCODE(ASET, BBB) /* R(a)[c] = R(b) */
|
||||
|
||||
Reference in New Issue
Block a user