X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Fs390%2Fmd-abi.c;h=52bb25a722300cb546284407851b87b6028cfef6;hb=fa3fb41985bc911b5300f144b740159ac0c1eea0;hp=0257c5a2c9085efb317d252f3eec489cf67e5900;hpb=3d370ee4767183306866236d2ff06be53a96a4c0;p=cacao.git diff --git a/src/vm/jit/s390/md-abi.c b/src/vm/jit/s390/md-abi.c index 0257c5a2c..52bb25a72 100644 --- a/src/vm/jit/s390/md-abi.c +++ b/src/vm/jit/s390/md-abi.c @@ -1,9 +1,7 @@ -/* src/vm/jit/x86_64/md-abi.c - functions for x86_64 Linux ABI +/* src/vm/jit/s390/md-abi.c - s390 Linux ABI - Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel, - C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring, - E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, - J. Wenninger, Institut f. Computersprachen - TU Wien + Copyright (C) 1996-2005, 2006, 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -22,34 +20,30 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Contact: cacao@cacaojvm.org - - Authors: Christian Thalinger - - Changes: - - $Id: md-abi.c 8298 2007-08-12 18:49:16Z pm $ - */ #include "config.h" + +#include "vm/descriptor.hpp" +#include "vm/global.h" #include "vm/types.h" +#include "vm/jit/jit.hpp" +#include "vm/jit/stack.h" + #include "vm/jit/s390/md-abi.h" -#include "vmcore/descriptor.h" -#include "vm/global.h" -#include "vm/jit/jit.h" +#include /* register descripton array **************************************************/ s4 nregdescint[] = { - /* r0, itmp1, a0, a1, a2, a3, a4, s0, */ - REG_TMP, REG_RES, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_SAV, - /* s1, s2, s3, s4, itmp2, pv, ra/itmp3, sp */ - REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_RES, REG_RES, REG_RES, REG_RES, + /*itmp3, itmp1, a0, a1, a2, a3, a4, s0, */ + REG_RES, REG_RES, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_SAV, + /* s1, s2, s3, s4, s5, pv, ra/itmp2, sp */ + REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_RES, REG_RES, REG_RES, REG_END }; @@ -73,15 +67,16 @@ const s4 abi_registers_integer_saved[] = { 8, /* r8/s1 */ 9, /* r9/s2 */ 10, /* r10/s3 */ - 11 /* r11/s4 */ + 11, /* r11/s4 */ + 12 /* r12/s5 */ }; const s4 abi_registers_integer_temporary[] = { - 0, /* r0 */ + -1 /* none */ }; s4 nregdescfloat[] = { - REG_ARG, REG_TMP, REG_ARG, REG_TMP, REG_SAV, REG_TMP, REG_SAV, REG_TMP, + REG_ARG, REG_TMP, REG_ARG, REG_TMP, REG_RES, REG_TMP, REG_RES, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_END }; @@ -92,8 +87,7 @@ const s4 abi_registers_float_argument[] = { }; const s4 abi_registers_float_saved[] = { - 4, /* f4 */ - 6 /* f6 */ + -1 /* none */ }; const s4 abi_registers_float_temporary[] = { @@ -120,10 +114,11 @@ const s4 abi_registers_float_temporary[] = { slot: size in bytes of a stack slot slots1w: number of stack slots used by a 1 word type parameter slots2w: number of stack slots used by a 2 word type parameter + stackoff: offset on stack frame where to start placing arguments *******************************************************************************/ -static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2w) +static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2w, s4 stackoff) { paramdesc *pd; s4 i; @@ -153,7 +148,7 @@ static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2 } else { pd->inmemory = true; - pd->regoff = stacksize * slot; + pd->regoff = (stacksize * slot) + stackoff; pd->index = stacksize; stacksize += slots1w; } @@ -172,7 +167,7 @@ static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2 else { /* _ALIGN(stacksize); */ pd->inmemory = true; - pd->regoff = stacksize * slot; + pd->regoff = (stacksize * slot) + stackoff; pd->index = stacksize; iarg = INT_ARG_CNT; stacksize += slots2w; @@ -188,7 +183,7 @@ static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2 } else { pd->inmemory = true; - pd->regoff = stacksize * slot; + pd->regoff = (stacksize * slot) + stackoff; pd->index = stacksize; stacksize += slots1w; } @@ -204,7 +199,7 @@ static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2 else { /* _ALIGN(stacksize); */ pd->inmemory = true; - pd->regoff = stacksize * slot; + pd->regoff = (stacksize * slot) + stackoff; pd->index = stacksize; stacksize += slots2w; } @@ -238,12 +233,12 @@ static void md_param_alloc_intern(methoddesc *md, s4 slot, s4 slots1w, s4 slots2 void md_param_alloc(methoddesc *md) { - md_param_alloc_intern(md, 8, 1, 1); + md_param_alloc_intern(md, 8, 1, 1, 0); } void md_param_alloc_native(methoddesc *md) { - md_param_alloc_intern(md, 4, 1, 2); + md_param_alloc_intern(md, 4, 1, 2, 96); } @@ -268,16 +263,18 @@ void md_param_alloc_native(methoddesc *md) *******************************************************************************/ -void md_return_alloc(jitdata *jd, stackptr stackslot) +void md_return_alloc(jitdata *jd, stackelement_t* stackslot) { methodinfo *m; + codeinfo *code; registerdata *rd; methoddesc *md; /* get required compiler data */ - m = jd->m; - rd = jd->rd; + m = jd->m; + code = jd->code; + rd = jd->rd; md = m->parseddesc; @@ -285,7 +282,7 @@ void md_return_alloc(jitdata *jd, stackptr stackslot) their argument register -> so leafmethods with paramcount > 0 could already use R3 == a00! */ - if (!jd->isleafmethod || (md->paramcount == 0)) { + if (!code_is_leafmethod(code) || (md->paramcount == 0)) { /* Only precolor the stackslot, if it is not a SAVEDVAR <-> has not to survive method invokations. */ @@ -328,4 +325,5 @@ void md_return_alloc(jitdata *jd, stackptr stackslot) * c-basic-offset: 4 * tab-width: 4 * End: + * vim:noexpandtab:sw=4:ts=4: */