* src/vm/jit/mips/codegen.c (codegen): Use jd->isleafmethod. Pass
[cacao.git] / src / vm / jit / mips / md-abi.c
index 06bf85251387ef7831bd478d77e4541accb8037a..4c79c29c44f084f3733348ab1494e6ace6181b3c 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Christian Ullrich
 
-   $Id: md-abi.c 4357 2006-01-22 23:33:38Z twisti $
+   $Id: md-abi.c 5114 2006-07-12 14:53:28Z twisti $
 
 */
 
@@ -40,6 +40,7 @@
 
 #include "vm/descriptor.h"
 #include "vm/global.h"
+#include "vm/jit/abi.h"
 
 
 /* register descripton array **************************************************/
@@ -180,44 +181,57 @@ void md_param_alloc(methoddesc *md)
        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]
-                                
+   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 */
+
+void md_return_alloc(jitdata *jd, stackptr stackslot)
+{
+       methodinfo *m;
+       methoddesc *md;
+
+       /* get required compiler data */
+
+       m = jd->m;
+
+       md = m->parseddesc;
+
+       /* 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->varnum  = -1;
+               stackslot->flags   = 0;
+
+               if (IS_INT_LNG_TYPE(md->returntype.type))
                        stackslot->regoff = REG_RESULT;
-               } else { /* float/double */
+               else
                        stackslot->regoff = REG_FRESULT;
-               }
        }
 }
 
+
 /*
  * 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