summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 08:03:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-21 08:03:58 +0000
commitf6e95240265ce9da8a8832125928bd9e31881124 (patch)
tree04235b968f7ee63574824ea637e8a1192767c95d /proc.c
parent1cc326a35117dcd8fdb22e7cce4430df2c24b57f (diff)
* 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
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c29
1 files changed, 15 insertions, 14 deletions
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;
}