From 2138f24c7017298c9fffa6d3de7a53cb55b567b4 Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 10 Aug 2018 07:45:16 +0000 Subject: insns.def (invokesuper): remove a dummy receiever flag hack for ZSUPER This is just a refactoring. The receiver of "invokesuper" was a boolean to represent if it is ZSUPER or not. This was used in vm_search_super_method to prohibit ZSUPER call in define_method. (It is currently prohibited because of the limitation of the implementation.) This change removes the hack by introducing an explicit flag, VM_CALL_SUPER, to signal the information. Now, the implementation of "invokesuper" is consistent with "send" instruction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 5a458200ec..52d74da741 100644 --- a/compile.c +++ b/compile.c @@ -6624,11 +6624,10 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in } } - /* dummy receiver */ - ADD_INSN1(ret, line, putobject, type == NODE_ZSUPER ? Qfalse : Qtrue); + ADD_INSN(ret, line, putself); ADD_SEQ(ret, args); ADD_INSN3(ret, line, invokesuper, - new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | VM_CALL_FCALL, keywords, parent_block != NULL), + new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | (type == NODE_ZSUPER ? VM_CALL_ZSUPER : 0) | VM_CALL_FCALL, keywords, parent_block != NULL), Qnil, /* CALL_CACHE */ parent_block); -- cgit v1.2.3