* enum.c (enum_count): remove optimization using #size.
revert r25560. * vm_eval.c (rb_funcall_no_recursive): remove method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2097f56d32
commit
c0a0aa0c47
@ -1,3 +1,10 @@
|
|||||||
|
Sat Oct 31 23:44:35 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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 <matz@ruby-lang.org>
|
Sat Oct 31 23:28:49 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* vm_eval.c (check_funcall): logic updated according to
|
* vm_eval.c (check_funcall): logic updated according to
|
||||||
|
6
enum.c
6
enum.c
@ -119,8 +119,6 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
|
|||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern VALUE rb_funcall_no_recursive(VALUE, ID, int, VALUE*, VALUE (*)());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* enum.count => int
|
* enum.count => int
|
||||||
@ -151,10 +149,6 @@ enum_count(int argc, VALUE *argv, VALUE obj)
|
|||||||
func = count_iter_i;
|
func = count_iter_i;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VALUE tmp;
|
|
||||||
|
|
||||||
tmp = rb_funcall_no_recursive(obj, id_size, 0, 0, enum_count);
|
|
||||||
if (tmp != Qundef) return tmp;
|
|
||||||
func = count_all_i;
|
func = count_all_i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
vm_eval.c
18
vm_eval.c
@ -263,8 +263,9 @@ check_funcall_failed(struct rescue_funcall_args *args, VALUE e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
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();
|
rb_thread_t *th = GET_THREAD();
|
||||||
int call_status = rb_method_call_status(th, me, CALL_FCALL, Qundef);
|
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
|
VALUE
|
||||||
rb_check_funcall(VALUE recv, ID mid, int argc, VALUE *argv)
|
rb_check_funcall(VALUE recv, ID mid, int argc, VALUE *argv)
|
||||||
{
|
{
|
||||||
return check_funcall(rb_search_method_entry(recv, mid), recv, mid, argc, argv);
|
return check_funcall(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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline rb_method_entry_t *
|
static inline rb_method_entry_t *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user