From eb572247023ba3d14155b1c5d3e63c8043d48b86 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 29 Jun 2005 12:40:42 +0000 Subject: [PATCH] md_return_alloc coded to precolour stack slots holding the return register. rd->arg[int|flt]reguse calculation in md_param_alloc corrected. --- src/vm/jit/alpha/md-abi.c | 46 +++++++++++++++++++++++++++++++++++---- src/vm/jit/mips/md-abi.c | 45 ++++++++++++++++++++++++++++++++++---- 2 files changed, 83 insertions(+), 8 deletions(-) diff --git a/src/vm/jit/alpha/md-abi.c b/src/vm/jit/alpha/md-abi.c index 5662e5ca5..39d1c4716 100644 --- a/src/vm/jit/alpha/md-abi.c +++ b/src/vm/jit/alpha/md-abi.c @@ -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. diff --git a/src/vm/jit/mips/md-abi.c b/src/vm/jit/mips/md-abi.c index 8ef7bf2a3..2b2ed906a 100644 --- a/src/vm/jit/mips/md-abi.c +++ b/src/vm/jit/mips/md-abi.c @@ -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. -- 2.25.1