* src/vm/jit/m68k/linux/md-abi.c (abi_registers_integer_saved): Fixed.
authortbfg <none@none>
Thu, 19 Apr 2007 15:01:49 +0000 (15:01 +0000)
committertbfg <none@none>
Thu, 19 Apr 2007 15:01:49 +0000 (15:01 +0000)
(abi_registers_float_saved): Fixed.

* src/vm/jit/m68k/emit.c (emit_classcast_check): Fixed.

* src/vm/jit/m68k/codegen.c (codegen_emit): Temporary hacked
a field for saved adr registers until real patch will be done.
(ICMD_INSTANCEOF): Fixed.
(ICMD_CHECKCAST): Fixed.
(codegen_emit_stub_compiler): Removed useless code.

* src/vm/jit/m68k/asmpart.S (L_asm_handle_exception_not_catched):
Implemented.

* src/vm/jit/m68k/codegen.h (M_BLS): Added.

21 files changed:
src/vm/jit/allocator/simplereg.c
src/vm/jit/arm/asmpart.S
src/vm/jit/arm/codegen.c
src/vm/jit/i386/emit.c
src/vm/jit/inline/inline.c
src/vm/jit/jit.h
src/vm/jit/m68k/asmpart.S
src/vm/jit/m68k/codegen.c
src/vm/jit/m68k/codegen.h
src/vm/jit/m68k/emit.c
src/vm/jit/m68k/linux/md-abi.c
src/vm/jit/mips/codegen.c
src/vm/jit/parse.c
src/vm/jit/powerpc64/codegen.c
src/vm/jit/powerpc64/linux/Makefile.am
src/vm/jit/s390/codegen.c
src/vm/jit/s390/emit.c
src/vm/jit/stack.c
src/vm/jit/verify/typecheck.c
src/vm/jit/verify/typeinfo.c
src/vm/jit/x86_64/emit.c

index 869213129a5d41e58e3b8bfe65ef27282d1daf58..cb7d743f473829af359d6d1bc2d8d3e28f866f9d 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.
 
-   $Id: simplereg.c 7743 2007-04-17 20:53:41Z edwin $
+   $Id: simplereg.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index d6dd7b7d07bafea045c85d194668c5bf55b82ead..b88d6bf2298285c2ec027bb9b87d2079d2dba9bd 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: asmpart.S 7763 2007-04-19 12:19:19Z michi $
+   $Id: asmpart.S 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index 28ffc5b45985283919e8b79ca5cbbb3e9627390c..d888916551851d7c74623d239022e09b76375e8d 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: codegen.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index 6537e3d8a792127edbc3f3cd243026e078e3e559..68fbed54a78c8c6d1e235f569b2347037fdb46e0 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: emit.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index ad02e167832e2836da8ad70ec09e036bd163dd9c..cbda14347a5ce1afd4a0fc6056b3d90358ac7128 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: inline.c 7743 2007-04-17 20:53:41Z edwin $
+   $Id: inline.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index 9861e4839d363a8d67eec7d4a0d8ee697af2da4a..f0e61094bf9cfa63bc897a120111f1b64d45f163 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jit.h 7742 2007-04-17 20:37:36Z edwin $
+   $Id: jit.h 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index d9152d0e13944c04a8031b3a349c87e0b0e323b1..9a70193af67195a03a164be16c3c5cc720e99890 100644 (file)
@@ -6,6 +6,8 @@
 #include "config.h"
 
 #include "vm/jit/m68k/offsets.h"
+#include "md-abi.h"
+#include "vm/jit/methodheader.h"
 
 .data
 call_jit_dummy:
@@ -288,9 +290,54 @@ L_asm_handle_exception_stack_loop:
 
        /* %d0 contains address of exception handler */
        moveal  %d0, %a0
-       jsr     %a0@
+       jmp     %a0@
 
 L_asm_handle_exception_not_catched:
