ruby-changes:38509
From: ko1 <ko1@a...>
Date: Thu, 21 May 2015 17:04:03 +0900 (JST)
Subject: [ruby-changes:38509] ko1:r50590 (trunk): * proc.c: rename functions.
ko1 2015-05-21 17:03:58 +0900 (Thu, 21 May 2015) New Revision: 50590 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50590 Log: * proc.c: rename functions. * method_get_def() -> method_def() * method_get_iseq() -> method_def_iseq() * method_get_cref() -> method_cref() Modified files: trunk/ChangeLog trunk/proc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50589) +++ ChangeLog (revision 50590) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu May 21 17:02:43 2015 Koichi Sasada <ko1@a...> + + * proc.c: rename functions. + * method_get_def() -> method_def() + * method_get_iseq() -> method_def_iseq() + * method_get_cref() -> method_cref() + Thu May 21 16:52:44 2015 Koichi Sasada <ko1@a...> * proc.c (rb_method_get_iseq): rename to rb_method_iseq. Index: proc.c =================================================================== --- proc.c (revision 50589) +++ proc.c (revision 50590) @@ -2182,7 +2182,7 @@ rb_obj_method_arity(VALUE obj, ID id) https://github.com/ruby/ruby/blob/trunk/proc.c#L2182 } static inline rb_method_definition_t * -method_get_def(VALUE method) +method_def(VALUE method) { struct METHOD *data; @@ -2191,7 +2191,7 @@ method_get_def(VALUE method) https://github.com/ruby/ruby/blob/trunk/proc.c#L2191 } static rb_iseq_t * -method_get_iseq(rb_method_definition_t *def) +method_def_iseq(rb_method_definition_t *def) { switch (def->type) { case VM_METHOD_TYPE_BMETHOD: @@ -2203,9 +2203,17 @@ method_get_iseq(rb_method_definition_t * https://github.com/ruby/ruby/blob/trunk/proc.c#L2203 } } +rb_iseq_t * +rb_method_iseq(VALUE method) +{ + return method_def_iseq(method_def(method)); +} + static const rb_cref_t * -method_get_cref(rb_method_definition_t *def) +method_cref(VALUE method) { + rb_method_definition_t *def = method_def(method); + switch (def->type) { case VM_METHOD_TYPE_ISEQ: return def->body.iseq_body.cref; @@ -2214,13 +2222,6 @@ method_get_cref(rb_method_definition_t * https://github.com/ruby/ruby/blob/trunk/proc.c#L2222 } } - -rb_iseq_t * -rb_method_iseq(VALUE method) -{ - return method_get_iseq(method_get_def(method)); -} - static VALUE method_def_location(rb_method_definition_t *def) { @@ -2229,7 +2230,7 @@ method_def_location(rb_method_definition https://github.com/ruby/ruby/blob/trunk/proc.c#L2230 return Qnil; return rb_ary_dup(def->body.attr.location); } - return iseq_location(method_get_iseq(def)); + return iseq_location(method_def_iseq(def)); } VALUE @@ -2263,7 +2264,7 @@ rb_obj_method_location(VALUE obj, ID id) https://github.com/ruby/ruby/blob/trunk/proc.c#L2264 VALUE rb_method_location(VALUE method) { - rb_method_definition_t *def = method_get_def(method); + rb_method_definition_t *def = method_def(method); return method_def_location(def); } @@ -2422,8 +2423,8 @@ method_to_proc(VALUE method) https://github.com/ruby/ruby/blob/trunk/proc.c#L2423 GetEnvPtr(proc->envval, env); env->block.self = meth->recv; env->block.klass = meth->defined_class; - env->block.iseq = method_get_iseq(meth->me->def); - env->block.ep[-1] = (VALUE)method_get_cref(meth->me->def); + env->block.iseq = method_def_iseq(meth->me->def); + env->block.ep[-1] = (VALUE)method_cref(method); return procval; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/