зеркало из https://github.com/github/ruby.git
vm_insnhelper.c: getivar setivar optimization
* vm_insnhelper.c (vm_getivar, vm_setivar): remove inline. * vm_insnhelper.c (vm_call_ivar, vm_call_attrset): tweak the order tail-call-optimization friendly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
12ef609f5e
Коммит
8c3d9d99d6
|
@ -774,7 +774,7 @@ vm_search_const_defined_class(const VALUE cbase, ID id)
|
|||
#define USE_IC_FOR_IVAR 1
|
||||
#endif
|
||||
|
||||
static inline VALUE
|
||||
static VALUE
|
||||
vm_getivar(VALUE obj, ID id, IC ic, struct rb_call_cache *cc, int is_attr)
|
||||
{
|
||||
#if USE_IC_FOR_IVAR
|
||||
|
@ -824,7 +824,7 @@ vm_getivar(VALUE obj, ID id, IC ic, struct rb_call_cache *cc, int is_attr)
|
|||
return rb_ivar_get(obj, id);
|
||||
}
|
||||
|
||||
static inline VALUE
|
||||
static VALUE
|
||||
vm_setivar(VALUE obj, ID id, VALUE val, IC ic, struct rb_call_cache *cc, int is_attr)
|
||||
{
|
||||
#if USE_IC_FOR_IVAR
|
||||
|
@ -1733,17 +1733,16 @@ vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling_in
|
|||
static VALUE
|
||||
vm_call_ivar(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
|
||||
{
|
||||
VALUE val = vm_getivar(calling->recv, cc->me->def->body.attr.id, NULL, cc, 1);
|
||||
cfp->sp -= 1;
|
||||
return val;
|
||||
return vm_getivar(calling->recv, cc->me->def->body.attr.id, NULL, cc, 1);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
vm_call_attrset(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
|
||||
{
|
||||
VALUE val = vm_setivar(calling->recv, cc->me->def->body.attr.id, *(cfp->sp - 1), NULL, cc, 1);
|
||||
VALUE val = *(cfp->sp - 1);
|
||||
cfp->sp -= 2;
|
||||
return val;
|
||||
return vm_setivar(calling->recv, cc->me->def->body.attr.id, val, NULL, cc, 1);
|
||||
}
|
||||
|
||||
static inline VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче