From: mame@... Date: 2017-11-28T05:25:18+00:00 Subject: [ruby-core:83908] [Ruby trunk Feature#10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option Issue #10328 has been updated by mame (Yusuke Endoh). A patch to remove joke instructions when `SUPPORT_JOKE` is false: ``` diff --git a/tool/instruction.rb b/tool/instruction.rb index 3354933da9..e917826ffe 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -885,6 +885,7 @@ def make_footer_undefs insn def make_header insn label = insn.trace ? '' : "start_of_#{insn.name}:;" + commit "#ifdef SUPPORT_JOKE" if insn.comm[:c] == "joke" commit "INSN_ENTRY(#{insn.name}){#{label}" make_header_prepare_stack insn commit "{" @@ -911,6 +912,7 @@ def make_footer insn make_footer_undefs insn end commit " END_INSN(#{insn.name});}}}" + commit "#endif /* SUPPORT_JOKE */" if insn.comm[:c] == "joke" end def make_insn_def insn ``` I'm neutral to the SUPPORT_JOKE feature. I don't care 736 bytes if the feature is funny enough. But I'm unsure if the feature is funny enough. ---------------------------------------- Feature #10328: [PATCH] make OPT_SUPPORT_JOKE a proper VM option https://bugs.ruby-lang.org/issues/10328#change-67958 * Author: normalperson (Eric Wong) * Status: Open * Priority: Normal * Assignee: normalperson (Eric Wong) * Target version: 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/ Unsubscribe: