From 570368d70c6cc296e8cf850b2f72d3d218549b80 Mon Sep 17 00:00:00 2001 From: edwin Date: Mon, 2 Oct 2006 13:43:15 +0000 Subject: [PATCH] * src/vm/jit/alpha/codegen.h: Removed M_COPY. * src/vm/jit/mips/codegen.h: Likewise. * src/vm/jit/i386/codegen.h: Likewise. * src/vm/jit/powerpc64/codegen.h: Likewise. * src/vm/jit/x86_64/codegen.h: Likewise. * src/vm/jit/powerpc/codegen.c: Unified ICMD_RET with ICMD_GOTO. * src/vm/jit/alpha/codegen.c: Likewise. * src/vm/jit/mips/codegen.c: Likewise. * src/vm/jit/i386/codegen.c: Likewise. * src/vm/jit/powerpc64/codegen.c: Likewise. * src/vm/jit/intrp/codegen.c: Likewise. * src/vm/jit/x86_64/codegen.c: Likewise. --HG-- branch : unified_variables --- src/vm/jit/alpha/codegen.c | 21 ++++----------------- src/vm/jit/alpha/codegen.h | 3 +-- src/vm/jit/i386/codegen.c | 21 +++++++-------------- src/vm/jit/i386/codegen.h | 14 +------------- src/vm/jit/intrp/codegen.c | 9 ++------- src/vm/jit/mips/codegen.c | 5 ++--- src/vm/jit/mips/codegen.h | 3 +-- src/vm/jit/powerpc/codegen.c | 12 +++--------- src/vm/jit/powerpc64/codegen.c | 6 +++--- src/vm/jit/powerpc64/codegen.h | 3 +-- src/vm/jit/x86_64/codegen.c | 22 +++++++--------------- src/vm/jit/x86_64/codegen.h | 4 +--- 12 files changed, 33 insertions(+), 90 deletions(-) diff --git a/src/vm/jit/alpha/codegen.c b/src/vm/jit/alpha/codegen.c index 66dbd576a..12589fb64 100644 --- a/src/vm/jit/alpha/codegen.c +++ b/src/vm/jit/alpha/codegen.c @@ -32,7 +32,7 @@ Christian Ullrich Edwin Steiner - $Id: codegen.c 5630 2006-10-02 13:16:20Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -495,7 +495,7 @@ bool codegen(jitdata *jd) case ICMD_COPY: case ICMD_MOVE: - M_COPY(iptr->s1.varindex, iptr->dst.varindex); + emit_copy(jd, iptr, VAROP(iptr->s1), VAROP(iptr->dst)); break; @@ -2197,6 +2197,8 @@ bool codegen(jitdata *jd) break; case ICMD_GOTO: /* ... ==> ... */ + case ICMD_RET: /* ... ==> ... */ + M_BR(0); codegen_addreference(cd, iptr->dst.block); ALIGNCODENOP; @@ -2208,21 +2210,6 @@ bool codegen(jitdata *jd) codegen_addreference(cd, iptr->sx.s23.s3.jsrtarget.block); break; - case ICMD_RET: /* ... ==> ... */ - /* s1.localindex = local variable */ - - M_BR(0); - codegen_addreference(cd, iptr->dst.block); -/* var = &(rd->locals[iptr->s1.localindex][TYPE_ADR]); */ -/* if (var->flags & INMEMORY) { */ -/* M_ALD(REG_ITMP1, REG_SP, 8 * var->vv.regoff); */ -/* M_RET(REG_ZERO, REG_ITMP1); */ -/* } */ -/* else */ -/* M_RET(REG_ZERO, var->vv.regoff); */ - ALIGNCODENOP; - break; - case ICMD_IFNULL: /* ..., value ==> ... */ s1 = emit_load_s1(jd, iptr, REG_ITMP1); diff --git a/src/vm/jit/alpha/codegen.h b/src/vm/jit/alpha/codegen.h index 3f3ca0765..89d6e9836 100644 --- a/src/vm/jit/alpha/codegen.h +++ b/src/vm/jit/alpha/codegen.h @@ -29,7 +29,7 @@ Changes: Christian Thalinger - $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $ + $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $ */ @@ -101,7 +101,6 @@ } while (0) -#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)) diff --git a/src/vm/jit/i386/codegen.c b/src/vm/jit/i386/codegen.c index 2c5f7a8e6..b08df63aa 100644 --- a/src/vm/jit/i386/codegen.c +++ b/src/vm/jit/i386/codegen.c @@ -31,7 +31,7 @@ Christian Ullrich Edwin Steiner - $Id: codegen.c 5630 2006-10-02 13:16:20Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -708,7 +708,7 @@ bool codegen(jitdata *jd) break; - /* load/store operations **********************************************/ + /* load/store/copy/move operations ************************************/ case ICMD_ILOAD: case ICMD_ALOAD: @@ -720,11 +720,14 @@ bool codegen(jitdata *jd) case ICMD_LSTORE: case ICMD_FSTORE: case ICMD_DSTORE: + case ICMD_COPY: + case ICMD_MOVE: emit_copy(jd, iptr, VAROP(iptr->s1), VAROP(iptr->dst)); break; - /* pop/copy/move operations *******************************************/ + + /* pop operations *****************************************************/ /* attention: double and longs are only one entry in CACAO ICMDs */ @@ -733,11 +736,6 @@ bool codegen(jitdata *jd) break; - case ICMD_COPY: - case ICMD_MOVE: - - M_COPY(iptr->s1.varindex, iptr->dst.varindex); - break; /* integer operations *************************************************/ @@ -2689,6 +2687,7 @@ bool codegen(jitdata *jd) /* FALLTHROUGH! */ case ICMD_GOTO: /* ... ==> ... */ + case ICMD_RET: /* ... ==> ... */ #if defined(ENABLE_SSA) if ( ls != NULL ) { @@ -2709,12 +2708,6 @@ bool codegen(jitdata *jd) codegen_addreference(cd, iptr->sx.s23.s3.jsrtarget.block); break; - case ICMD_RET: /* ... ==> ... */ - - M_JMP_IMM(0); - codegen_addreference(cd, iptr->dst.block); - break; - case ICMD_IFNULL: /* ..., value ==> ... */ s1 = emit_load_s1(jd, iptr, REG_ITMP1); diff --git a/src/vm/jit/i386/codegen.h b/src/vm/jit/i386/codegen.h index 356e14a42..0a1ca77f3 100644 --- a/src/vm/jit/i386/codegen.h +++ b/src/vm/jit/i386/codegen.h @@ -29,7 +29,7 @@ Changes: - $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $ + $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $ */ @@ -138,18 +138,6 @@ } while (0) -#if defined(ENABLE_SSA) -#define M_COPY(from,to) \ - { \ - if ((ls==NULL) || (to->varkind != TEMPVAR) || \ - (ls->lifetime[-to->varnum-1].type != -1)) \ - { _M_COPY((from),(to)); } } -#else -#define M_COPY(from,to) _M_COPY((from),(to)); -#endif - -#define _M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d)) - #define ICONST(d,c) \ do { \ if ((c) == 0) \ diff --git a/src/vm/jit/intrp/codegen.c b/src/vm/jit/intrp/codegen.c index 1f5cd4462..141d3c2c7 100644 --- a/src/vm/jit/intrp/codegen.c +++ b/src/vm/jit/intrp/codegen.c @@ -29,7 +29,7 @@ Changes: Edwin Steiner - $Id: codegen.c 5488 2006-09-13 00:21:40Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -1315,6 +1315,7 @@ bool intrp_codegen(jitdata *jd) break; case ICMD_GOTO: /* ... ==> ... */ + case ICMD_RET: /* ... ==> ... */ /* op1 = target JavaVM pc */ gen_branch(GOTO); break; @@ -1324,12 +1325,6 @@ bool intrp_codegen(jitdata *jd) gen_branch(JSR); break; - case ICMD_RET: /* ... ==> ... */ - /* op1 = local variable */ - - gen_RET(cd, index2offset(iptr->op1)); - break; - case ICMD_IFNULL: /* ..., value ==> ... */ /* op1 = target JavaVM pc */ diff --git a/src/vm/jit/mips/codegen.c b/src/vm/jit/mips/codegen.c index 4d2035a86..a182d3b7a 100644 --- a/src/vm/jit/mips/codegen.c +++ b/src/vm/jit/mips/codegen.c @@ -35,7 +35,7 @@ This module generates MIPS machine code for a sequence of intermediate code commands (ICMDs). - $Id: codegen.c 5630 2006-10-02 13:16:20Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -495,9 +495,8 @@ bool codegen(jitdata *jd) case ICMD_DSTORE: /* ..., value ==> ... */ case ICMD_COPY: case ICMD_MOVE: - case ICMD_DUP: - M_COPY(iptr->s1.varindex, iptr->dst.varindex); + emit_copy(jd, iptr, VAROP(iptr->s1), VAROP(iptr->dst)); break; diff --git a/src/vm/jit/mips/codegen.h b/src/vm/jit/mips/codegen.h index 79b324bdc..dec9c43ea 100644 --- a/src/vm/jit/mips/codegen.h +++ b/src/vm/jit/mips/codegen.h @@ -26,7 +26,7 @@ Authors: Andreas Krall - $Id: codegen.h 5615 2006-10-01 22:55:11Z edwin $ + $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $ */ @@ -100,7 +100,6 @@ M_DMOV(a, b); \ } while (0) -#define M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d)) #define ICONST(r,c) emit_iconst(cd, (r), (c)) #define LCONST(r,c) emit_lconst(cd, (r), (c)) diff --git a/src/vm/jit/powerpc/codegen.c b/src/vm/jit/powerpc/codegen.c index de60bdcb1..068233be7 100644 --- a/src/vm/jit/powerpc/codegen.c +++ b/src/vm/jit/powerpc/codegen.c @@ -31,7 +31,7 @@ Christian Ullrich Edwin Steiner - $Id: codegen.c 5631 2006-10-02 13:26:39Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -1995,6 +1995,8 @@ bool codegen(jitdata *jd) break; case ICMD_GOTO: /* ... ==> ... */ + case ICMD_RET: /* ... ==> ... */ + M_BR(0); codegen_addreference(cd, iptr->dst.block); ALIGNCODENOP; @@ -2016,14 +2018,6 @@ bool codegen(jitdata *jd) codegen_addreference(cd, iptr->sx.s23.s3.jsrtarget.block); break; - case ICMD_RET: /* ... ==> ... */ - /* s1.localindex = local variable */ - - M_BR(0); - codegen_addreference(cd, iptr->dst.block); - ALIGNCODENOP; - break; - case ICMD_IFNULL: /* ..., value ==> ... */ s1 = emit_load_s1(jd, iptr, REG_ITMP1); diff --git a/src/vm/jit/powerpc64/codegen.c b/src/vm/jit/powerpc64/codegen.c index 46ff24cb7..62ed26322 100644 --- a/src/vm/jit/powerpc64/codegen.c +++ b/src/vm/jit/powerpc64/codegen.c @@ -31,7 +31,7 @@ Christian Ullrich Edwin Steiner - $Id: codegen.c 5630 2006-10-02 13:16:20Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -524,9 +524,8 @@ bool codegen(jitdata *jd) case ICMD_DSTORE: /* ..., value ==> ... */ case ICMD_COPY: case ICMD_MOVE: - case ICMD_DUP: /* ..., a ==> ..., a, a */ - M_COPY(iptr->s1.varindex, iptr->dst.varindex); + emit_copy(jd, iptr, VAROP(iptr->s1), VAROP(iptr->dst)); break; @@ -1771,6 +1770,7 @@ bool codegen(jitdata *jd) case ICMD_GOTO: /* ... ==> ... */ case ICMD_RET: /* ... ==> ... */ + M_BR(0); codegen_addreference(cd, iptr->dst.block); ALIGNCODENOP; diff --git a/src/vm/jit/powerpc64/codegen.h b/src/vm/jit/powerpc64/codegen.h index 317c0f6c9..b89c80012 100644 --- a/src/vm/jit/powerpc64/codegen.h +++ b/src/vm/jit/powerpc64/codegen.h @@ -31,7 +31,7 @@ Changes: Christian Thalinger Christian Ullrich - $Id: codegen.h 5618 2006-10-01 23:37:04Z edwin $ + $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $ */ @@ -105,7 +105,6 @@ } while (0) -#define M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d)) #define ICONST(d,c) emit_iconst(cd, (d), (c)) #define LCONST(reg,c) ICONST(reg,c) diff --git a/src/vm/jit/x86_64/codegen.c b/src/vm/jit/x86_64/codegen.c index 4d4209536..907202d9b 100644 --- a/src/vm/jit/x86_64/codegen.c +++ b/src/vm/jit/x86_64/codegen.c @@ -30,7 +30,7 @@ Changes: Christian Ullrich Edwin Steiner - $Id: codegen.c 5630 2006-10-02 13:16:20Z edwin $ + $Id: codegen.c 5632 2006-10-02 13:43:15Z edwin $ */ @@ -520,7 +520,7 @@ bool codegen(jitdata *jd) break; - /* load/store operations **********************************************/ + /* load/store/copy/move operations ************************************/ case ICMD_ILOAD: /* ... ==> ..., content of local variable */ case ICMD_ALOAD: /* s1 = local variable */ @@ -532,11 +532,14 @@ bool codegen(jitdata *jd) case ICMD_LSTORE: case ICMD_FSTORE: case ICMD_DSTORE: + case ICMD_COPY: + case ICMD_MOVE: emit_copy(jd, iptr, VAROP(iptr->s1), VAROP(iptr->dst)); break; - /* pop/copy/move operations *******************************************/ + + /* pop operations *****************************************************/ /* attention: double and longs are only one entry in CACAO ICMDs */ @@ -545,11 +548,6 @@ bool codegen(jitdata *jd) break; - case ICMD_COPY: - case ICMD_MOVE: - - M_COPY(iptr->s1.varindex, iptr->dst.varindex); - break; /* integer operations *************************************************/ @@ -2309,6 +2307,7 @@ bool codegen(jitdata *jd) break; case ICMD_GOTO: /* ... ==> ... */ + case ICMD_RET: /* ... ==> ... */ M_JMP_IMM(0); codegen_addreference(cd, iptr->dst.block); @@ -2320,13 +2319,6 @@ bool codegen(jitdata *jd) codegen_addreference(cd, iptr->sx.s23.s3.jsrtarget.block); break; - case ICMD_RET: /* ... ==> ... */ - /* s1.localindex = local variable */ - - M_JMP_IMM(0); - codegen_addreference(cd, iptr->dst.block); - break; - case ICMD_IFNULL: /* ..., value ==> ... */ s1 = emit_load_s1(jd, iptr, REG_ITMP1); diff --git a/src/vm/jit/x86_64/codegen.h b/src/vm/jit/x86_64/codegen.h index 320f76a7c..47da823c6 100644 --- a/src/vm/jit/x86_64/codegen.h +++ b/src/vm/jit/x86_64/codegen.h @@ -29,7 +29,7 @@ Changes: - $Id: codegen.h 5595 2006-09-30 23:06:36Z edwin $ + $Id: codegen.h 5632 2006-10-02 13:43:15Z edwin $ */ @@ -124,8 +124,6 @@ } while (0) -#define M_COPY(s,d) emit_copy(jd, iptr, VAR(s), VAR(d)) - #define ICONST(r,c) \ do { \ if ((c) == 0) \ -- 2.25.1