mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (clone_method): remove redundant check for me->def != NULL.
Now, all `me` have `me->def`. * proc.c (rb_method_entry_location): ditto. * vm.c (rb_vm_check_redefinition_opt_method): ditto. * vm.c (add_opt_method): ditto. * vm_eval.c (vm_call0_body): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ac1972c1a
commit
c3cc282f7f
5 changed files with 24 additions and 20 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Wed Jun 3 20:07:07 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* class.c (clone_method): remove redundant check for me->def != NULL.
|
||||
Now, all `me` have `me->def`.
|
||||
|
||||
* proc.c (rb_method_entry_location): ditto.
|
||||
|
||||
* vm.c (rb_vm_check_redefinition_opt_method): ditto.
|
||||
|
||||
* vm.c (add_opt_method): ditto.
|
||||
|
||||
* vm_eval.c (vm_call0_body): ditto.
|
||||
|
||||
Wed Jun 3 19:24:12 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_core.h: rename enum missing_reason to enum method_missing_reason.
|
||||
|
|
5
class.c
5
class.c
|
@ -243,7 +243,6 @@ rb_class_new(VALUE super)
|
|||
static void
|
||||
clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
|
||||
{
|
||||
if (me->def) {
|
||||
if (me->def->type == VM_METHOD_TYPE_ISEQ) {
|
||||
VALUE newiseqval;
|
||||
rb_cref_t *new_cref;
|
||||
|
@ -255,10 +254,6 @@ clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
|
|||
else {
|
||||
rb_method_entry_set(klass, mid, me, me->def->flags.visi);
|
||||
}
|
||||
}
|
||||
else {
|
||||
rb_bug("clone_method: unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
2
proc.c
2
proc.c
|
@ -2239,7 +2239,7 @@ method_def_location(const rb_method_definition_t *def)
|
|||
VALUE
|
||||
rb_method_entry_location(const rb_method_entry_t *me)
|
||||
{
|
||||
if (!me || !me->def) return Qnil;
|
||||
if (!me) return Qnil;
|
||||
return method_def_location(me->def);
|
||||
}
|
||||
|
||||
|
|
5
vm.c
5
vm.c
|
@ -1237,7 +1237,7 @@ static void
|
|||
rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me, VALUE klass)
|
||||
{
|
||||
st_data_t bop;
|
||||
if (!me->def || me->def->type == VM_METHOD_TYPE_CFUNC) {
|
||||
if (me->def->type == VM_METHOD_TYPE_CFUNC) {
|
||||
if (st_lookup(vm_opt_method_table, (st_data_t)me, &bop)) {
|
||||
int flag = vm_redefinition_check_flag(klass);
|
||||
|
||||
|
@ -1272,8 +1272,7 @@ add_opt_method(VALUE klass, ID mid, VALUE bop)
|
|||
{
|
||||
rb_method_entry_t *me = rb_method_entry_at(klass, mid);
|
||||
|
||||
if (me && me->def &&
|
||||
me->def->type == VM_METHOD_TYPE_CFUNC) {
|
||||
if (me && me->def->type == VM_METHOD_TYPE_CFUNC) {
|
||||
st_insert(vm_opt_method_table, (st_data_t)me, (st_data_t)bop);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -153,8 +153,6 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
|
|||
{
|
||||
VALUE ret;
|
||||
|
||||
if (!ci->me->def) return Qnil;
|
||||
|
||||
if (th->passed_block) {
|
||||
ci->blockptr = (rb_block_t *)th->passed_block;
|
||||
th->passed_block = 0;
|
||||
|
@ -213,7 +211,6 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
|
|||
goto success;
|
||||
}
|
||||
RUBY_VM_CHECK_INTS(th);
|
||||
if (!ci->me->def) return Qnil;
|
||||
goto again;
|
||||
}
|
||||
case VM_METHOD_TYPE_ALIAS:
|
||||
|
|
Loading…
Reference in a new issue