diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-16 17:07:23 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-16 17:07:23 +0000 |
commit | db1e99cdad846fd2bab426ae0cc39c7321fae427 (patch) | |
tree | 8cd849251f7390b3bfbb0ddd23eda2e94d944f6d /vm_core.h | |
parent | aedc460fed41f3e77f8970b51b8027f633691337 (diff) | |
download | ruby-db1e99cdad846fd2bab426ae0cc39c7321fae427.tar.gz |
* vm_insnhelper.c (vm_getivar, vm_setivar): support index inline cache
with rb_call_info_t to speedup `attr' getter and setter.
Cached index is stored in rb_call_info_t::aux::index.
`index' == 0 means not cached. `index' > 0 means cached and cached
index is `index - 1'.
* insns.def ((get|set)instancevariable): use new wrapper functions
vm_(get|set)instancevariable() defined in vm_insnhelper.c.
* vm_core.h (rb_call_info_t::aux): introduce new union data because
opt_pc can share with index.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -160,9 +160,12 @@ typedef struct rb_call_info_struct { /* temporary values for method calling */ int argc; - int opt_pc; struct rb_block_struct *blockptr; VALUE recv; + union { + int opt_pc; /* used by iseq */ + long index; /* used by ivar */ + } aux; VALUE (*call)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_call_info_struct *ci); } rb_call_info_t; |