mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
1cc326a351
commit
f6e9524026
2 changed files with 23 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
Thu May 21 17:02:43 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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@atdot.net>
|
||||
|
||||
* proc.c (rb_method_get_iseq): rename to rb_method_iseq.
|
||||
|
|
31
proc.c
31
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)
|
|||
}
|
||||
}
|
||||
|
||||
static const rb_cref_t *
|
||||
method_get_cref(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_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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue