* src/vm/jit/powerpc/darwin/md-abi.c: Likewise.
* src/vm/jit/alpha/codegen.c: Likewise.
* src/vm/jit/alpha/codegen.h: Likewise.
* src/vm/jit/alpha/md-abi.c: Likewise.
* src/vm/jit/show.c: Likewise.
* src/vm/jit/verify/typecheck.c: Likewise.
* src/vm/jit/allocator/simplereg.c: Likewise.
* src/vm/jit/i386/codegen.h: Likewise.
* src/vm/jit/parse.c: Likewise.
* src/vm/jit/x86_64/emit.c: Likewise.
* src/vm/jit/x86_64/codegen.c: Likewise.
* src/vm/jit/x86_64/codegen.h: Likewise.
* src/vm/jit/x86_64/md-abi.c: Likewise.
* src/vm/jit/codegen-common.c: Likewise.
--HG--
branch : unified_variables
Michael Starzinger
Edwin Steiner
- $Id: simplereg.c 5584 2006-09-29 14:02:39Z edwin $
+ $Id: simplereg.c 5595 2006-09-30 23:06:36Z edwin $
*/
if (lm == UNUSED)
continue;
- v = &(jd->var[lm]);
+ v = VAR(lm);
#if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
intregsneeded = (IS_2_WORD_TYPE(t)) ? 1 : 0;
#endif
if (IS_FLT_DBL_TYPE(t)) {
if (fltalloc >= 0) {
- v->flags = jd->var[fltalloc].flags;
- v->vv.regoff = jd->var[fltalloc].vv.regoff;
+ v->flags = VAR(fltalloc)->flags;
+ v->vv.regoff = VAR(fltalloc)->vv.regoff;
}
#if !defined(SUPPORT_PASS_FLOATARGS_IN_INTREGS)
/* We can only use float arguments as local variables,
#endif
{
if (intalloc >= 0) {
- v->flags = jd->var[intalloc].flags;
+ v->flags = VAR(intalloc)->flags;
#if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
if (!(v->flags & INMEMORY)
- && IS_2_WORD_TYPE(jd->var[intalloc].type))
+ && IS_2_WORD_TYPE(VAR(intalloc)->type))
v->vv.regoff = GET_LOW_REG(
- jd->var[intalloc].vv.regoff);
+ VAR(intalloc)->vv.regoff);
else
#endif
- v->vv.regoff = jd->var[intalloc].vv.regoff;
+ v->vv.regoff = VAR(intalloc)->vv.regoff;
}
else if ((p < md->paramcount) &&
!md->params[p].inmemory) {
if (lm == UNUSED)
continue;
- v = &(jd->var[lm]);
+ v = VAR(lm);
#ifdef SUPPORT_COMBINE_INTEGER_REGISTERS
intregsneeded = (IS_2_WORD_TYPE(t)) ? 1 : 0;
#endif
if (IS_FLT_DBL_TYPE(t)) {
if (fltalloc >= 0) {
- v->flags = jd->var[fltalloc].flags;
- v->vv.regoff = jd->var[fltalloc].vv.regoff;
+ v->flags = VAR(fltalloc)->flags;
+ v->vv.regoff = VAR(fltalloc)->vv.regoff;
}
else if (rd->savfltreguse > 0) {
v->flags = 0;
} else {
#endif
if (intalloc >= 0) {
- v->flags = jd->var[intalloc].flags;
+ v->flags = VAR(intalloc)->flags;
#if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
if (!(v->flags & INMEMORY)
- && IS_2_WORD_TYPE(jd->var[intalloc].type))
+ && IS_2_WORD_TYPE(VAR(intalloc)->type))
v->vv.regoff = GET_LOW_REG(
- jd->var[intalloc].vv.regoff);
+ VAR(intalloc)->vv.regoff);
else
#endif
- v->vv.regoff = jd->var[intalloc].vv.regoff;
+ v->vv.regoff = VAR(intalloc)->vv.regoff;
}
else if (rd->savintreguse > intregsneeded) {
rd->savintreguse -= intregsneeded+1;
#define reg_new_temp(jd,index) \
if ( (index >= jd->localcount) \
- && (!(jd->var[index].flags & OUTVAR)) \
- && (!(jd->var[index].flags & PREALLOC)) ) \
+ && (!(VAR(index)->flags & OUTVAR)) \
+ && (!(VAR(index)->flags & PREALLOC)) ) \
reg_new_temp_func(jd, index)
static void reg_new_temp_func(jitdata *jd, s4 index)
varinfo *v;
rd = jd->rd;
- v = &(jd->var[index]);
+ v = VAR(index);
/* Try to allocate a saved register if there is no temporary one */
/* available. This is what happens during the second run. */
#define reg_free_temp(jd,index) \
if ((index > jd->localcount) \
- && (!(jd->var[index].flags & (OUTVAR | PREALLOC)))) \
+ && (!(VAR(index)->flags & (OUTVAR | PREALLOC)))) \
reg_free_temp_func(jd, index)
/* Do not free regs/memory locations used by Stackslots flagged STCOPY! There is still another Stackslot */
varinfo *v;
rd = jd->rd;
- v = &(jd->var[index]);
+ v = VAR(index);
/* if this is a copy of another variable, just decrement the copy counter */
for (i=0; i<bptr->indepth; ++i)
{
- v = jd->var + bptr->invars[i];
+ v = VAR(bptr->invars[i]);
v->vv.regoff = jd->interface_map[5*i + v->type].regoff;
v->flags = jd->interface_map[5*i + v->type].flags;
for (i=0; i<bptr->outdepth; ++i)
{
- v = jd->var + bptr->outvars[i];
+ v = VAR(bptr->outvars[i]);
v->vv.regoff = jd->interface_map[5*i + v->type].regoff;
v->flags = jd->interface_map[5*i + v->type].flags;
case ICMD_JSR:
#if !defined(NDEBUG)
/* avoid problems with show_allocation */
- jd->var[iptr->dst.varindex].vv.regoff = 0;
+ VAROP(iptr->dst)->vv.regoff = 0;
#endif
case ICMD_NOP:
case ICMD_CHECKNULL:
Christian Ullrich
Edwin Steiner
- $Id: codegen.c 5588 2006-09-30 11:04:41Z christian $
+ $Id: codegen.c 5595 2006-09-30 23:06:36Z edwin $
*/
for (s3 = s3 - 1; s3 >= 0; s3--) {
s1 = iptr->sx.s23.s2.args[s3];
- var1 = jd->var + s1;
+ var1 = VAR(s1);
/* Already Preallocated (ARGVAR) ? */
if (var1->flags & PREALLOC)
for (s1 = iptr->s1.argcount; --s1 >= 0; ) {
s3 = iptr->sx.s23.s2.args[s1];
- var1 = jd->var + s3;
+ var1 = VAR(s3);
/* copy SAVEDVAR sizes to stack */
Changes: Christian Thalinger
- $Id: codegen.h 5518 2006-09-15 16:31:47Z christian $
+ $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $
*/
} while (0)
-#define M_COPY(s,d) emit_copy(jd, iptr, &(jd->var[(s)]), &(jd->var[(d)]))
+#define M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d))
#define ICONST(d,c) emit_iconst(cd, (d), (c))
#define LCONST(d,c) emit_lconst(cd, (d), (c))
Changes: Christian Ullrich
- $Id: md-abi.c 5518 2006-09-15 16:31:47Z christian $
+ $Id: md-abi.c 5595 2006-09-30 23:06:36Z edwin $
*/
/* stackslot->varnum = -1; */
/* stackslot->flags = 0; */
- jd->var[stackslot->varnum].flags = PREALLOC;
+ VAR(stackslot->varnum)->flags = PREALLOC;
if (IS_INT_LNG_TYPE(md->returntype.type))
/* stackslot->regoff = REG_RESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_RESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_RESULT;
else
/* stackslot->regoff = REG_FRESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_FRESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_FRESULT;
}
}
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen-common.c 5463 2006-09-11 14:37:06Z edwin $
+ $Id: codegen-common.c 5595 2006-09-30 23:06:36Z edwin $
*/
s4 codegen_reg_of_dst(jitdata *jd, instruction *iptr, s4 tempregnum)
{
- varinfo *v = &jd->var[iptr->dst.varindex];
+ varinfo *v = VAROP(iptr->dst);
if (!(v->flags & INMEMORY)) {
Changes:
- $Id: codegen.h 5426 2006-09-08 16:02:40Z edwin $
+ $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $
*/
#define M_COPY(from,to) _M_COPY((from),(to));
#endif
-#define _M_COPY(s,d) emit_copy(jd, iptr, &(jd->var[(s)]), &(jd->var[(d)]))
+#define _M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d))
#define ICONST(d,c) \
do { \
Joseph Wenninger
Christian Thalinger
- $Id: parse.c 5550 2006-09-28 18:31:47Z edwin $
+ $Id: parse.c 5595 2006-09-30 23:06:36Z edwin $
*/
for(mapptr = local_map, i = 0; i < (cd->maxlocals * 5); i++, mapptr++)
if (*mapptr != UNUSED)
- jd->var[*mapptr].type = i%5;
+ VAR(*mapptr)->type = i%5;
}
/* everything's ok */
Changes: Christian Ullrich
- $Id: md-abi.c 5522 2006-09-15 17:05:58Z christian $
+ $Id: md-abi.c 5595 2006-09-30 23:06:36Z edwin $
*/
/* stackslot->varkind = ARGVAR; */
/* stackslot->varnum = -1; */
/* stackslot->flags = 0; */
- jd->var[stackslot->varnum].flags = PREALLOC;
+ VAR(stackslot->varnum)->flags = PREALLOC;
if (IS_INT_LNG_TYPE(md->returntype.type)) {
if (!IS_2_WORD_TYPE(md->returntype.type)) {
rd->argintreguse = 1;
/* stackslot->regoff = REG_RESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_RESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_RESULT;
}
else {
if (rd->argintreguse < 2)
rd->argintreguse = 2;
/* stackslot->regoff = REG_RESULT_PACKED; */
- jd->var[stackslot->varnum].vv.regoff = REG_RESULT_PACKED;
+ VAR(stackslot->varnum)->vv.regoff = REG_RESULT_PACKED;
}
}
else {
rd->argfltreguse = 1;
/* stackslot->regoff = REG_FRESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_FRESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_FRESULT;
}
}
}
Changes: Christian Ullrich
- $Id: md-abi.c 5522 2006-09-15 17:05:58Z christian $
+ $Id: md-abi.c 5595 2006-09-30 23:06:36Z edwin $
*/
/* stackslot->varkind = ARGVAR; */
/* stackslot->varnum = -1; */
/* stackslot->flags = 0; */
- jd->var[stackslot->varnum].flags = PREALLOC;
+ VAR(stackslot->varnum)->flags = PREALLOC;
if (IS_INT_LNG_TYPE(md->returntype.type)) {
if (!IS_2_WORD_TYPE(md->returntype.type)) {
rd->argintreguse = 1;
/* stackslot->regoff = REG_RESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_RESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_RESULT;
}
else {
if (rd->argintreguse < 2)
rd->argintreguse = 2;
/* stackslot->regoff = REG_RESULT_PACKED; */
- jd->var[stackslot->varnum].vv.regoff = REG_RESULT_PACKED;
+ VAR(stackslot->varnum)->vv.regoff = REG_RESULT_PACKED;
}
}
else { /* float/double */
rd->argfltreguse = 1;
/* stackslot->regoff = REG_FRESULT; */
- jd->var[stackslot->varnum].vv.regoff = REG_FRESULT;
+ VAR(stackslot->varnum)->vv.regoff = REG_FRESULT;
}
}
}
# if defined(ENABLE_INTRP)
if (!opt_intrp) {
# endif
- printf(" (%s) ", show_jit_type_names[jd->var[i].type]);
+ printf(" (%s) ", show_jit_type_names[VAR(i)->type]);
if (stage >= SHOW_REGS)
- show_allocation(jd->var[i].type, jd->var[i].flags, jd->var[i].vv.regoff);
+ show_allocation(VAR(i)->type, VAR(i)->flags, VAR(i)->vv.regoff);
printf("\n");
# if defined(ENABLE_INTRP)
}
printf(" M%02d = 0x%02x(sp): ", i, i * 8);
#endif
for (j=0; j<jd->varcount; ++j) {
- varinfo *v = jd->var + j;
+ varinfo *v = VAR(j);
if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
show_variable(jd, j, stage);
putchar(' ');
char kind;
varinfo *v;
- v = &(jd->var[index]);
+ v = VAR(index);
switch (v->type) {
case TYPE_INT: type = 'i'; break;
Changes: Christian Thalinger
- $Id: typecheck.c 5515 2006-09-15 14:43:22Z edwin $
+ $Id: typecheck.c 5595 2006-09-30 23:06:36Z edwin $
*/
varinfo *var;
assert(index >= 0 && index < jd->varcount);
- var = jd->var + index;
+ var = VAR(index);
typeinfo_print_type(file, var->type, &(var->typeinfo));
}
TYPECHECK_COUNT(stat_ins_aload);
/* loading a returnAddress is not allowed */
- if (!TYPEDESC_IS_REFERENCE(jd->var[state->iptr->s1.varindex])) {
+ if (!TYPEDESC_IS_REFERENCE(*VAROP(state->iptr->s1))) {
TYPECHECK_VERIFYERROR_bool("illegal instruction: ALOAD loading non-reference");
}
- TYPEINFO_COPY(jd->var[state->iptr->s1.varindex].typeinfo,dv->typeinfo);
+ TYPEINFO_COPY(VAROP(state->iptr->s1)->typeinfo,dv->typeinfo);
dv->type = TYPE_ADR;
break;
Changes: Christian Ullrich
Edwin Steiner
- $Id: codegen.c 5587 2006-09-30 10:16:48Z christian $
+ $Id: codegen.c 5595 2006-09-30 23:06:36Z edwin $
*/
for (s3 = s3 - 1; s3 >= 0; s3--) {
s1 = iptr->sx.s23.s2.args[s3];
- var1 = jd->var + s1;
+ var1 = VAR(s1);
/* Already Preallocated (ARGVAR) ? */
if (var1->flags & PREALLOC)
/* copy SAVEDVAR sizes to stack */
s3 = iptr->sx.s23.s2.args[s1];
- var1 = jd->var + s3;
+ var1 = VAR(s3);
/* Already Preallocated (ARGVAR) ? */
if (!(var1->flags & PREALLOC)) {
Changes:
- $Id: codegen.h 5507 2006-09-15 09:19:11Z christian $
+ $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $
*/
} while (0)
-#define M_COPY(s,d) emit_copy(jd, iptr, &(jd->var[(s)]), &(jd->var[(d)]))
+#define M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d))
#define ICONST(r,c) \
do { \
Changes:
- $Id: emit.c 5561 2006-09-28 19:53:05Z edwin $
+ $Id: emit.c 5595 2006-09-30 23:06:36Z edwin $
*/
cd = jd->cd;
- v_s1 = jd->var + iptr->s1.varindex;
- v_s2 = jd->var + iptr->sx.s23.s2.varindex;
- v_dst = jd->var + iptr->dst.varindex;
+ v_s1 = VAROP(iptr->s1);
+ v_s2 = VAROP(iptr->sx.s23.s2);
+ v_dst = VAROP(iptr->dst);
s1 = v_s1->vv.regoff;
s2 = v_s2->vv.regoff;
cd = jd->cd;
- v_s1 = jd->var + iptr->s1.varindex;
- v_s2 = jd->var + iptr->sx.s23.s2.varindex;
- v_dst = jd->var + iptr->dst.varindex;
+ v_s1 = VAROP(iptr->s1);
+ v_s2 = VAROP(iptr->sx.s23.s2);
+ v_dst = VAROP(iptr->dst);
s1 = v_s1->vv.regoff;
s2 = v_s2->vv.regoff;
Changes:
- $Id: md-abi.c 5507 2006-09-15 09:19:11Z christian $
+ $Id: md-abi.c 5595 2006-09-30 23:06:36Z edwin $
*/
rd->argfltreguse = 1;
/* stackslot->regoff = REG_FRESULT; */
- jd->var[stackslot->varnum].flags = PREALLOC;
- jd->var[stackslot->varnum].vv.regoff = REG_FRESULT;
+ VAR(stackslot->varnum)->flags = PREALLOC;
+ VAR(stackslot->varnum)->vv.regoff = REG_FRESULT;
}
}
}