From d389e6c3efd4324b74ff27d8bef86e5ee39b1a28 Mon Sep 17 00:00:00 2001 From: cacao Date: Tue, 10 Nov 1998 10:52:59 +0000 Subject: [PATCH 1/1] small corrections for verbosecall --- alpha/ngen.c | 46 ++++++++++++++++++++++++++++++++-------------- jit.c | 3 --- jit/parse.c | 40 +++++++++++++++++++++++----------------- src/vm/jit/parse.c | 40 +++++++++++++++++++++++----------------- 4 files changed, 78 insertions(+), 51 deletions(-) diff --git a/alpha/ngen.c b/alpha/ngen.c index db61e1996..6c5670eeb 100644 --- a/alpha/ngen.c +++ b/alpha/ngen.c @@ -426,14 +426,23 @@ static void gen_mcode() */ if (runverbose && isleafmethod) { - M_LDA (REG_SP, REG_SP, -(8*8)); + M_LDA (REG_SP, REG_SP, -(14*8)); M_AST(REG_RA, REG_SP, 1*8); - M_LST(argintregs[0], REG_SP, 2*8); - M_LST(argintregs[1], REG_SP, 3*8); - M_LST(argintregs[2], REG_SP, 4*8); - M_LST(argintregs[3], REG_SP, 5*8); - M_LST(argintregs[4], REG_SP, 6*8); - M_LST(argintregs[5], REG_SP, 7*8); + + M_LST(argintregs[0], REG_SP, 2*8); + M_LST(argintregs[1], REG_SP, 3*8); + M_LST(argintregs[2], REG_SP, 4*8); + M_LST(argintregs[3], REG_SP, 5*8); + M_LST(argintregs[4], REG_SP, 6*8); + M_LST(argintregs[5], REG_SP, 7*8); + + M_DST(argfltregs[0], REG_SP, 8*8); + M_DST(argfltregs[1], REG_SP, 9*8); + M_DST(argfltregs[2], REG_SP, 10*8); + M_DST(argfltregs[3], REG_SP, 11*8); + M_DST(argfltregs[4], REG_SP, 12*8); + M_DST(argfltregs[5], REG_SP, 13*8); + p = dseg_addaddress (method); M_ALD(REG_ITMP1, REG_PV, p); M_AST(REG_ITMP1, REG_SP, REG); @@ -442,13 +451,22 @@ static void gen_mcode() M_JSR(REG_RA, REG_PV); M_LDA(REG_PV, REG_RA, -(int)((u1*) mcodeptr - mcodebase)); M_ALD(REG_RA, REG_SP, 1*8); - M_LLD(argintregs[0], REG_SP, 2*8); - M_LLD(argintregs[1], REG_SP, 3*8); - M_LLD(argintregs[2], REG_SP, 4*8); - M_LLD(argintregs[3], REG_SP, 5*8); - M_LLD(argintregs[4], REG_SP, 6*8); - M_LLD(argintregs[5], REG_SP, 7*8); - M_LDA (REG_SP, REG_SP, 8*8); + + M_LLD(argintregs[0], REG_SP, 2*8); + M_LLD(argintregs[1], REG_SP, 3*8); + M_LLD(argintregs[2], REG_SP, 4*8); + M_LLD(argintregs[3], REG_SP, 5*8); + M_LLD(argintregs[4], REG_SP, 6*8); + M_LLD(argintregs[5], REG_SP, 7*8); + + M_DLD(argfltregs[0], REG_SP, 8*8); + M_DLD(argfltregs[1], REG_SP, 9*8); + M_DLD(argfltregs[2], REG_SP, 10*8); + M_DLD(argfltregs[3], REG_SP, 11*8); + M_DLD(argfltregs[4], REG_SP, 12*8); + M_DLD(argfltregs[5], REG_SP, 13*8); + + M_LDA (REG_SP, REG_SP, 14*8); } /* take arguments out of register or stack frame */ diff --git a/jit.c b/jit.c index 2d42e9d27..76501880e 100644 --- a/jit.c +++ b/jit.c @@ -276,9 +276,6 @@ methodptr jit_compile(methodinfo *m) local_init(); mcode_init(); - if (runverbose) - allocate_literals(); - parse(); analyse_stack(); diff --git a/jit/parse.c b/jit/parse.c index 269db0625..ea00cfae1 100644 --- a/jit/parse.c +++ b/jit/parse.c @@ -17,18 +17,18 @@ /* macros for byte code fetching *********************************************** - fetch a byte code of given size from position pos + fetch a byte code of given size from position p in code array jcode *******************************************************************************/ -#define code_get_u1(pos) jcode[pos] -#define code_get_s1(pos) ((s1)jcode[pos]) -#define code_get_u2(pos) ((((u2)jcode[pos])<<8)+jcode[pos+1]) -#define code_get_s2(pos) ((s2)((((u2)jcode[pos])<<8)+jcode[pos+1])) -#define code_get_u4(pos) ((((u4)jcode[pos])<<24)+(((u4)jcode[pos+1])<<16)+\ - (((u4)jcode[pos+2])<<8)+jcode[pos+3]) -#define code_get_s4(pos) ((s4)((((u4)jcode[pos])<<24)+(((u4)jcode[pos+1])<<16)+\ - (((u4)jcode[pos+2])<<8)+jcode[pos+3])) +#define code_get_u1(p) jcode[p] +#define code_get_s1(p) ((s1)jcode[p]) +#define code_get_u2(p) ((((u2)jcode[p])<<8)+jcode[p+1]) +#define code_get_s2(p) ((s2)((((u2)jcode[p])<<8)+jcode[p+1])) +#define code_get_u4(p) ((((u4)jcode[p])<<24)+(((u4)jcode[p+1])<<16)\ + +(((u4)jcode[p+2])<<8)+jcode[p+3]) +#define code_get_s4(p) ((s4)((((u4)jcode[p])<<24)+(((u4)jcode[p+1])<<16)\ + +(((u4)jcode[p+2])<<8)+jcode[p+3])) /* functionc compiler_addinitclass ********************************************* @@ -156,10 +156,13 @@ static void descriptor2types (methodinfo *m) } +#ifdef OLD_COMPILER + /* function allocate_literals ************************************************** - Scans the JavaVM code of a method and allocates string literals. Needed - to generate the same addresses as the old JIT compiler. + Scans the JavaVM code of a method and allocates string literals (in the + same order as the old JIT). Needed to generate the same addresses as the + old JIT compiler. *******************************************************************************/ @@ -211,7 +214,7 @@ static void allocate_literals() } /* end switch */ } /* end while */ } - +#endif /******************************************************************************* @@ -265,11 +268,18 @@ static void parse() int ipc = 0; /* intermediate instruction counter */ int b_count = 0; /* basic block counter */ int s_count = 0; /* stack element counter */ - bool blockend = false; /* true if basic block end has reached */ + bool blockend = false; /* true if basic block end has been reached */ bool iswide = false; /* true if last instruction was a wide */ instruction *iptr; /* current pointer into instruction array */ +#ifdef OLD_COMPILER + /* generate the same addresses as the old JIT compiler */ + + if (runverbose) + allocate_literals(); +#endif + /* allocate instruction array and block index table */ /* 1 additional for end ipc and 3 for loop unrolling */ @@ -311,10 +321,6 @@ static void parse() s_count = 1 + exceptiontablelength; /* initialize stack element counter */ - if (runverbose) { -/* isleafmethod=false; */ - } - #ifdef USE_THREADS if (checksync && (method->flags & ACC_SYNCHRONIZED)) { isleafmethod=false; diff --git a/src/vm/jit/parse.c b/src/vm/jit/parse.c index 269db0625..ea00cfae1 100644 --- a/src/vm/jit/parse.c +++ b/src/vm/jit/parse.c @@ -17,18 +17,18 @@ /* macros for byte code fetching *********************************************** - fetch a byte code of given size from position pos + fetch a byte code of given size from position p in code array jcode *******************************************************************************/ -#define code_get_u1(pos) jcode[pos] -#define code_get_s1(pos) ((s1)jcode[pos]) -#define code_get_u2(pos) ((((u2)jcode[pos])<<8)+jcode[pos+1]) -#define code_get_s2(pos) ((s2)((((u2)jcode[pos])<<8)+jcode[pos+1])) -#define code_get_u4(pos) ((((u4)jcode[pos])<<24)+(((u4)jcode[pos+1])<<16)+\ - (((u4)jcode[pos+2])<<8)+jcode[pos+3]) -#define code_get_s4(pos) ((s4)((((u4)jcode[pos])<<24)+(((u4)jcode[pos+1])<<16)+\ - (((u4)jcode[pos+2])<<8)+jcode[pos+3])) +#define code_get_u1(p) jcode[p] +#define code_get_s1(p) ((s1)jcode[p]) +#define code_get_u2(p) ((((u2)jcode[p])<<8)+jcode[p+1]) +#define code_get_s2(p) ((s2)((((u2)jcode[p])<<8)+jcode[p+1])) +#define code_get_u4(p) ((((u4)jcode[p])<<24)+(((u4)jcode[p+1])<<16)\ + +(((u4)jcode[p+2])<<8)+jcode[p+3]) +#define code_get_s4(p) ((s4)((((u4)jcode[p])<<24)+(((u4)jcode[p+1])<<16)\ + +(((u4)jcode[p+2])<<8)+jcode[p+3])) /* functionc compiler_addinitclass ********************************************* @@ -156,10 +156,13 @@ static void descriptor2types (methodinfo *m) } +#ifdef OLD_COMPILER + /* function allocate_literals ************************************************** - Scans the JavaVM code of a method and allocates string literals. Needed - to generate the same addresses as the old JIT compiler. + Scans the JavaVM code of a method and allocates string literals (in the + same order as the old JIT). Needed to generate the same addresses as the + old JIT compiler. *******************************************************************************/ @@ -211,7 +214,7 @@ static void allocate_literals() } /* end switch */ } /* end while */ } - +#endif /******************************************************************************* @@ -265,11 +268,18 @@ static void parse() int ipc = 0; /* intermediate instruction counter */ int b_count = 0; /* basic block counter */ int s_count = 0; /* stack element counter */ - bool blockend = false; /* true if basic block end has reached */ + bool blockend = false; /* true if basic block end has been reached */ bool iswide = false; /* true if last instruction was a wide */ instruction *iptr; /* current pointer into instruction array */ +#ifdef OLD_COMPILER + /* generate the same addresses as the old JIT compiler */ + + if (runverbose) + allocate_literals(); +#endif + /* allocate instruction array and block index table */ /* 1 additional for end ipc and 3 for loop unrolling */ @@ -311,10 +321,6 @@ static void parse() s_count = 1 + exceptiontablelength; /* initialize stack element counter */ - if (runverbose) { -/* isleafmethod=false; */ - } - #ifdef USE_THREADS if (checksync && (method->flags & ACC_SYNCHRONIZED)) { isleafmethod=false; -- 2.25.1