diff --git a/ChangeLog b/ChangeLog index 39210180826615..b2a8eaa66cdb33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Oct 31 23:44:35 2009 Yukihiro Matsumoto + + * enum.c (enum_count): remove optimization using #size. + revert r25560. + + * vm_eval.c (rb_funcall_no_recursive): remove method. + Sat Oct 31 23:28:49 2009 Yukihiro Matsumoto * vm_eval.c (check_funcall): logic updated according to diff --git a/enum.c b/enum.c index aa3a9b7af3c4d9..53e532fc3de3ee 100644 --- a/enum.c +++ b/enum.c @@ -119,8 +119,6 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv) return Qnil; } -extern VALUE rb_funcall_no_recursive(VALUE, ID, int, VALUE*, VALUE (*)()); - /* * call-seq: * enum.count => int @@ -151,10 +149,6 @@ enum_count(int argc, VALUE *argv, VALUE obj) func = count_iter_i; } else { - VALUE tmp; - - tmp = rb_funcall_no_recursive(obj, id_size, 0, 0, enum_count); - if (tmp != Qundef) return tmp; func = count_all_i; } } diff --git a/vm_eval.c b/vm_eval.c index f5b36e3d8ac464..b413c49d4371af 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -263,8 +263,9 @@ check_funcall_failed(struct rescue_funcall_args *args, VALUE e) } static VALUE -check_funcall(rb_method_entry_t *me, VALUE recv, ID mid, int argc, VALUE *argv) +check_funcall(VALUE recv, ID mid, int argc, VALUE *argv) { + rb_method_entry_t *me = rb_search_method_entry(recv, mid); rb_thread_t *th = GET_THREAD(); int call_status = rb_method_call_status(th, me, CALL_FCALL, Qundef); @@ -291,20 +292,7 @@ check_funcall(rb_method_entry_t *me, VALUE recv, ID mid, int argc, VALUE *argv) VALUE rb_check_funcall(VALUE recv, ID mid, int argc, VALUE *argv) { - return check_funcall(rb_search_method_entry(recv, mid), recv, mid, argc, argv); -} - -VALUE -rb_funcall_no_recursive(VALUE recv, ID mid, int argc, VALUE *argv, VALUE (*func)()) -{ - rb_method_entry_t *me = rb_search_method_entry(recv, mid); - int call_status; - - if (!me) return Qundef; - if (me->def && me->def->type == VM_METHOD_TYPE_CFUNC && - me->def->body.cfunc.func == func) - return Qundef; - return check_funcall(me, recv, mid, argc, argv); + return check_funcall(recv, mid, argc, argv); } static inline rb_method_entry_t *