-       jsr 0
+       /* we did not find an exception handler in this stackframe */
+       /* remove this frame and search in the one above */
+       /* %a2 containts exception object ptr, %d2 the actual pv */
+       moveal  %d2, %a3
+       movel   %a3@(FrameSize), %d2
+
+       moveal  %sp, %a0
+       addal   %d2, %a0        /* %a0 now points to top of stackframe, where saved regs are */
+
+       /* the saved registers have to be restored */
+       /* XXX ugly hack: intsave and adrsave share one field */
+       movel   %a3@(IntSave), %d0
+       andil   #0x0000ffff, %d0        /* this is IntSave */
+       cmpb    #0,%d0
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d7
+
+       cmpb    #1,%d0
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d6
+
+       cmpb    #2,%d0 
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d5
+
+L_asm_handle_ex_int_done:
+
+       movel   %a3@(IntSave), %d0
+       andil   #0xffff0000, %d0        /* this is AdrSave */
+       tstl    %d0
+       beq     L_handle_exception_nat_catched_no_adr
+       moveal  (%a0)+, %a5
+L_handle_exception_nat_catched_no_adr:
+
+#if !defined(ENABLE_SOFTFLOAT)
+       FIXME
+#else
+       /* nothing to do */
+#endif
+       addal   %d2, %sp                /* remove old stackframe */
+       moveal  %sp@(0), %a3            /* make return address, new exception rasing address */
+       addal   #4,%sp                  /* remove return address fromstack */
+       subal   #2, %a3                 /* it was a jsr %aX, which is 4 bytes long */
+       jmp     L_asm_handle_exception_stack_loop
+
+
 illegal
 .long 0x23234242
index 65f6c5c68860f46075a2303d15e267013afd70dd..b0f0899c86c3103bd0260430b3a88a2781f1bcc2 100644 (file)
@@ -125,9 +125,11 @@ bool codegen_emit(jitdata *jd)
                        (void) dseg_add_unique_s4(cd, (rd->memuse + 1) * 4);/* IsSync         */
                else
 #endif
-                       (void) dseg_add_unique_s4(cd, 0);                  /* IsSync          */
+               (void) dseg_add_unique_s4(cd, 0);                      /* IsSync          */
                (void) dseg_add_unique_s4(cd, jd->isleafmethod);       /* IsLeaf          */
-               (void) dseg_add_unique_s4(cd, INT_SAV_CNT - rd->savintreguse); /* IntSave */
+
+               /* XXX we use the IntSAce a split field for the adr now */
+               (void) dseg_add_unique_s4(cd, (ADR_SAV_CNT - rd->savadrreguse) << 16 | (INT_SAV_CNT - rd->savintreguse)); /* IntSave */
                (void) dseg_add_unique_s4(cd, FLT_SAV_CNT - rd->savfltreguse); /* FltSave */
 
                dseg_addlinenumbertablesize(cd);
@@ -1647,8 +1649,8 @@ nowperformreturn:
                                codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
 #endif
                                M_ISUB(REG_ITMP3, REG_ITMP1);
-                               M_ICMP(REG_ITMP1, REG_ITMP2);
-                               M_BGT(4);
+                               M_ICMP(REG_ITMP2, REG_ITMP1);
+                               M_BHI(4);
                                M_IMOV_IMM(1, d);
                                M_TPFW;                 /* overlaps next instruction */
                                M_ICLR(d);
@@ -1763,28 +1765,14 @@ nowperformreturn:
                                        codegen_threadcritstart(cd, cd->mcodeptr - cd->mcodebase);
 #endif
                                        M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));  /* REG_ITMP3 == sub->vftbl->baseval */
-#if 0
-                                       if (s1 != REG_ATMP1) {
-#endif
-                                               M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
-                                               M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
-#if defined(ENABLE_THREADS)
-                                               codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
-#endif
-                                               M_ISUB(REG_ITMP1, REG_ITMP3);
-                                               M_ICMP(REG_ITMP2, REG_ITMP1);   /* XXX was CMPU */
-#if 0                                  
-                                       } else {
-                                               assert(0);
-                                               M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, baseval));
-                                               M_ISUB(REG_ITMP3, REG_ITMP2);
-                                               M_ILD(REG_ITMP3, REG_ATMP3, OFFSET(vftbl_t, diffval));
-                                               M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
+                                       M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
+                                       M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
 #if defined(ENABLE_THREADS)
                                                codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
 #endif
-                                       }
-#endif
+                                       M_ISUB(REG_ITMP1, REG_ITMP3);
+                                       M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
+
                                        emit_classcast_check(cd, iptr, BRANCH_UGT, REG_ITMP3, s1); /* XXX was BRANCH_GT */
 
                                        if (super != NULL)
@@ -1930,8 +1918,8 @@ void codegen_emit_stub_compiler(jitdata *jd)
 
        M_AMOV_IMM(m, REG_ATMP1);
        M_AMOV_IMM(asm_call_jit_compiler, REG_ATMP3);
-       M_JMP_IMM(asm_call_jit_compiler);
-       M_RET;
+       M_JMP(REG_ATMP3);
+       M_JMP_IMM(0);   /* FIXME: remove me */
 }
 
 
