summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 19:12:26 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 19:12:26 +0000
commit4e870d302b94d90513534ea68416df36dbe3ce61 (patch)
treeff9b127e359c1e296e6660419b53edc6ea950029
parent4ab762de21ecf321cf88b8f17750f6f4ea9ebf3f (diff)
* 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
-rw-r--r--ChangeLog9
-rw-r--r--class.c2
-rw-r--r--vm_core.h2
-rw-r--r--vm_insnhelper.c26
4 files changed, 24 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 29c120c..70e5794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
diff --git a/class.c b/class.c
index da41d85..d711f94 100644
--- a/class.c
+++ b/class.c
@@ -247,7 +247,7 @@ clone_method(VALUE klass, ID mid, const rb_method_entry_t *me)
VALUE newiseqval;
rb_cref_t *new_cref;
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_GC_GUARD(newiseqval);
}
diff --git a/vm_core.h b/vm_core.h
index ff2b8a9..c18611e 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1005,7 +1005,7 @@ void rb_gc_mark_machine_stack(rb_thread_t *th);
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);
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b5963ed..3482f96 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -465,23 +465,23 @@ rb_vm_get_cref(const VALUE *ep)
}
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) {
- if (CREF_CLASS(node) == old_klass) {
- new_node = vm_cref_new(new_klass, 0, NULL);
- COPY_CREF_OMOD(new_node, node);
- CREF_NEXT_SET(new_node, CREF_NEXT(node));
- *new_cref_ptr = new_node;
+ while (cref) {
+ if (CREF_CLASS(cref) == old_klass) {
+ new_cref = vm_cref_new(new_klass, 0, NULL);
+ COPY_CREF_OMOD(new_cref, cref);
+ CREF_NEXT_SET(new_cref, CREF_NEXT(cref));
+ *new_cref_ptr = new_cref;
return;
}
- new_node = vm_cref_new(CREF_CLASS(node), 0, NULL);
- COPY_CREF_OMOD(new_node, node);
- node = CREF_NEXT(node);
- *new_cref_ptr = new_node;
- new_cref_ptr = (rb_cref_t **)&new_node->next;
+ new_cref = vm_cref_new(CREF_CLASS(cref), 0, NULL);
+ COPY_CREF_OMOD(new_cref, cref);
+ cref = CREF_NEXT(cref);
+ *new_cref_ptr = new_cref;
+ new_cref_ptr = (rb_cref_t **)&new_cref->next;
}
*new_cref_ptr = NULL;
}