md_return_alloc coded to precolour stack slots holding the return register.
authorchristian <none@none>
Wed, 29 Jun 2005 12:40:42 +0000 (12:40 +0000)
committerchristian <none@none>
Wed, 29 Jun 2005 12:40:42 +0000 (12:40 +0000)
rd->arg[int|flt]reguse calculation in md_param_alloc corrected.

src/vm/jit/alpha/md-abi.c
src/vm/jit/mips/md-abi.c

index 5662e5ca549cb7dac7aa0ec91e57abfda6fe88ed..39d1c4716e785b16054d2fa4c28b7993c1bc2a6c 100644 (file)
@@ -26,9 +26,9 @@
 
    Authors: Christian Thalinger
 
-   Changes:
+   Changes: Christian Ullrich
 
-   $Id: md-abi.c 2615 2005-06-08 20:54:18Z twisti $
+   $Id: md-abi.c 2871 2005-06-29 12:40:42Z christian $
 
 */
 
@@ -71,6 +71,8 @@ void md_param_alloc(methoddesc *md)
                                pd->inmemory = false;
                                pd->regoff = reguse;
                                reguse++;
+                               md->argintreguse = reguse;
+
                        } else {
                                pd->inmemory = true;
                                pd->regoff = stacksize;
@@ -83,6 +85,7 @@ void md_param_alloc(methoddesc *md)
                                pd->inmemory = false;
                                pd->regoff = reguse;
                                reguse++;
+                               md->argfltreguse = reguse;
                        } else {
                                pd->inmemory = true;
                                pd->regoff = stacksize;
@@ -94,11 +97,46 @@ void md_param_alloc(methoddesc *md)
 
        /* fill register and stack usage */
 
-       md->argintreguse = i;
-       md->argfltreguse = i;
        md->memuse = stacksize;
 }
 
+/* md_return_alloc *************************************************************
+
+ Precolor the Java Stackelement containing the Return Value. Since alpha
+ has a dedicated return register (not an reused arg or reserved reg), this
+ is striaghtforward possible, as long, as this stackelement does not have to
+ survive a method invokation (SAVEDVAR)
+
+--- in
+m:                       Methodinfo of current method
+return_type:             Return Type of the Method (TYPE_INT.. TYPE_ADR)
+                         TYPE_VOID is not allowed!
+stackslot:               Java Stackslot to contain the Return Value
+
+--- out
+if precoloring was possible:
+stackslot->varkind       =ARGVAR
+         ->varnum        =-1
+                ->flags         =0
+                ->regoff        =[REG_RESULT, REG_FRESULT]
+                                
+
+*******************************************************************************/
+void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
+                                        stackptr stackslot) {
+       /* Only precolor the stackslot, if it is not a SAVEDVAR <-> has not   */
+       /* to survive method invokations */
+       if (!(stackslot->flags & SAVEDVAR)) {
+               stackslot->varkind = ARGVAR;
+               stackslot->varnum = -1;
+               stackslot->flags = 0;
+               if ( IS_INT_LNG_TYPE(return_type) ) {
+                       stackslot->regoff = REG_RESULT;
+               } else { /* float/double */
+                       stackslot->regoff = REG_FRESULT;
+               }
+       }
+}
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 8ef7bf2a3c17bfc3faa3786912b11de10b3e04b9..2b2ed906a30c7982416f8aeaa8c96ba57a045925 100644 (file)
@@ -26,9 +26,9 @@
 
    Authors: Christian Thalinger
 
-   Changes:
+   Changes: Christian Ullrich
 
-   $Id: md-abi.c 2631 2005-06-09 21:23:11Z twisti $
+   $Id: md-abi.c 2871 2005-06-29 12:40:42Z christian $
 
 */
 
@@ -71,6 +71,7 @@ void md_param_alloc(methoddesc *md)
                                pd->inmemory = false;
                                pd->regoff = reguse;
                                reguse++;
+                               md->argintreguse = reguse;
                        } else {
                                pd->inmemory = true;
                                pd->regoff = stacksize;
@@ -83,6 +84,7 @@ void md_param_alloc(methoddesc *md)
                                pd->inmemory = false;
                                pd->regoff = reguse;
                                reguse++;
+                               md->argfltreguse = reguse;
                        } else {
                                pd->inmemory = true;
                                pd->regoff = stacksize;
@@ -94,11 +96,46 @@ void md_param_alloc(methoddesc *md)
 
        /* fill register and stack usage */
 
-       md->argintreguse = i;
-       md->argfltreguse = i;
        md->memuse = stacksize;
 }
 
+/* md_return_alloc *************************************************************
+
+ Precolor the Java Stackelement containing the Return Value. Since mips
+ has a dedicated return register (not an reused arg or reserved reg), this
+ is striaghtforward possible, as long, as this stackelement does not have to
+ survive a method invokation (SAVEDVAR)
+
+--- in
+m:                       Methodinfo of current method
+return_type:             Return Type of the Method (TYPE_INT.. TYPE_ADR)
+                         TYPE_VOID is not allowed!
+stackslot:               Java Stackslot to contain the Return Value
+
+--- out
+if precoloring was possible:
+stackslot->varkind       =ARGVAR
+         ->varnum        =-1
+                ->flags         =0
+                ->regoff        =[REG_RESULT, REG_FRESULT]
+                                
+
+*******************************************************************************/
+void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
+                                        stackptr stackslot) {
+       /* Only precolor the stackslot, if it is not a SAVEDVAR <-> has not   */
+       /* to survive method invokations */
+       if (!(stackslot->flags & SAVEDVAR)) {
+               stackslot->varkind = ARGVAR;
+               stackslot->varnum = -1;
+               stackslot->flags = 0;
+               if ( IS_INT_LNG_TYPE(return_type) ) {
+                       stackslot->regoff = REG_RESULT;
+               } else { /* float/double */
+                       stackslot->regoff = REG_FRESULT;
+               }
+       }
+}
 
 /*
  * These are local overrides for various environment variables in Emacs.