From 971f965da9a9f8f7cea9bead6c883e79dfc5b715 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Thu, 31 Jan 2019 05:00:41 +0000 Subject: _insn_len_info.erb: add ASSERT_VM_INSTRUCTION_SIZE Also previous rb_vm_insn_len_info is now a function static variable. It seems nobody else is using it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/views/_insn_len_info.erb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'tool/ruby_vm') diff --git a/tool/ruby_vm/views/_insn_len_info.erb b/tool/ruby_vm/views/_insn_len_info.erb index cc5889646d..b292f42fb5 100644 --- a/tool/ruby_vm/views/_insn_len_info.erb +++ b/tool/ruby_vm/views/_insn_len_info.erb @@ -6,18 +6,16 @@ %# conditions mentioned in the file COPYING are met. Consult the file for %# details. CONSTFUNC(MAYBE_UNUSED(static int insn_len(VALUE insn))); -extern const char rb_vm_insn_len_info[]; - -#ifdef RUBY_VM_INSNS_INFO -const char rb_vm_insn_len_info[] = { -% RubyVM::Instructions.each_slice 25 do |a| - <%= a.map(&:width).join(', ') -%>, -% end -}; -#endif int insn_len(VALUE i) { - return rb_vm_insn_len_info[i]; + static const char t[] = { +% RubyVM::Instructions.each_slice 23 do |a| + <%= a.map(&:width).join(', ') -%>, +% end + }; + + ASSERT_VM_INSTRUCTION_SIZE(t); + return t[i]; } -- cgit v1.2.3