From 155a829e77fec572811484ff4d0c593a9fafb247 Mon Sep 17 00:00:00 2001 From: twisti Date: Thu, 30 Mar 2006 10:23:11 +0000 Subject: [PATCH] * src/vm/jit/Makefile.am (noinst_HEADERS): Added abi-asm.h. * src/vm/jit/abi.h (vm/jit/abi-asm.h): Added. (nregdescint, regs, nregdescfloat): Added. * src/vm/jit/abi-asm.h: New file. * src/vm/jit/reg.h (nregdescint, nregdescfloat): Removed. * src/vm/jit/reg.c (vm/jit/abi.h): Added. * src/vm/jit/replace.c: Likewise. * src/vm/jit/allocator/lsra.c: Likewise. * src/vm/jit/powerpc/darwin/md-asm.h (asm_vm_call_method_exception_handler): Added. * src/vm/jit/powerpc/darwin/md-abi.c (regs): Added. --- src/vm/jit/Makefile.am | 3 +- src/vm/jit/abi-asm.h | 61 ++++++++++++++++++++++++++++++ src/vm/jit/abi.h | 16 +++++--- src/vm/jit/allocator/lsra.c | 3 +- src/vm/jit/powerpc/darwin/md-abi.c | 11 +++++- src/vm/jit/powerpc/darwin/md-asm.h | 4 +- src/vm/jit/reg.c | 7 ++-- src/vm/jit/reg.h | 10 +---- src/vm/jit/replace.c | 5 ++- 9 files changed, 98 insertions(+), 22 deletions(-) create mode 100644 src/vm/jit/abi-asm.h diff --git a/src/vm/jit/Makefile.am b/src/vm/jit/Makefile.am index 0e3e9d78a..39c473d6c 100644 --- a/src/vm/jit/Makefile.am +++ b/src/vm/jit/Makefile.am @@ -28,7 +28,7 @@ ## ## Changes: Edwin Steiner ## -## $Id: Makefile.am 4700 2006-03-28 15:10:43Z twisti $ +## $Id: Makefile.am 4710 2006-03-30 10:23:11Z twisti $ ## Process this file with automake to produce Makefile.in @@ -101,6 +101,7 @@ endif noinst_HEADERS = \ abi.h \ + abi-asm.h \ asmpart.h \ methodheader.h \ patcher.h diff --git a/src/vm/jit/abi-asm.h b/src/vm/jit/abi-asm.h new file mode 100644 index 000000000..45fc580c1 --- /dev/null +++ b/src/vm/jit/abi-asm.h @@ -0,0 +1,61 @@ +/* src/vm/jit/abi-asm.h - common assembler ABI defines + + 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. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + 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., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + + Contact: cacao@cacaojvm.org + + Authors: Christian Thalinger + + Changes: + + $Id: abi.h 4357 2006-01-22 23:33:38Z twisti $ + +*/ + + +#ifndef _ABI_ASM_H +#define _ABI_ASM_H + +/* ATTENTION: Don't add C stuff in here, as this file is included in asmpart.S */ + +/* some count defines for asmpart.S *******************************************/ + +#define SAV_CNT (INT_SAV_CNT + FLT_SAV_CNT) +#define ARG_CNT (INT_ARG_CNT + FLT_ARG_CNT) +#define TMP_CNT (INT_TMP_CNT + FLT_TMP_CNT) + +#endif /* _ABI_ASM_H */ + + +/* + * 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 + * Emacs will automagically detect them. + * --------------------------------------------------------------------- + * Local variables: + * mode: c + * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 4 + * End: + */ diff --git a/src/vm/jit/abi.h b/src/vm/jit/abi.h index 11b120fde..532f0c9a8 100644 --- a/src/vm/jit/abi.h +++ b/src/vm/jit/abi.h @@ -28,7 +28,7 @@ Changes: - $Id: abi.h 4357 2006-01-22 23:33:38Z twisti $ + $Id: abi.h 4710 2006-03-30 10:23:11Z twisti $ */ @@ -36,11 +36,17 @@ #ifndef _ABI_H #define _ABI_H -/* some count defines for asmpart.S *******************************************/ +#include "config.h" +#include "vm/types.h" -#define SAV_CNT (INT_SAV_CNT + FLT_SAV_CNT) -#define ARG_CNT (INT_ARG_CNT + FLT_ARG_CNT) -#define TMP_CNT (INT_TMP_CNT + FLT_TMP_CNT) +#include "vm/jit/abi-asm.h" + + +/* ABI externs ****************************************************************/ + +extern s4 nregdescint[]; +extern char *regs[]; +extern s4 nregdescfloat[]; #endif /* _ABI_H */ diff --git a/src/vm/jit/allocator/lsra.c b/src/vm/jit/allocator/lsra.c index 95aacd78e..70c445f40 100644 --- a/src/vm/jit/allocator/lsra.c +++ b/src/vm/jit/allocator/lsra.c @@ -29,7 +29,7 @@ Changes: Christian Thalinger Edwin Steiner - $Id: lsra.c 4699 2006-03-28 14:52:32Z twisti $ + $Id: lsra.c 4710 2006-03-30 10:23:11Z twisti $ */ @@ -53,6 +53,7 @@ #include "vm/options.h" #include "vm/statistics.h" #include "vm/stringlocal.h" +#include "vm/jit/abi.h" #include "vm/jit/reg.h" #include "vm/jit/allocator/lsra.h" diff --git a/src/vm/jit/powerpc/darwin/md-abi.c b/src/vm/jit/powerpc/darwin/md-abi.c index 0e75858d6..b22f70e60 100644 --- a/src/vm/jit/powerpc/darwin/md-abi.c +++ b/src/vm/jit/powerpc/darwin/md-abi.c @@ -28,7 +28,7 @@ Changes: Christian Ullrich - $Id: md-abi.c 4384 2006-01-28 14:42:58Z twisti $ + $Id: md-abi.c 4710 2006-03-30 10:23:11Z twisti $ */ @@ -42,7 +42,7 @@ #include "vm/global.h" -/* register descripton array **************************************************/ +/* register descripton arrays *************************************************/ s4 nregdescint[] = { /* zero, sp, t0, a0/v0, a0/v1, a2, a3, a4, */ @@ -60,6 +60,13 @@ s4 nregdescint[] = { REG_END }; +char *regs[] = { + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", +}; + s4 nregdescfloat[] = { /*ftmp3, fa0/v0, fa1, fa2, fa3, fa4, fa5, fa6, */ diff --git a/src/vm/jit/powerpc/darwin/md-asm.h b/src/vm/jit/powerpc/darwin/md-asm.h index 7ca1eafec..d0c69820d 100644 --- a/src/vm/jit/powerpc/darwin/md-asm.h +++ b/src/vm/jit/powerpc/darwin/md-asm.h @@ -28,7 +28,7 @@ Changes: - $Id: md-asm.h 4684 2006-03-23 00:56:21Z edwin $ + $Id: md-asm.h 4710 2006-03-30 10:23:11Z twisti $ */ @@ -229,6 +229,8 @@ #define asm_vm_call_method_float _asm_vm_call_method_float #define asm_vm_call_method_double _asm_vm_call_method_double +#define asm_vm_call_method_exception_handler _asm_vm_call_method_exception_handler + #define jumptable_int _jumptable_int #define jumptable_long _jumptable_long diff --git a/src/vm/jit/reg.c b/src/vm/jit/reg.c index 44a1b8bda..e2527e9fb 100644 --- a/src/vm/jit/reg.c +++ b/src/vm/jit/reg.c @@ -28,11 +28,11 @@ Changes: Stefan Ring Christian Thalinger - Christian Ullrich + Christian Ullrich Michael Starzinger - Edwin Steiner + Edwin Steiner - $Id: reg.c 4699 2006-03-28 14:52:32Z twisti $ + $Id: reg.c 4710 2006-03-30 10:23:11Z twisti $ */ @@ -47,6 +47,7 @@ #include "md-abi.h" #include "mm/memory.h" +#include "vm/jit/abi.h" #include "vm/jit/reg.h" diff --git a/src/vm/jit/reg.h b/src/vm/jit/reg.h index 62bfd2e18..c0f36cc1e 100644 --- a/src/vm/jit/reg.h +++ b/src/vm/jit/reg.h @@ -27,9 +27,9 @@ Authors: Christian Thalinger Changes: Christian Ullrich - Edwin Steiner + Edwin Steiner - $Id: reg.h 4699 2006-03-28 14:52:32Z twisti $ + $Id: reg.h 4710 2006-03-30 10:23:11Z twisti $ */ @@ -127,12 +127,6 @@ struct registerdata { }; -/* global variables ***********************************************************/ - -extern s4 nregdescint[]; -extern s4 nregdescfloat[]; - - /* function prototypes ********************************************************/ void reg_setup(jitdata *jd); diff --git a/src/vm/jit/replace.c b/src/vm/jit/replace.c index 3e136fe3d..368a630ea 100644 --- a/src/vm/jit/replace.c +++ b/src/vm/jit/replace.c @@ -38,14 +38,17 @@ #include #include +#include "arch.h" + #include "mm/memory.h" #include "toolbox/logging.h" #include "vm/options.h" +#include "vm/jit/abi.h" #include "vm/jit/jit.h" #include "vm/jit/replace.h" #include "vm/jit/asmpart.h" #include "vm/jit/disass.h" -#include "arch.h" + /*** constants used internally ************************************************/ -- 2.25.1