index 90d42e0169e74dd46f4e4e519a6999236872f075..c86ffda3f1e7191c83c007cb26269489696f9b7d 100644 (file)
 #define M_BHI_16(a)                    BRANCH16(0x2, (a))
 #define M_BHI_32(a)                    BRANCH32(0x2, (a))
 
+#define M_BLS(a)                       BRANCH8 (0x3, (a))
+
 #define        M_BMI(a)                        BRANCH8(0xb, (a))
 #define M_BPL(a)                       BRANCH8(0xa, (a))
 
index b36a26b2ad9d9b7cb4f4ca0612839b735aab3334..7264992168a16965464361a52230297388bd2a0c 100644 (file)
@@ -621,7 +621,7 @@ void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 r
                        M_BLE(4);
                        break;
                case BRANCH_UGT:
-                       M_BHI(4);
+                       M_BLS(4);
                        break;
                default:
                        vm_abort("emit_classcast_check: unknown condition %d", condition);
index b315acf0022437ecc24e1e3295911e53dfd68800..37735f57dfb574688920acdbb02094d5fff16df9 100644 (file)
@@ -45,7 +45,7 @@ s4 nregdescint[] = { REG_TMP, REG_TMP, REG_RES, REG_RES, REG_RES, REG_SAV, REG_S
 const char *abi_registers_integer_name [] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7" };
 
 const s4 abi_registers_integer_argument[]      ;
-const s4 abi_registers_integer_saved[]                 = {2,3,4,5,6,7};
+const s4 abi_registers_integer_saved[]                 = {5,6,7};
 const s4 abi_registers_integer_temporary[]     = {0,1};
 
 /* Address register description */
@@ -65,7 +65,7 @@ s4 nregdescfloat[] = { REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG
 const char *abi_registers_float_name [] = { "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7" };
 
 const s4 abi_registers_float_argument[]        ;
-const s4 abi_registers_float_saved[]           = {2,3,4,5,6,7};
+const s4 abi_registers_float_saved[]           = {5,6,7};
 const s4 abi_registers_float_temporary[]       = {0,1};
 
 
index cabbcea650d7524a08d2823c07ed1d9ad9138c76..9b1faa088ecd61764e510a17868a34283c118729 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: codegen.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index e4aa616fb7ebc3a0e82d8709f1b667725cc42af2..2575c3308b1d0f5345849b8ef04f0d0ccdea5a45 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: parse.c 7735 2007-04-17 18:47:50Z edwin $
+   $Id: parse.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index 34f0b30bab4002c52073666787200a0195b3ab70..75c9de688725af4c6cc2176ee24a4744745c5d31 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7757 2007-04-18 14:49:18Z tbfg $
+   $Id: codegen.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index fee51970f43424427e5bcf1c383ec7b12b83270b..38c7e085b2c46cae5ffa9ff426c05a47af5da2b7 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## Changes:
 ##
-## $Id: Makefile.am 7758 2007-04-18 15:31:07Z michi $
+## $Id: Makefile.am 7766 2007-04-19 13:24:48Z michi $
 
 ## Process this file with automake to produce Makefile.in
 
index 6cb48650b615db084247cac2590c98df9ed89088..e349712d1dcf8719149b0dd3f4da1c20556ca0e0 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: codegen.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index ad0dd1ab6230ac081eb419823318191cb1a45ded..0f88e31a8997f7b726ab32c8ab68d45d3bbf398d 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: emit.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index d0c6fc94c648aebd6ae34ef00f20ed8413dbe9fc..89ae9c0e9578cb81d8f3cbdd3e5ea4fb4418ef8e 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: stack.c 7749 2007-04-17 21:30:20Z edwin $
+   $Id: stack.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index d7e7f55aa28610491d55f1598daa2d1c60993164..cf24b0726a3d19ae359ed70cb0e716cec40b495c 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typecheck.c 7746 2007-04-17 21:01:15Z edwin $
+   $Id: typecheck.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index 7cc8bb446ddc925a61b2eaee3fdfe863e09d1f9b..e17dfe28bad416ee99f046f5e2261ee5632f2250 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typeinfo.c 7743 2007-04-17 20:53:41Z edwin $
+   $Id: typeinfo.c 7766 2007-04-19 13:24:48Z michi $
 
 */
 
index ef54762e6c505f61133f87a825aaea0fd6c37a67..a7d9f0017ebefa76fe7a1947b143d4e4657acb68 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 7754 2007-04-17 23:18:15Z twisti $
+   $Id: emit.c 7766 2007-04-19 13:24:48Z michi $
 
 */