/* src/vm/jit/mips/codegen.h - code generation macros and definitions for MIPS
- Copyright (C) 1996-2005 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 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
This file is part of CACAO.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
- Contact: cacao@complang.tuwien.ac.at
+ Contact: cacao@cacaojvm.org
Authors: Andreas Krall
- $Id: codegen.h 3113 2005-07-27 10:36:38Z twisti $
+ $Id: codegen.h 4640 2006-03-16 17:24:18Z twisti $
*/
#ifndef _CODEGEN_H
#define _CODEGEN_H
-#include "vm/jit/mips/types.h"
+#include "config.h"
+#include "vm/types.h"
-/* additional functions and macros to generate code ***************************/
+#include "vm/jit/jit.h"
-#ifdef STATISTICS
-#define COUNT_SPILLS count_spills++
-#else
-#define COUNT_SPILLS
-#endif
+
+/* some defines ***************************************************************/
+
+#define PATCHER_CALL_SIZE 2 * 4 /* size in bytes of a patcher call */
-/* gen_nullptr_check(objreg) */
+/* additional functions and macros to generate code ***************************/
#define gen_nullptr_check(objreg) \
if (checknull) { \
- M_BEQZ((objreg), 0); \
- codegen_addxnullrefs(cd, mcodeptr); \
+ M_BEQZ(objreg, 0); \
+ codegen_add_nullpointerexception_ref(cd, mcodeptr); \
M_NOP; \
}
M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size)); \
M_CMPULT(s2, REG_ITMP3, REG_ITMP3); \
M_BEQZ(REG_ITMP3, 0); \
- codegen_addxboundrefs(cd, mcodeptr, s2); \
+ codegen_add_arrayindexoutofboundsexception_ref(cd, mcodeptr, s2); \
M_NOP; \
}
#define gen_div_check(r) \
- M_BEQZ((r), 0); \
- codegen_addxdivrefs(cd, mcodeptr); \
- M_NOP;
+ do { \
+ M_BEQZ((r), 0); \
+ codegen_add_arithmeticexception_ref(cd, mcodeptr); \
+ M_NOP; \
+ } while (0)
/* MCODECHECK(icnt) */
#define M_AADD_IMM(a,b,c) M_IADD_IMM(a,b,c)
#define M_ASUB_IMM(a,b,c) M_ISUB_IMM(a,b,c)
#define M_ASLL_IMM(a,b,c) M_ISLL_IMM(a,b,c)
-#define M_LDA(a,b,disp) M_IADD_IMM(b,disp,a) /* a = b+disp */
#endif /* SIZEOF_VOID_P == 8 */