summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-22 04:37:08 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-22 04:37:08 (GMT)
commita4d650274d45f20ffae19bd60244a1ccc797fc5a (patch)
tree1be67d3cdf66195c89fa6cf97a5affe78993d2e1 /template
parent7735c1f5fe4eabd97fe63d7113fc12fc25c877b7 (diff)
pack insns_name_info
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/insns_info.inc.tmpl19
1 files changed, 14 insertions, 5 deletions
diff --git a/template/insns_info.inc.tmpl b/template/insns_info.inc.tmpl
index ffbe518..6da1a98 100644
--- a/template/insns_info.inc.tmpl
+++ b/template/insns_info.inc.tmpl
@@ -13,13 +13,22 @@
#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[] = {
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