diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-14 16:59:05 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-14 16:59:05 +0000 |
commit | cbd597e9bc05eac7249e91dcdb4f1c1c75a53cf5 (patch) | |
tree | 8f570f2e813466ef8fa0ac3f564a638b69164773 /vm_core.h | |
parent | e8c234577fa7061a22f0dc515aefdc8dbc61f3b5 (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 'vm_core.h')
-rw-r--r-- | vm_core.h | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -138,15 +138,31 @@ struct iseq_inline_cache_entry { } ic_value; }; +/* to avoid warning */ +struct rb_thread_struct; +struct rb_control_frame_struct; + /* rb_call_info_t contains calling information including inline cache */ typedef struct rb_call_info_struct { + /* fixed at compile time */ + ID mid; + VALUE flag; + int orig_argc; + rb_iseq_t *blockiseq; + /* inline cache: keys */ - VALUE ic_vmstat; - VALUE ic_class; + VALUE vmstat; + VALUE klass; /* inline cache: values */ - rb_method_entry_t *method; + const rb_method_entry_t *me; VALUE defined_class; + + /* temporary values for method calling */ + int argc; + struct rb_block_struct *blockptr; + VALUE recv; + VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci); } rb_call_info_t; #if 1 @@ -367,7 +383,7 @@ typedef struct rb_vm_struct { #define VM_DEBUG_BP_CHECK 1 #endif -typedef struct { +typedef struct rb_control_frame_struct { VALUE *pc; /* cfp[0] */ VALUE *sp; /* cfp[1] */ rb_iseq_t *iseq; /* cfp[2] */ @@ -640,6 +656,7 @@ enum vm_check_match_type { #define VM_CALL_TAILRECURSION_BIT (0x01 << 6) #define VM_CALL_SUPER_BIT (0x01 << 7) #define VM_CALL_OPT_SEND_BIT (0x01 << 8) +#define VM_CALL_ARGS_SKIP_SETUP (0x01 << 9) enum vm_special_object_type { VM_SPECIAL_OBJECT_VMCORE = 1, |