1 /* src/vm/jit/dseg.c - data segment handling stuff
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Reinhard Grafl
30 Changes: Christian Thalinger
33 $Id: dseg.h 4011 2005-12-30 14:16:49Z twisti $
41 /* forward typedefs ***********************************************************/
43 typedef struct jumpref jumpref;
44 typedef struct dataref dataref;
45 typedef struct patchref patchref;
46 typedef struct linenumberref linenumberref;
53 #include "vm/jit/jit.h"
54 #include "vm/jit/codegen-common.h"
57 /* global macros **************************************************************/
59 #if SIZEOF_VOID_P == 8
60 # define dseg_addaddress(cd,value) dseg_adds8((cd), (s8) (value))
62 # define dseg_addaddress(cd,value) dseg_adds4((cd), (s4) (value))
66 /* jumpref ********************************************************************/
69 s4 tablepos; /* patching position in data segment */
70 basicblock *target; /* target basic block */
71 jumpref *next; /* next element in jumpref list */
75 /* dataref ********************************************************************/
78 s4 datapos; /* patching position in generated code */
79 dataref *next; /* next element in dataref list */
83 /* patchref *******************************************************************/
94 /* linenumberref **************************************************************/
96 struct linenumberref {
97 s4 tablepos; /* patching position in data segment */
98 s4 targetmpc; /* machine code program counter of first */
99 /* instruction for given line */
100 u2 linenumber; /* line number, used for inserting into the */
101 /* table and for validty checking */
102 linenumberref *next; /* next element in linenumberref list */
106 /* function prototypes ********************************************************/
108 void dseg_increase(codegendata *cd);
110 s4 dseg_adds4_increase(codegendata *cd, s4 value);
111 s4 dseg_adds4(codegendata *cd, s4 value);
113 s4 dseg_adds8_increase(codegendata *cd, s8 value);
114 s4 dseg_adds8(codegendata *cd, s8 value);
116 s4 dseg_addfloat_increase(codegendata *cd, float value);
117 s4 dseg_addfloat(codegendata *cd, float value);
119 s4 dseg_adddouble_increase(codegendata *cd, double value);
120 s4 dseg_adddouble(codegendata *cd, double value);
122 void dseg_addtarget(codegendata *cd, basicblock *target);
123 void dseg_adddata(codegendata *cd, u1 *ptr);
125 void dseg_addlinenumbertablesize(codegendata *cd);
126 void dseg_addlinenumber(codegendata *cd, u2 linenumber, u1 *ptr);
127 void dseg_createlinenumbertable(codegendata *cd);
130 void dseg_display(methodinfo *m, codegendata *cd);
137 * These are local overrides for various environment variables in Emacs.
138 * Please do not remove this and leave it at the end of the file, where
139 * Emacs will automagically detect them.
140 * ---------------------------------------------------------------------
143 * indent-tabs-mode: t