~ubuntu-branches/ubuntu/quantal/cacao-source/quantal

« back to all changes in this revision

Viewing changes to src/vm/jit/s390/codegen.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-08-24 07:54:07 UTC
  • mfrom: (1.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20100824075407-seloc539zqa1bwl8
Tags: 1.1.0~pre0.1-1
New upstream snapshot, fixing build failures on armel and s390.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* src/vm/jit/s390/codegen.c - machine code generator for s390
2
2
 
3
 
   Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
 
3
   Copyright (C) 1996-2005, 2006, 2007, 2008, 2009, 2010
4
4
   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
5
 
6
6
   This file is part of CACAO.
123
123
{
124
124
        varinfo*    var;
125
125
        methoddesc* md;
126
 
        int32_t     s1;
 
126
        int32_t     s1, s2;
127
127
        int32_t     p, t, l;
128
128
        int32_t     varindex;
129
129
        int         i;
298
298
        fieldinfo*          fi;
299
299
        unresolved_field*   uf;
300
300
        int32_t             fieldtype;
301
 
        int32_t             s1, s2, s3, d;
 
301
        int32_t             s1, s2, s3, d, dd;
302
302
        int32_t             disp;
303
303
 
304
304
        // Get required compiler data.
699
699
                case ICMD_LREM:       /* ..., val1, val2  ==> ..., val1 % val2        */
700
700
 
701
701
                        bte = iptr->sx.s23.s3.bte;
702
 
                        md  = bte->md;
703
702
 
704
703
                        /* test s2 for zero */
705
704
 
1759
1758
                case ICMD_PUTFIELD:   /* ..., objectref, value  ==> ...               */
1760
1759
                        {
1761
1760
                        u1 *ref;
 
1761
                        patchref_t *pr;
1762
1762
 
1763
1763
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
1764
1764
                        emit_nullpointer_check(cd, iptr, s1);
1784
1784
                         */
1785
1785
 
1786
1786
                        if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1787
 
                                patcher_add_patch_ref(jd, PATCHER_get_putfield, uf, 0);
 
1787
                                pr = patcher_add_patch_ref(jd, PATCHER_get_putfield, uf, 0);
1788
1788
                                ref = cd->mcodeptr;
1789
1789
                        }
1790
1790
 
1799
1799
                        }
1800
1800
 
1801
1801
                        if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1802
 
                                ((patchref_t *)list_first(jd->code->patchers))->disp = (cd->mcodeptr - ref);
 
1802
                                pr->disp = (cd->mcodeptr - ref);
1803
1803
                        }
1804
1804
 
1805
1805
                        switch (fieldtype) {
1830
1830
 
1831
1831
                        disp = dseg_add_functionptr(cd, asm_handle_exception);
1832
1832
                        M_ALD_DSEG(REG_ITMP1, disp);
1833
 
                        M_JMP(REG_ITMP1_XPC, REG_ITMP1);
 
1833
                        M_JMP(REG_ITMP2_XPC, REG_ITMP1);
1834
1834
                        M_NOP;
1835
1835
 
1836
1836
                        break;
2888
2888
        M_ALD_DSEG(REG_ITMP1, disp);
2889
2889
        M_CALL(REG_ITMP1);
2890
2890
 
2891
 
        M_MOV(REG_RESULT, REG_ITMP3_XPTR);
 
2891
        M_MOV(REG_RESULT, REG_ITMP1_XPTR);
2892
2892
 
2893
2893
        /* restore return value */
2894
2894
 
2929
2929
 
2930
2930
        /* check for exception */
2931
2931
 
2932
 
        M_TEST(REG_ITMP3_XPTR);
 
2932
        M_TEST(REG_ITMP1_XPTR);
2933
2933
        M_BNE(SZ_BRC + SZ_BCR);                     /* if no exception then return        */
2934
2934
 
2935
2935
        M_RET;
2936
2936
 
2937
2937
        /* handle exception */
2938
2938
 
2939
 
        M_MOV(REG_RA, REG_ITMP1_XPC);
2940
 
        M_ASUB_IMM(2, REG_ITMP1_XPC);
 
2939
        M_MOV(REG_RA, REG_ITMP2_XPC);
 
2940
        M_ASUB_IMM(2, REG_ITMP2_XPC);
2941
2941
 
2942
2942
        disp = dseg_add_functionptr(cd, asm_handle_nat_exception);
2943
2943
        M_ALD_DSEG(REG_ITMP2, disp);