* insns.def, iseq.c, vm_insnhelper.c: rename variable name

(ip -> iseq).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2010-10-14 13:19:30 +00:00
parent 5825359dd8
commit 559fd3e439
4 changed files with 26 additions and 21 deletions

View File

@ -1,3 +1,8 @@
Thu Oct 14 22:18:29 2010 Koichi Sasada <ko1@atdot.net>
* insns.def, iseq.c, vm_insnhelper.c: rename variable name
(ip -> iseq).
Thu Oct 14 20:41:27 2010 NARUSE, Yui <naruse@ruby-lang.org> Thu Oct 14 20:41:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
* pack.c (pack_pack): support endian modifiers: < and >. * pack.c (pack_pack): support endian modifiers: < and >.

View File

@ -816,16 +816,16 @@ defined
} }
break; break;
case DEFINED_ZSUPER:{ case DEFINED_ZSUPER:{
rb_iseq_t *ip = GET_ISEQ(); rb_iseq_t *iseq = GET_ISEQ();
while (ip) { while (iseq) {
if (ip->defined_method_id) { if (iseq->defined_method_id) {
break; break;
} }
ip = ip->parent_iseq; iseq = iseq->parent_iseq;
} }
if (ip) { if (iseq) {
VALUE klass = vm_search_normal_superclass(ip->klass, GET_SELF()); VALUE klass = vm_search_normal_superclass(iseq->klass, GET_SELF());
if (rb_method_boundp(klass, ip->defined_method_id, 0)) { if (rb_method_boundp(klass, iseq->defined_method_id, 0)) {
expr_type = "super"; expr_type = "super";
} }
} }

12
iseq.c
View File

@ -748,9 +748,9 @@ insn_operand_intern(rb_iseq_t *iseq,
case TS_LINDEX: case TS_LINDEX:
{ {
rb_iseq_t *ip = iseq->local_iseq; rb_iseq_t *liseq = iseq->local_iseq;
int lidx = ip->local_size - (int)op; int lidx = liseq->local_size - (int)op;
const char *name = rb_id2name(ip->local_table[lidx]); const char *name = rb_id2name(liseq->local_table[lidx]);
if (name) { if (name) {
ret = rb_str_new2(name); ret = rb_str_new2(name);
@ -762,13 +762,13 @@ insn_operand_intern(rb_iseq_t *iseq,
} }
case TS_DINDEX:{ case TS_DINDEX:{
if (insn == BIN(getdynamic) || insn == BIN(setdynamic)) { if (insn == BIN(getdynamic) || insn == BIN(setdynamic)) {
rb_iseq_t *ip = iseq; rb_iseq_t *diseq = iseq;
VALUE level = *pnop, i; VALUE level = *pnop, i;
const char *name; const char *name;
for (i = 0; i < level; i++) { for (i = 0; i < level; i++) {
ip = ip->parent_iseq; diseq = diseq->parent_iseq;
} }
name = rb_id2name(ip->local_table[ip->local_size - op]); name = rb_id2name(diseq->local_table[diseq->local_size - op]);
if (!name) { if (!name) {
name = "*"; name = "*";

View File

@ -1375,24 +1375,24 @@ vm_search_normal_superclass(VALUE klass, VALUE recv)
} }
static void static void
vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip, vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *iseq,
VALUE recv, VALUE sigval, VALUE recv, VALUE sigval,
ID *idp, VALUE *klassp) ID *idp, VALUE *klassp)
{ {
ID id; ID id;
VALUE klass; VALUE klass;
while (ip && !ip->klass) { while (iseq && !iseq->klass) {
ip = ip->parent_iseq; iseq = iseq->parent_iseq;
} }
if (ip == 0) { if (iseq == 0) {
rb_raise(rb_eNoMethodError, "super called outside of method"); rb_raise(rb_eNoMethodError, "super called outside of method");
} }
id = ip->defined_method_id; id = iseq->defined_method_id;
if (ip != ip->local_iseq) { if (iseq != iseq->local_iseq) {
/* defined by Module#define_method() */ /* defined by Module#define_method() */
rb_control_frame_t *lcfp = GET_CFP(); rb_control_frame_t *lcfp = GET_CFP();
@ -1401,7 +1401,7 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip,
rb_raise(rb_eRuntimeError, "implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly."); rb_raise(rb_eRuntimeError, "implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly.");
} }
while (lcfp->iseq != ip) { while (lcfp->iseq != iseq) {
VALUE *tdfp = GET_PREV_DFP(lcfp->dfp); VALUE *tdfp = GET_PREV_DFP(lcfp->dfp);
while (1) { while (1) {
lcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(lcfp); lcfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(lcfp);
@ -1420,7 +1420,7 @@ vm_search_superclass(rb_control_frame_t *reg_cfp, rb_iseq_t *ip,
klass = vm_search_normal_superclass(lcfp->me->klass, recv); klass = vm_search_normal_superclass(lcfp->me->klass, recv);
} }
else { else {
klass = vm_search_normal_superclass(ip->klass, recv); klass = vm_search_normal_superclass(iseq->klass, recv);
} }
*idp = id; *idp = id;