Issue #10328 has been updated by Koichi Sasada.


BTW, we provide "bitblt" and "answer" insturctions as a official (joke) instructions without enabling SUPPORT_JOKE flag.
People can use them by assembling YARV codes (with some tricks) manually.

With your measurement, we paid 736 bytes for this kind of humor.
Personally, I hope that Ruby can understand humor.
736 byte is not expensive *for me*.

However, I also agree Ruby is now a serious language.


----------------------------------------
Feature #10328: [PATCH] make OPT_SUPPORT_JOKE a proper VM option
https://bugs.ruby-lang.org/issues/10328#change-49237

* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: Eric Wong
* Category: core
* Target version: current: 2.2.0
----------------------------------------
This is not a joke :)

I worry about executable size with things like [Feature #10326],
and I noticed unused instructions are emitted even with jokes disabled

This reduces executable size slightly on x86-64-linux:

   text	   data	    bss	    dec	    hex	filename
2782156   22400   71880 2876436  2be414 ruby.before
2781420   22400   71880 2875700  2be134 ruby.after

Pretty trivial so I'll commit in a day or two.
---
 compile.c           | 4 ++--
 eval.c              | 2 +-
 iseq.h              | 2 +-
 tool/instruction.rb | 9 ++++++---
 vm_opts.h           | 2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)


---Files--------------------------------
0001-make-OPT_SUPPORT_JOKE-a-proper-VM-option.patch (3.18 KB)


-- 
https://bugs.ruby-lang.org/