1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm.c (rb_vm_control_frame_id_and_class): remove usless codes.

`me' knows ID and owner class.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-06-18 09:01:00 +00:00
parent f74fdd72f3
commit 58ba24f885
2 changed files with 9 additions and 19 deletions

View file

@ -1,3 +1,8 @@
Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net>
* vm.c (rb_vm_control_frame_id_and_class): remove usless codes.
`me' knows ID and owner class.
Thu Jun 18 16:58:35 2015 Koichi Sasada <ko1@atdot.net>
* method.h: constify rb_method_alias_struct::original_me and

23
vm.c
View file

@ -1738,31 +1738,16 @@ rb_iseq_eval_main(VALUE iseqval)
int
rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, VALUE *klassp)
{
rb_iseq_t *iseq = cfp->iseq;
const rb_method_entry_t *me = rb_vm_frame_method_entry(cfp);
if (!iseq && me) { /* TODO: me should know all */
if (me) {
if (idp) *idp = me->def->original_id;
if (klassp) *klassp = me->klass;
return 1;
return TRUE;
}
while (iseq) {
if (RUBY_VM_IFUNC_P(iseq)) {
if (idp) *idp = idIFUNC;
if (klassp) *klassp = 0;
return 1;
}
if (iseq->defined_method_id) {
if (idp) *idp = iseq->defined_method_id;
if (klassp) *klassp = iseq->klass;
return 1;
}
if (iseq->local_iseq == iseq) {
break;
}
iseq = iseq->parent_iseq;
else {
return FALSE;
}
return 0;
}
int