From f6e95240265ce9da8a8832125928bd9e31881124 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 21 May 2015 08:03:58 +0000 Subject: * proc.c: rename functions. * method_get_def() -> method_def() * method_get_iseq() -> method_def_iseq() * method_get_cref() -> method_cref() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ proc.c | 29 +++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43c0d11b6c..c2516c725f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu May 21 17:02:43 2015 Koichi Sasada + + * 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 * proc.c (rb_method_get_iseq): rename to rb_method_iseq. diff --git a/proc.c b/proc.c index b1a5bb03e5..1e103df8fe 100644 --- a/proc.c +++ b/proc.c @@ -2182,7 +2182,7 @@ rb_obj_method_arity(VALUE obj, ID id) } 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) } 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 *def) } } +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 *def) } } - -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_t *def) 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) 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) 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; } -- cgit v1.2.3