* src/vm/jit/stack.c, src/vm/jit/verify/typecheck-common.c,
authoredwin <none@none>
Tue, 17 Apr 2007 20:53:41 +0000 (20:53 +0000)
committeredwin <none@none>
Tue, 17 Apr 2007 20:53:41 +0000 (20:53 +0000)
src/vm/jit/verify/typeinfo.c, src/vm/jit/inline/inline.c,
src/vm/jit/allocator/simplereg.c: Clarification: Renamed variables
that are indices into jd->var to "varindex". Renamed variables that
are bytecode variable indices to "javaindex".

src/vm/jit/allocator/simplereg.c
src/vm/jit/inline/inline.c
src/vm/jit/stack.c
src/vm/jit/verify/typecheck-common.c
src/vm/jit/verify/typeinfo.c

index 3a480b0609039ba9a2005a3abe2bcdaaae7f681c..869213129a5d41e58e3b8bfe65ef27282d1daf58 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.
 
-   $Id: simplereg.c 7713 2007-04-15 21:49:48Z twisti $
+   $Id: simplereg.c 7743 2007-04-17 20:53:41Z edwin $
 
 */
 
@@ -564,7 +564,7 @@ static void simplereg_allocate_locals_leafmethod(jitdata *jd)
        registerdata *rd;
        methoddesc *md;
 
-       int     p, s, t, tt, lm;
+       int     p, s, t, tt, varindex;
        int     intalloc, fltalloc;
        varinfo *v;
        int     intregsneeded = 0;
