ruby-changes:47521
From: nobu <ko1@a...>
Date: Tue, 22 Aug 2017 13:37:14 +0900 (JST)
Subject: [ruby-changes:47521] nobu:r59637 (trunk): pack insns_name_info
nobu 2017-08-22 13:37:08 +0900 (Tue, 22 Aug 2017) New Revision: 59637 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59637 Log: pack insns_name_info Modified files: trunk/template/insns_info.inc.tmpl Index: template/insns_info.inc.tmpl =================================================================== --- template/insns_info.inc.tmpl (revision 59636) +++ template/insns_info.inc.tmpl (revision 59637) @@ -13,13 +13,22 @@ https://github.com/ruby/ruby/blob/trunk/template/insns_info.inc.tmpl#L13 #define <%=t%> '<%=c%>' % end -static const char *const insn_name_info[] = { -% @insns.each do |insn| - "<%= insn.name %>", +static const unsigned short insn_name_info_offset[] = { +% insn_name_length = @insns.inject(0) do |ofs, insn| + <%= ofs %>, +% ofs + insn.name.size + 1 % end }; -ASSERT_VM_INSTRUCTION_SIZE(insn_name_info); +ASSERT_VM_INSTRUCTION_SIZE(insn_name_info_offset); + +static const char insn_name_info_base[<%=insn_name_length%>] = "" +% @insns.each do |insn| + "<%= insn.name %>\0" +% end +; + +#define insn_name_info insn_name_info_base+insn_name_info_offset static const char *const insn_operand_info[] = { % @insns.each do |insn| @@ -38,7 +47,7 @@ static const int insn_len_info[] = { https://github.com/ruby/ruby/blob/trunk/template/insns_info.inc.tmpl#L47 ASSERT_VM_INSTRUCTION_SIZE(insn_len_info); #ifdef USE_INSN_RET_NUM -static const int insn_stack_push_num_info[] = { +static const unsigned short insn_stack_push_num_info[] = { % @insns.each do |insn| <%= insn.rets.size %>, % end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/