* src/vm/jit/s390/md.c (md_dump_context): Added. Fatal signals now print the context...
authorpm <none@none>
Tue, 1 May 2007 21:40:26 +0000 (21:40 +0000)
committerpm <none@none>
Tue, 1 May 2007 21:40:26 +0000 (21:40 +0000)
* src/vm/jit/s390/emit.h (emit_restore_pv): Added. Fixes bug where REG_PV recalculation uses dseg value to recalculate REG_PV.
* src/vm/jit/s390/emit.c: Likewise.
* src/vm/jit/s390/codegen.h (N_RI, N_RI2): Test immediate operand for correct signedness.
* src/vm/jit/s390/codegen.c (codegen_emit): Use emit_restore_pv for REG_PV recalculation/
* src/vm/jit/s390/disass.c (disass_pseudo_instr): Fix formating.
* src/vm/jit/s390/tests/dacapo.status: Added.

src/vm/jit/s390/codegen.c
src/vm/jit/s390/codegen.h
src/vm/jit/s390/disass.c
src/vm/jit/s390/emit.c
src/vm/jit/s390/emit.h
src/vm/jit/s390/md.c
src/vm/jit/s390/tests/dacapo.status [new file with mode: 0644]

index 961eb1ff5afdd512ef36adf26ece63c0b4c251cb..bf0b938813b8e60723e0c45f3aff4ffab4ecda81 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7845 2007-05-01 16:05:07Z pm $
+   $Id: codegen.c 7848 2007-05-01 21:40:26Z pm $
 
 */
 
@@ -2749,9 +2749,7 @@ gen_method:
 
                        M_CALL(REG_PV);
                        REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr);
-                       N_BASR(REG_PV, RN);
-                       disp = (s4) (cd->mcodeptr - cd->mcodebase);
-                       M_ASUB_IMM32(disp, REG_ITMP1, REG_PV);
+                       emit_restore_pv(cd);
        
                        /* post call finalization */
 
index e6c3e9d5aa0c4d0f5e0e416e95aeb67699092288..5d01e252eb97a281bc0ede0a10f0b610c239fbfb 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.h 7846 2007-05-01 16:14:00Z pm $
+   $Id: codegen.h 7848 2007-05-01 21:40:26Z pm $
 
 */
 
 #define SZ_RX 4
 
 #define N_RI(op1, op2, r1, i2) \
-       _CODE4( (_OP(op1) << 24) | (_R(r1) << 20) | (_OP4(op2) << 16) | (u2)_I16(i2) )
+       _CODE4( (_OP(op1) << 24) | (_R(r1) << 20) | (_OP4(op2) << 16) | (u2)_SI16(i2) )
+
+#define N_RI2(op1, op2, r1, i2) \
+       _CODE4( (_OP(op1) << 24) | (_R(r1) << 20) | (_OP4(op2) << 16) | (u2)_UI16(i2) )
 
 #define SZ_RI 4
 
 #define N_BALR(r1, r2) N_RR(0x05, r1, _OR(r2))
 #define N_BAL(r1, d2, x2, b2) N_RX(0x45, r1, d2, x2, b2)
 #define N_BASR(r1, r2) N_RR(0x0D, r1, _OR(r2))
+#      define SZ_BASR SZ_RR
 #define N_BAS(r1, d2, x2, b2) N_RX(0x4D, r1, d2, x2, b2)
 #define N_BASSM(r1, r2) N_RR(0x0C, r1, _OR(r2))
 #define N_BSM(r1, r2) N_RR(0x0B, r1, _OR(r2))
 #define N_SVC(i) N_RR2(0x0A, i)
 #define N_TS(d2, b2) N_S2(0x93, d2, b2)
 #define N_TM(d1, b1, i2) N_SI(0x91, d1, b1, i2)
-#define N_TMH(r1, i2) N_RI(0xA7, 0x00, r1, i2)
-#define N_TML(r1, i2) N_RI(0xA7, 0x01, r1, i2)
+#define N_TMH(r1, i2) N_RI2(0xA7, 0x00, r1, i2)
+#define N_TML(r1, i2) N_RI2(0xA7, 0x01, r1, i2)
 #define N_TR(d1, l, b1, d2, b2) N_SS(0xDC, d1, (l - 1), b1, d2, b2)
 #define N_TRT(d1, l, b1, d2, b2) N_SS(0xDD, d1, (l - 1), b1, d2, b2)
 #define N_TRE(r1, r2) N_RRE(0xB2A5, r1, r2)