@@ -592,11 +592,11 @@ static void simplereg_allocate_locals_leafmethod(jitdata *jd)
                intalloc = -1; fltalloc = -1;
                for (tt = 0; tt <= 4; tt++) {
                        t = typeloop[tt];
-                       lm = jd->local_map[s * 5 + t];
-                       if (lm == UNUSED)
+                       varindex = jd->local_map[s * 5 + t];
+                       if (varindex == UNUSED)
                                continue;
 
-                       v = VAR(lm);
+                       v = VAR(varindex);
 
 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
                        intregsneeded = (IS_2_WORD_TYPE(t)) ? 1 : 0;
@@ -770,7 +770,7 @@ static void simplereg_allocate_locals(jitdata *jd)
        codegendata  *cd;
        registerdata *rd;
 
-       int     s, t, tt, lm;
+       int     s, t, tt, varindex;
        int     intalloc, fltalloc;
        varinfo *v;
        int     memneeded = 0;
@@ -794,11 +794,11 @@ static void simplereg_allocate_locals(jitdata *jd)
                for (tt=0; tt<=4; tt++) {
                        t = typeloop[tt];
 
-                       lm = jd->local_map[s * 5 + t];
-                       if (lm == UNUSED)
+                       varindex = jd->local_map[s * 5 + t];
+                       if (varindex == UNUSED)
                                continue;
 
-                       v = VAR(lm);
+                       v = VAR(varindex);
 
 #ifdef SUPPORT_COMBINE_INTEGER_REGISTERS
                                intregsneeded = (IS_2_WORD_TYPE(t)) ? 1 : 0;
index 55ab6f0939376c4d5a6890d8d4fce45967cc4ad5..ad02e167832e2836da8ad70ec09e036bd163dd9c 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: inline.c 7742 2007-04-17 20:37:36Z edwin $
+   $Id: inline.c 7743 2007-04-17 20:53:41Z edwin $
 
 */
 
@@ -604,8 +604,8 @@ static s4 *create_variable_map(inline_node *callee)
 {
        s4 *varmap;
        s4 i, t;
-       s4 idx;
-       s4 n_idx;
+       s4 varindex;
+       s4 n_javaindex;
        s4 avail;
        varinfo *v;
 
@@ -619,38 +619,38 @@ static s4 *create_variable_map(inline_node *callee)
 
        for (i=0; i<callee->m->maxlocals; ++i) {
                for (t=0; t<5; ++t) {
-                       idx = callee->jd->local_map[5*i + t];
-                       if (idx == UNUSED)
+                       varindex = callee->jd->local_map[5*i + t];
+                       if (varindex == UNUSED)
                                continue;
 
-                       v = &(callee->jd->var[idx]);
+                       v = &(callee->jd->var[varindex]);
                        assert(v->type == t || v->type == TYPE_VOID); /* XXX stack leaves VOID */
                        v->type = t; /* XXX restore if it is TYPE_VOID */
 
                        avail = callee->ctx->resultjd->local_map[5*(callee->localsoffset + i) + t];
 
                        if (avail == UNUSED) {
-                               avail = inline_new_variable_clone(callee->ctx->resultjd, callee->jd, idx);
+                               avail = inline_new_variable_clone(callee->ctx->resultjd, callee->jd, varindex);
                                callee->ctx->resultjd->local_map[5*(callee->localsoffset + i) + t] = avail;
                        }
 
-                       varmap[idx] = avail;
+                       varmap[varindex] = avail;
                }
        }
 
        /* for synchronized instance methods we need an extra local */
 
        if (callee->synchronize && !(callee->m->flags & ACC_STATIC)) {
-               n_idx = callee->localsoffset - 1;
-               assert(n_idx >= 0);
+               n_javaindex = callee->localsoffset - 1;
+               assert(n_javaindex >= 0);
                assert(callee->parent);
-               assert(n_idx == callee->parent->localsoffset + callee->parent->m->maxlocals);
+               assert(n_javaindex == callee->parent->localsoffset + callee->parent->m->maxlocals);
 
-               avail = callee->ctx->resultjd->local_map[5*n_idx + TYPE_ADR];
+               avail = callee->ctx->resultjd->local_map[5*n_javaindex + TYPE_ADR];
 
                if (avail == UNUSED) {
                        avail = inline_new_variable(callee->ctx->resultjd, TYPE_ADR, 0);
-                       callee->ctx->resultjd->local_map[5*n_idx + TYPE_ADR] = avail;
+                       callee->ctx->resultjd->local_map[5*n_javaindex + TYPE_ADR] = avail;
                }
 
                callee->synclocal = avail;
@@ -1112,7 +1112,7 @@ static s4 emit_inlining_prolog(inline_node *iln,
        int type;
        instruction *n_ins;
        insinfo_inline *insinfo;
-       s4 argvar;
+       s4 varindex;
 
        assert(iln && callee && o_iptr);
 
@@ -1169,12 +1169,12 @@ static s4 emit_inlining_prolog(inline_node *iln,
 
                /* translate the argument variable */
 
-               argvar = varmap[o_iptr->sx.s23.s2.args[i]];
-               assert(argvar != UNUSED);
+               varindex = varmap[o_iptr->sx.s23.s2.args[i]];
+               assert(varindex != UNUSED);
 
                /* remove preallocation from the argument variable */
 
-               iln->ctx->resultjd->var[argvar].flags &= ~(PREALLOC | INMEMORY);
+               iln->ctx->resultjd->var[varindex].flags &= ~(PREALLOC | INMEMORY);
 
                /* check the instance slot against NULL */
                /* we don't need that for <init> methods, as the verifier  */
@@ -1184,7 +1184,7 @@ static s4 emit_inlining_prolog(inline_node *iln,
                if (!callee->isstatic && i == 0 && calleem->name != utf_init) {
                        assert(type == TYPE_ADR);
                        n_ins = inline_instruction(iln, ICMD_CHECKNULL, o_iptr);
-                       n_ins->s1.varindex = argvar;
+                       n_ins->s1.varindex = varindex;
                        n_ins->dst.varindex = n_ins->s1.varindex;
                }
 
@@ -1203,7 +1203,7 @@ static s4 emit_inlining_prolog(inline_node *iln,
                                n_ins = inline_instruction(iln, ICMD_ISTORE + type, o_iptr);
                                n_ins->sx.s23.s3.javaindex = UNUSED;
                        }
-                       n_ins->s1.varindex = argvar;
+                       n_ins->s1.varindex = varindex;
                        n_ins->dst.varindex = iln->ctx->resultjd->local_map[5*localindex + type];
                        assert(n_ins->dst.varindex != UNUSED);
                }
@@ -1219,7 +1219,7 @@ static s4 emit_inlining_prolog(inline_node *iln,
                        /* this value is not used, pop it */
 
                        n_ins = inline_instruction(iln, ICMD_POP, o_iptr);
-                       n_ins->s1.varindex = argvar;
+                       n_ins->s1.varindex = varindex;
                }
 
                DOLOG( printf("%sprolog: ", iln->indent);
index 3f0091427f5a47f775142ddbf0ecce0748417ff7..bfca80b1e52ccb170bf158857aa584b96aedd39b 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: stack.c 7742 2007-04-17 20:37:36Z edwin $
+   $Id: stack.c 7743 2007-04-17 20:53:41Z edwin $
 
 */
 
@@ -4853,24 +4853,24 @@ throw_stack_category_error:
 
 void stack_javalocals_store(instruction *iptr, s4 *javalocals)
 {
-       s4 idx;  /* index into the jd->var array */
-       s4 j;    /* java local index             */
+       s4 varindex;     /* index into the jd->var array */
+       s4 javaindex;    /* java local index             */
 
-       idx = iptr->dst.varindex;
-       j = iptr->sx.s23.s3.javaindex;
+       varindex = iptr->dst.varindex;
+       javaindex = iptr->sx.s23.s3.javaindex;
 
-       if (j != UNUSED) {
-               assert(j >= 0);
+       if (javaindex != UNUSED) {
+               assert(javaindex >= 0);
                if (iptr->flags.bits & INS_FLAG_RETADDR)
-                       javalocals[j] = iptr->sx.s23.s2.retaddrnr;
+                       javalocals[javaindex] = iptr->sx.s23.s2.retaddrnr;
                else
-                       javalocals[j] = idx;
+                       javalocals[javaindex] = varindex;
 
                if (iptr->flags.bits & INS_FLAG_KILL_PREV)
-                       javalocals[j-1] = UNUSED;
+                       javalocals[javaindex-1] = UNUSED;
 
                if (iptr->flags.bits & INS_FLAG_KILL_NEXT)
-                       javalocals[j+1] = UNUSED;
+                       javalocals[javaindex+1] = UNUSED;
        }
 }
 
index 3abc21e97c88dadef78d8c31f5b6305d07a6c12c..ee70cbb0c1eda2cdb79799bb577d100bb7415038 100644 (file)
@@ -486,7 +486,7 @@ bool typestate_reach(verifier_state *state,
 bool typecheck_init_locals(verifier_state *state, bool newthis)
 {
        int i;
-       int index;
+       int varindex;
        varinfo *locals;
        varinfo *v;
        jitdata *jd = state->jd;
@@ -512,11 +512,11 @@ bool typecheck_init_locals(verifier_state *state, bool newthis)
     /* if this is an instance method initialize the "this" ref type */
 
     if (!(state->m->flags & ACC_STATIC)) {
-               index = jd->local_map[5*0 + TYPE_ADR];
-               if (index != UNUSED) {
+               varindex = jd->local_map[5*0 + TYPE_ADR];
+               if (varindex != UNUSED) {
                        if (state->validlocals < 1)
                                TYPECHECK_VERIFYERROR_bool("Not enough local variables for method arguments");
-                       v = locals + index;
+                       v = locals + varindex;
                        v->type = TYPE_ADR;
                        if (state->initmethod && newthis)
                                TYPEINFO_INIT_NEWOBJECT(v->typeinfo, NULL);
index fa3189584f0c91752707a5d2b377c51508cd70cd..7cc8bb446ddc925a61b2eaee3fdfe863e09d1f9b 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typeinfo.c 7486 2007-03-08 13:50:07Z twisti $
+   $Id: typeinfo.c 7743 2007-04-17 20:53:41Z edwin $
 
 */
 
@@ -1190,7 +1190,7 @@ typeinfo_init_varinfos_from_methoddesc(varinfo *vars,
                                                                         typedescriptor *returntype)
 {
        s4 i;
-    s4 index;
+    s4 varindex;
        s4 type;
        s4 slot = 0;
 
@@ -1204,21 +1204,21 @@ typeinfo_init_varinfos_from_methoddesc(varinfo *vars,
     /* check arguments */
     for (i=startindex; i<desc->paramcount; ++i) {
                type = desc->paramtypes[i].type;
-               index = map[5*slot + type];
+               varindex = map[5*slot + type];
 
                slot++;
                if (IS_2_WORD_TYPE(type))
                        slot++;
 
-               if (index == UNUSED)
+               if (varindex == UNUSED)
                        continue;
 
-               if (index >= buflen) {
+               if (varindex >= buflen) {
                        exceptions_throw_internalerror("Buffer too small for method arguments.");
                        return false;
                }
 
-               if (!typeinfo_init_varinfo_from_typedesc(vars + index, desc->paramtypes + i))
+               if (!typeinfo_init_varinfo_from_typedesc(vars + varindex, desc->paramtypes + i))
                        return false;
     }