From d5ec9ec308dccaeea2a723e070a98df4159183de Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 19 Sep 2015 17:59:58 +0000 Subject: * vm_core.h: split rb_call_info_t into several structs. * rb_call_info (ci) has compiled fixed information. * if ci->flag & VM_CALL_KWARG, then rb_call_info is also rb_call_info_with_kwarg. This technique reduce one word for major rb_call_info data. * rb_calling_info has temporary data (argc, blockptr, recv). for each method dispatch. This data is allocated only on machine stack. * rb_call_cache is for inline method cache. Before this patch, only rb_call_info_t data is passed. After this patch, above three structs are passed. This patch improves: * data locarity (rb_call_info is now read-only data). * reduce memory consumption (rb_call_info_with_kwarg, rb_calling_info). * compile.c: use above data. * insns.def: ditto. * iseq.c: ditto. * vm_args.c: ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_insnhelper.h: ditto. * iseq.h: add iseq_compile_data::ci_index and iseq_compile_data::ci_kw_indx. * tool/instruction.rb: introduce TS_CALLCACHE operand type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/instruction.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tool/instruction.rb') diff --git a/tool/instruction.rb b/tool/instruction.rb index 16d97f50dd..4f7d08c369 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -715,7 +715,7 @@ class RubyVM # skip make operands when body has no reference to this operand # TODO: really needed? re = /\b#{var}\b/n - if re =~ insn.body or re =~ insn.sp_inc or insn.rets.any?{|t, v| re =~ v} or re =~ 'ic' or re =~ 'ci' + if re =~ insn.body or re =~ insn.sp_inc or insn.rets.any?{|t, v| re =~ v} or re =~ 'ic' or re =~ 'ci' or re =~ 'cc' ops << " #{type} #{var} = (#{type})GET_OPERAND(#{i+1});" end @@ -949,6 +949,8 @@ class RubyVM "TS_IC" when /^CALL_INFO/ "TS_CALLINFO" + when /^CALL_CACHE/ + "TS_CALLCACHE" when /^\.\.\./ "TS_VARIABLE" when /^CDHASH/ @@ -971,6 +973,7 @@ class RubyVM 'TS_GENTRY' => 'G', 'TS_IC' => 'K', 'TS_CALLINFO' => 'C', + 'TS_CALLCACHE' => 'E', 'TS_CDHASH' => 'H', 'TS_ISEQ' => 'S', 'TS_VARIABLE' => '.', -- cgit v1.2.3