From cbd597e9bc05eac7249e91dcdb4f1c1c75a53cf5 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 14 Oct 2012 16:59:05 +0000 Subject: * 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 --- vm_insnhelper.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'vm_insnhelper.h') diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 8b8da831a3..c6b2fbefdb 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -189,8 +189,8 @@ enum vm_regan_acttype { } \ } while (0) -#define CALL_METHOD(num, blockptr, flag, id, me, recv, defined_class) do { \ - VALUE v = vm_call_method(th, GET_CFP(), (num), (blockptr), (flag), (id), (me), (recv), (defined_class)); \ +#define CALL_METHOD(ci) do { \ + VALUE v = (*(ci)->call)(th, GET_CFP(), (ci)); \ if (v == Qundef) { \ RESTORE_REGS(); \ NEXT_INSN(); \ @@ -235,23 +235,12 @@ enum vm_regan_acttype { #define USE_IC_FOR_SPECIALIZED_METHOD 1 #endif -#if USE_IC_FOR_SPECIALIZED_METHOD - -#define CALL_SIMPLE_METHOD(num, id, recv) do { \ - VALUE klass = CLASS_OF(recv), defined_class; \ - const rb_method_entry_t *me = vm_method_search((id), klass, ci, &defined_class); \ - CALL_METHOD((num), 0, 0, (id), me, (recv), defined_class); \ +#define CALL_SIMPLE_METHOD(recv) do { \ + ci->blockptr = 0; ci->argc = ci->orig_argc; \ + vm_search_method(ci, ci->recv = (recv)); \ + CALL_METHOD(ci); \ } while (0) -#else - -#define CALL_SIMPLE_METHOD(num, id, recv) do { \ - VALUE klass = CLASS_OF(recv); \ - CALL_METHOD((num), 0, 0, (id), rb_method_entry(klass, (id)), (recv)); \ -} while (0) - -#endif - static VALUE ruby_vm_global_state_version = 1; #define GET_VM_STATE_VERSION() (ruby_vm_global_state_version) -- cgit v1.2.3