5 #include "vm/jit/sparc64/md-abi.h"
7 #include "vm/descriptor.h"
11 /* register descripton array **************************************************/
13 /* callee point-of-view, after SAVE has been called */
15 /* zero itmp1/g1 itmp2/g2 itmp3/g3 temp/g4 temp/g5 sys/g6 sys/g7 */
16 REG_RES, REG_RES, REG_RES, REG_RES, REG_TMP, REG_TMP, REG_RES, REG_RES,
18 /* o0 o1 o2 o3 o4 o5 sp/o6 o7 */
19 REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_RES, REG_TMP,
21 /* l0 l1 l2 l3 l4 l5 l6 l7 */
22 REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV,
24 /* i0 i1 i2 i3 i4 pv/i5 fp/i6 ra/i7 */
25 REG_RET, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_RES, REG_RES, REG_RES,
28 /* XXX i1 - i4: SAV OR ARG ??? */
31 s4 nregdescfloat[] = {
32 REG_RET, REG_RES, REG_RES, REG_RES, REG_TMP, REG_TMP, REG_TMP, REG_TMP,
33 REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_SAV, REG_SAV, REG_SAV, REG_SAV,
38 /* md_param_alloc **************************************************************
42 *******************************************************************************/
44 void md_param_alloc(methoddesc *md)
51 /* set default values */
56 /* get params field of methoddesc */
60 for (i = 0; i < md->paramcount; i++, pd++) {
61 switch (md->paramtypes[i].type) {
65 if (i < INT_ARG_CNT) {
69 md->argintreguse = reguse;
73 pd->regoff = stacksize;
79 if (i < FLT_ARG_CNT) {
83 md->argfltreguse = reguse;
86 pd->regoff = stacksize;
93 /* fill register and stack usage */
95 md->memuse = stacksize;
99 /* md_return_alloc *************************************************************
101 Precolor the Java Stackelement containing the Return Value. Since
102 alpha has a dedicated return register (not an reused arg or
103 reserved reg), this is striaghtforward possible, as long, as this
104 stackelement does not have to survive a method invokation
108 m: Methodinfo of current method
109 return_type: Return Type of the Method (TYPE_INT.. TYPE_ADR)
110 TYPE_VOID is not allowed!
111 stackslot: Java Stackslot to contain the Return Value
114 if precoloring was possible:
115 stackslot->varkind =ARGVAR
118 ->regoff =[REG_RESULT, REG_FRESULT]
120 *******************************************************************************/
122 void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
125 /* Only precolor the stackslot, if it is not used for parameter precoloring AND */
126 /* it is not a SAVEDVAR <-> has not to survive method invokations */
128 if (!m->isleafmethod || (m->parseddesc->paramcount == 0)) {
130 if (!(stackslot->flags & SAVEDVAR)) {
131 stackslot->varkind = ARGVAR;
132 stackslot->varnum = -1;
133 stackslot->flags = 0;
135 if (IS_INT_LNG_TYPE(return_type)) {
136 stackslot->regoff = REG_RESULT_CALLEE;
137 } else { /* float/double */
138 stackslot->regoff = REG_FRESULT;
146 * These are local overrides for various environment variables in Emacs.
147 * Please do not remove this and leave it at the end of the file, where
148 * Emacs will automagically detect them.
149 * ---------------------------------------------------------------------
152 * indent-tabs-mode: t