зеркало из https://github.com/github/ruby.git
* vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
* class.c (clone_method): use renamed name. * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4ab762de21
Коммит
4e870d302b
|
@ -1,3 +1,12 @@
|
||||||
|
Thu Jun 4 04:10:43 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
|
||||||
|
|
||||||
|
* class.c (clone_method): use renamed name.
|
||||||
|
|
||||||
|
* vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable
|
||||||
|
names.
|
||||||
|
|
||||||
Wed Jun 3 23:03:50 2015 Koichi Sasada <ko1@atdot.net>
|
Wed Jun 3 23:03:50 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
|
* vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
|
||||||
|
|
2
class.c
2
class.c
|
@ -247,7 +247,7 @@ clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
|
||||||
VALUE newiseqval;
|
VALUE newiseqval;
|
||||||
rb_cref_t *new_cref;
|
rb_cref_t *new_cref;
|
||||||
newiseqval = rb_iseq_clone(me->def->body.iseq.iseqptr->self, klass);
|
newiseqval = rb_iseq_clone(me->def->body.iseq.iseqptr->self, klass);
|
||||||
rb_vm_rewrite_cref_stack(me->def->body.iseq.cref, me->klass, klass, &new_cref);
|
rb_vm_rewrite_cref(me->def->body.iseq.cref, me->klass, klass, &new_cref);
|
||||||
rb_add_method_iseq(klass, mid, newiseqval, new_cref, me->def->flags.visi);
|
rb_add_method_iseq(klass, mid, newiseqval, new_cref, me->def->flags.visi);
|
||||||
RB_GC_GUARD(newiseqval);
|
RB_GC_GUARD(newiseqval);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1005,7 +1005,7 @@ void rb_gc_mark_machine_stack(rb_thread_t *th);
|
||||||
|
|
||||||
int rb_autoloading_value(VALUE mod, ID id, VALUE* value);
|
int rb_autoloading_value(VALUE mod, ID id, VALUE* value);
|
||||||
|
|
||||||
void rb_vm_rewrite_cref_stack(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr);
|
void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr);
|
||||||
|
|
||||||
const rb_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
|
const rb_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
|
||||||
|
|
||||||
|
|
|
@ -465,23 +465,23 @@ rb_vm_get_cref(const VALUE *ep)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_vm_rewrite_cref_stack(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
|
rb_vm_rewrite_cref(rb_cref_t *cref, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
|
||||||
{
|
{
|
||||||
rb_cref_t *new_node;
|
rb_cref_t *new_cref;
|
||||||
|
|
||||||
while (node) {
|
while (cref) {
|
||||||
if (CREF_CLASS(node) == old_klass) {
|
if (CREF_CLASS(cref) == old_klass) {
|
||||||
new_node = vm_cref_new(new_klass, 0, NULL);
|
new_cref = vm_cref_new(new_klass, 0, NULL);
|
||||||
COPY_CREF_OMOD(new_node, node);
|
COPY_CREF_OMOD(new_cref, cref);
|
||||||
CREF_NEXT_SET(new_node, CREF_NEXT(node));
|
CREF_NEXT_SET(new_cref, CREF_NEXT(cref));
|
||||||
*new_cref_ptr = new_node;
|
*new_cref_ptr = new_cref;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new_node = vm_cref_new(CREF_CLASS(node), 0, NULL);
|
new_cref = vm_cref_new(CREF_CLASS(cref), 0, NULL);
|
||||||
COPY_CREF_OMOD(new_node, node);
|
COPY_CREF_OMOD(new_cref, cref);
|
||||||
node = CREF_NEXT(node);
|
cref = CREF_NEXT(cref);
|
||||||
*new_cref_ptr = new_node;
|
*new_cref_ptr = new_cref;
|
||||||
new_cref_ptr = (rb_cref_t **)&new_node->next;
|
new_cref_ptr = (rb_cref_t **)&new_cref->next;
|
||||||
}
|
}
|
||||||
*new_cref_ptr = NULL;
|
*new_cref_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче