summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-07-03 06:40:05 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-07-03 06:40:05 +0900
commitd9a8981c26829aae0908244c3728f17e06a88ee2 (patch)
tree1f3d18efc90edb0002b3139e251909dd6ae58cfa /include
parenta624da6fdb160b9a70a96c1ffe9dec017d7f5cb4 (diff)
downloadmruby-d9a8981c26829aae0908244c3728f17e06a88ee2.tar.gz
mruby-d9a8981c26829aae0908244c3728f17e06a88ee2.zip
vm.c: `OP_DEF` to push a symbol to `a` register.
The code generator no longer need to emit `OP_LOADSYM` after `OP_DEF`. `doc/opcode.md` is also updated.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/ops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mruby/ops.h b/include/mruby/ops.h
index 8d62f007f..3388d171e 100644
--- a/include/mruby/ops.h
+++ b/include/mruby/ops.h
@@ -105,7 +105,7 @@ OPCODE(OCLASS, B) /* R(a) = ::Object */
OPCODE(CLASS, BB) /* R(a) = newclass(R(a),Syms(b),R(a+1)) */
OPCODE(MODULE, BB) /* R(a) = newmodule(R(a),Syms(b)) */
OPCODE(EXEC, BB) /* R(a) = blockexec(R(a),SEQ[b]) */
-OPCODE(DEF, BB) /* R(a).newmethod(Syms(b),R(a+1)) */
+OPCODE(DEF, BB) /* R(a).newmethod(Syms(b),R(a+1)); R(a) = Syms(b) */
OPCODE(ALIAS, BB) /* alias_method(target_class,Syms(a),Syms(b)) */
OPCODE(UNDEF, B) /* undef_method(target_class,Syms(a)) */
OPCODE(SCLASS, B) /* R(a) = R(a).singleton_class */