aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 21:34:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 21:34:24 +0000
commit0018a71184edbc4b46bbfd2b3a56e4a5a585d4f3 (patch)
tree135ec18c0de6c6af48b98ff5132ac8f26eb1cc77 /proc.c
parent9b77261a123ddd48b960a397f80b40b99d9f62b2 (diff)
downloadruby-0018a71184edbc4b46bbfd2b3a56e4a5a585d4f3.tar.gz
* proc.c: enable optimization of Proc#call.
[Feature #11569] * NEWS: write about this optimization and incompatibilities. * test/ruby/test_backtrace.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/proc.c b/proc.c
index 6370904109..b84a4fc9d9 100644
--- a/proc.c
+++ b/proc.c
@@ -733,7 +733,7 @@ rb_block_clear_env_self(VALUE proc)
* from prog.rb:5:in `<main>'
*
*/
-
+#if 0
static VALUE
proc_call(int argc, VALUE *argv, VALUE procval)
{
@@ -759,6 +759,7 @@ proc_call(int argc, VALUE *argv, VALUE procval)
RB_GC_GUARD(passed_procval);
return vret;
}
+#endif
#if SIZEOF_LONG > SIZEOF_INT
static inline int
@@ -2803,7 +2804,6 @@ Init_Proc(void)
rb_undef_alloc_func(rb_cProc);
rb_define_singleton_method(rb_cProc, "new", rb_proc_s_new, -1);
-#if 0 /* incomplete. */
rb_add_method(rb_cProc, rb_intern("call"), VM_METHOD_TYPE_OPTIMIZED,
(void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
rb_add_method(rb_cProc, rb_intern("[]"), VM_METHOD_TYPE_OPTIMIZED,
@@ -2812,12 +2812,7 @@ Init_Proc(void)
(void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
rb_add_method(rb_cProc, rb_intern("yield"), VM_METHOD_TYPE_OPTIMIZED,
(void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
-#else
- rb_define_method(rb_cProc, "call", proc_call, -1);
- rb_define_method(rb_cProc, "[]", proc_call, -1);
- rb_define_method(rb_cProc, "===", proc_call, -1);
- rb_define_method(rb_cProc, "yield", proc_call, -1);
-#endif
+
rb_define_method(rb_cProc, "to_proc", proc_to_proc, 0);
rb_define_method(rb_cProc, "arity", proc_arity, 0);
rb_define_method(rb_cProc, "clone", proc_clone, 0);