index cb15d1a1c03e2e692ed595f4313491c778dccbaf..234ad92786940c5b309d6d431e2365fac75da4a4 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: disass.c 7845 2007-05-01 16:05:07Z pm $
+   $Id: disass.c 7848 2007-05-01 21:40:26Z pm $
 
 */
 
@@ -85,7 +85,7 @@ static s4 disass_pseudo_instr(u1 *code) {
        switch (code[0]) {
                /* Trap */
                case 0x02:
-                       snprintf(disass_buf, 512, "ill\t 0x%02hhx (pseudo)", code[1]);
+                       snprintf(disass_buf, 512, "ill\t0x%02hhx (pseudo)", code[1]);
                        return 2;
                /* Not recognized */
                default:
index 8d8a38fef5846b11cf8695e0180f608e3dc3cfbe..ff0b786a875a2ea52eb293cba7a7e8540685a3b7 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 7839 2007-04-29 22:46:56Z pm $
+   $Id: emit.c 7848 2007-05-01 21:40:26Z pm $
 
 */
 
@@ -932,6 +932,39 @@ void emit_exception_check(codegendata *cd, instruction *iptr) {
        }
 }
 
+void emit_restore_pv(codegendata *cd) {
+       s4 offset;
+
+       /*
+       N_BASR(REG_PV, RN);
+       disp = (s4) (cd->mcodeptr - cd->mcodebase);
+       M_ASUB_IMM32(disp, REG_ITMP1, REG_PV);
+       */
+
+       /* If the offset from the method start does not fit into an immediate
+        * value, we can't put it into the data segment!
+        */
+
+       /* Displacement from start of method to here */
+
+       offset = (s4) (cd->mcodeptr - cd->mcodebase);
+
+       if (N_VALID_IMM(-(offset + SZ_BASR))) {
+               /* Get program counter */
+               N_BASR(REG_PV, RN);
+               /* Substract displacement */
+               M_ASUB_IMM(offset + SZ_BASR, REG_PV);
+       } else {
+               /* Save program counter and jump over displacement in instruction flow */
+               N_BRAS(REG_PV, SZ_BRAS + SZ_LONG);
+               /* Place displacement here */
+               /* REG_PV points now exactly to this position */
+               N_LONG(offset + SZ_BRAS);
+               /* Substract *(REG_PV) from REG_PV */
+               N_S(REG_PV, 0, RN, REG_PV);
+       }
+}
+
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where
index 834e9ffb7540938f95d1e50e20d64cb87ab9bcfb..a8d6654001deedd6ebc1c15708ac32b8e53b4a44 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: emit.h 7839 2007-04-29 22:46:56Z pm $
+   $Id: emit.h 7848 2007-05-01 21:40:26Z pm $
 
 */
 
@@ -60,6 +60,9 @@ void emit_restore_dst_even_odd(jitdata *jd, instruction *iptr, s4 htmpreg, s4 lt
  */
 void emit_copy_dst(jitdata *jd, instruction *iptr, s4 dtmpreg);
 
+/* Emits code to recalculate the PV (procedure vector) after a subroutine call. */
+void emit_restore_pv(codegendata *cd);
+
 #endif /* _MD_EMIT_H */
 
 
index ac84e08164c18ed2bb22b4788b2c580aa71cd3a1..6129ff20a1db309d808130c084cb6b6cd47a9d6b 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: md.c 7839 2007-04-29 22:46:56Z pm $
+   $Id: md.c 7848 2007-05-01 21:40:26Z pm $
 
 */
 
@@ -43,6 +43,7 @@
 #include "vm/jit/s390/md-abi.h"
 
 #if defined(ENABLE_THREADS)
+# include "threads/threads-common.h"
 # include "threads/native/threads.h"
 #endif
 
@@ -66,6 +67,8 @@
 
 void md_signal_handler_sigill(int sig, siginfo_t *siginfo, void *_p);
 
+void md_dump_context(u1 *pc, mcontext_t *mc);
+
 /* md_init *********************************************************************
 
    Do some machine dependent initialization.
@@ -84,6 +87,48 @@ void md_init(void)
        }
 }
 
+/* md_dump_context ************************************************************
+   Logs the machine context
+  
+*******************************************************************************/
+
+void md_dump_context(u1 *pc, mcontext_t *mc) {
+       int i;
+       
+       union {
+               u8 l;
+               fpreg_t fr;
+       } freg;
+
+       log_println("Dumping context.");
+
+       log_println("Program counter: 0x%08X", pc);
+
+#if defined(ENABLE_DISASSEMBLER)
+       log_println("Printing instruction at program counter:");
+       disassinstr(pc);
+#endif
+
+       log_println("General purpose registers:");
+
+       for (i = 0; i < 16; i++) {
+               log_println("\tr%d:\t0x%08X\t%d", i, mc->gregs[i], mc->gregs[i]);
+       }
+
+       log_println("Floating point registers:");
+
+       for (i = 0; i < 16; i++) {
+               freg.fr.d = mc->fpregs.fprs[i].d;
+               log_println("\tf%d\t0x%016llX\t(double)%e\t(float)%f", i, freg.l, freg.fr.d, freg.fr.f);
+       }
+
+#if defined(ENABLE_THREADS)
+       log_println("Dumping the current stacktrace:");
+       threads_print_stacktrace();
+#endif
+
+}
 
 /* md_signal_handler_sigsegv ***************************************************
 
@@ -128,6 +173,9 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        }
 
        if (! is_null) {
+#if !defined(NDEBUG)
+               md_dump_context(xpc, _mc);
+#endif
                vm_abort("%s: segmentation fault at %p, aborting.", __FUNCTION__, xpc);
        }
 
@@ -181,6 +229,9 @@ void md_signal_handler_sigill(int sig, siginfo_t *siginfo, void *_p) {
                _mc->psw.addr = (ptrint) asm_handle_exception;
 
        } else {
+#if !defined(NDEBUG)
+               md_dump_context(xpc, _mc);
+#endif
                vm_abort("%s: illegal instruction at %p, aborting.", __FUNCTION__, xpc);
        }
 }
@@ -257,6 +308,9 @@ void md_signal_handler_sigfpe(int sig, siginfo_t *siginfo, void *_p)
 
        /* Could not handle signal */
 
+#if !defined(NDEBUG)
+       md_dump_context(xpc, _mc);
+#endif
        vm_abort("%s: floating point exception at %p, aborting.", __FUNCTION__, xpc);
 }
 
diff --git a/src/vm/jit/s390/tests/dacapo.status b/src/vm/jit/s390/tests/dacapo.status
new file mode 100644 (file)
index 0000000..49767ae
--- /dev/null
@@ -0,0 +1,53 @@
+antlr
+
+       * parses one or more grammar files and generates a parser and lexical analyzer for each.
+       * Tue May  1 18:49:29 CEST 2007: ===== DaCapo antlr PASSED in 37095 msec =====
+
+bloat
+
+       * performs a number of optimizations and analysis on Java bytecode files
+       * Tue May  1 18:55:16 CEST 2007: ===== DaCapo bloat PASSED in 266735 msec =====
+
+chart
+
+       * uses JFreeChart to plot a number of complex line graphs and renders them as PDF
+
+eclipse
+
+       * executes some of the (non-gui) jdt performance tests for the Eclipse IDE
+
+fop
+
+       * takes an XSL-FO file, parses it and formats it, generating a PDF file.
+       * Tue May  1 22:10:03 CEST 2007: ===== DaCapo fop PASSED in 83230 msec =====
+
+hsqldb
+
+       * executes a JDBCbench-like in-memory benchmark, executing a number of transactions against a model of a banking application
+       * Tue May  1 19:37:46 CEST 2007: ===== DaCapo hsqldb PASSED in 72187 msec =====
+
+jython
+
+       * inteprets a the pybench Python benchmark
+       * Tue May  1 19:23:18 CEST 2007: ===== DaCapo jython PASSED in 190386 msec =====
+
+luindex
+
+       * Uses lucene to indexes a set of documents; the works of Shakespeare and the King James Bible
+
+lusearch
+
+       * Uses lucene to do a text search of keywords over a corpus of data comprising the works of Shakespeare and the King James Bible
+
+pmd
+
+       * analyzes a set of Java classes for a range of source code problems
+       * Tue May  1 22:12:57 CEST 2007: ===== DaCapo pmd PASSED in 43427 msec =====
+
+xalan
+
+       * transforms XML documents into HTML
+       * Tue May  1 23:26:33 CEST 2007
+               LOG: [0x77dc66c0] Generating code: org.apache.xalan.processor.XSLTSchema.build()V
+               32834 (0x8042) is not an signed 16 bit integer at /home/peter/cacao-dev/build-s390/../svn/src/vm/jit/s390/emit.c:258.
+               => branch to patcher overflow