ruby-changes:38869
From: ko1 <ko1@a...>
Date: Thu, 18 Jun 2015 18:01:27 +0900 (JST)
Subject: [ruby-changes:38869] ko1:r50950 (trunk): * vm.c (rb_vm_control_frame_id_and_class): remove usless codes.
ko1 2015-06-18 18:01:00 +0900 (Thu, 18 Jun 2015) New Revision: 50950 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50950 Log: * vm.c (rb_vm_control_frame_id_and_class): remove usless codes. `me' knows ID and owner class. Modified files: trunk/ChangeLog trunk/vm.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50949) +++ ChangeLog (revision 50950) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@a...> + + * 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@a...> * method.h: constify rb_method_alias_struct::original_me and Index: vm.c =================================================================== --- vm.c (revision 50949) +++ vm.c (revision 50950) @@ -1738,31 +1738,16 @@ rb_iseq_eval_main(VALUE iseqval) https://github.com/ruby/ruby/blob/trunk/vm.c#L1738 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/