summaryrefslogtreecommitdiff
path: root/tool/instruction.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-14 16:59:05 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-14 16:59:05 +0000
commitcbd597e9bc05eac7249e91dcdb4f1c1c75a53cf5 (patch)
tree8f570f2e813466ef8fa0ac3f564a638b69164773 /tool/instruction.rb
parente8c234577fa7061a22f0dc515aefdc8dbc61f3b5 (diff)
* insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:
use only a `ci' (rb_call_info_t) parameter instead of using parameters such as `op_id', 'op_argc', `blockiseq' and flag. These information are stored in rb_call_info_t at the compile time. This technique simplifies parameter passings at related function calls (~10% speedups for simple mehtod invocation at my machine). `rb_call_info_t' also has new function pointer variable `call'. This `call' variable enables to customize method (block) invocation process for each place. However, it always call `vm_call_general()' at this changes. `rb_call_info_t' also has temporary variables for method (block) invocation. * vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP VM_CALL macro. This flag indicates that this call can skip caller_setup (block arg and splat arg). * compile.c: catch up above changes. * iseq.c: catch up above changes (especially for TS_CALLINFO). * tool/instruction.rb: catch up above chagnes. * vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions parameters are changed. * vm_eval.c (vm_call0): ditto (it will be rewriten soon). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/instruction.rb')
-rwxr-xr-xtool/instruction.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/instruction.rb b/tool/instruction.rb
index 6934b33e80..c6e0c40c0c 100755
--- a/tool/instruction.rb
+++ b/tool/instruction.rb
@@ -66,11 +66,15 @@ class RubyVM
ret = "int inc = 0;\n"
@opes.each_with_index{|(t, v), i|
- if t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc ||
- @defopes.any?{|t, val| re =~ val})
+ if (t == 'rb_num_t' && ((re = /\b#{v}\b/n) =~ @sp_inc)) ||
+ (@defopes.any?{|t, val| re =~ val})
ret << " int #{v} = FIX2INT(opes[#{i}]);\n"
+ elsif (t == 'CALL_INFO' && ((re = /\b#{v}\b/n) =~ @sp_inc))
+ ret << " CALL_INFO #{v} = (CALL_INFO)(opes[#{i}]);\n"
end
+
}
+
@defopes.each_with_index{|((t, var), val), i|
if t == 'rb_num_t' && val != '*' && /\b#{var}\b/ =~ @sp_inc
ret << " #{t} #{var} = #{val};\n"