3a62aca3175ea698ed3dcdaced64cb64e1b60e8c
[cacao.git] / src / vm / jit / tools / genoffsets.c
1 /* src/vm/jit/tools/genoffsets.c - generate asmpart offsets of structures
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: genoffsets.c 8271 2007-08-08 14:07:56Z twisti $
26
27 */
28
29
30 #include "config.h"
31
32 #include <stdio.h>
33
34 #include "vm/types.h"
35
36 #include "mm/memory.h"
37
38 #include "vm/global.h"
39 #include "vm/vm.h"
40
41 #include "vm/jit/asmpart.h"
42 #include "vm/jit/replace.h"
43
44
45 int main(int argc, char **argv)
46 {
47         printf("/* This file is machine generated, don't edit it! */\n\n");
48
49     printf("/* define some sizeof()'s */\n\n");
50
51 #if defined(ENABLE_REPLACEMENT)
52         printf("#define sizeexecutionstate         %3d\n", (s4) sizeof(executionstate_t));
53 #endif
54
55     printf("\n\n/* define some offsets */\n\n");
56
57         printf("/* vftbl_t */\n\n");
58         printf("#define offbaseval                 %3d\n", (s4) OFFSET(vftbl_t, baseval));
59         printf("#define offdiffval                 %3d\n", (s4) OFFSET(vftbl_t, diffval));
60         printf("\n\n");
61
62
63         printf("#define offcast_super_baseval      %3d\n", (s4) OFFSET(castinfo, super_baseval));
64         printf("#define offcast_super_diffval      %3d\n", (s4) OFFSET(castinfo, super_diffval));
65         printf("#define offcast_sub_baseval        %3d\n", (s4) OFFSET(castinfo, sub_baseval));
66
67 #if defined(ENABLE_REPLACEMENT)
68         printf("#define offes_pc                   %3d\n", (s4) OFFSET(executionstate_t, pc));
69         printf("#define offes_sp                   %3d\n", (s4) OFFSET(executionstate_t, sp));
70         printf("#define offes_pv                   %3d\n", (s4) OFFSET(executionstate_t, pv));
71         printf("#define offes_intregs              %3d\n", (s4) OFFSET(executionstate_t, intregs));
72         printf("#define offes_fltregs              %3d\n", (s4) OFFSET(executionstate_t, fltregs));
73 #endif /* defined(ENABLE_REPLACEMENT) */
74
75         /* everything is ok */
76
77         return 0;
78 }
79
80
81 /*
82  * These are local overrides for various environment variables in Emacs.
83  * Please do not remove this and leave it at the end of the file, where
84  * Emacs will automagically detect them.
85  * ---------------------------------------------------------------------
86  * Local variables:
87  * mode: c
88  * indent-tabs-mode: t
89  * c-basic-offset: 4
90  * tab-width: 4
91  * End:
92  * vim:noexpandtab:sw=4:ts=4:
93  */
94
95