CACAO
dseg.hpp
Go to the documentation of this file.
1 /* src/vm/jit/dseg.hpp - data segment handling stuff
2 
3  Copyright (C) 1996-2005, 2006, 2007, 2008
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 
26 #ifndef DSEG_HPP_
27 #define DSEG_HPP_ 1
28 
29 #include "config.h"
30 #include "vm/global.hpp"
31 #include "vm/types.hpp"
32 
33 struct basicblock;
34 struct codegendata;
35 struct jitdata;
36 
37 /* convenience macros *********************************************************/
38 
39 #define dseg_add_functionptr(cd,value) \
40  dseg_add_address((cd), (void *) (ptrint) (value))
41 
42 
43 /* dataentry ******************************************************************/
44 
45 #define DSEG_FLAG_UNIQUE 0x0001
46 #define DSEG_FLAG_READONLY 0x0002
47 
48 struct dsegentry {
54 };
55 
56 
57 /* function prototypes ********************************************************/
58 
59 void dseg_finish(jitdata *jd);
60 
63 s4 dseg_add_unique_float(codegendata *cd, float value);
64 s4 dseg_add_unique_double(codegendata *cd, double value);
65 s4 dseg_add_unique_address(codegendata *cd, void *value);
66 
67 s4 dseg_add_s4(codegendata *cd, s4 value);
68 s4 dseg_add_s8(codegendata *cd, s8 value);
69 // TODO: something expects this to be declared with C linkage, why?
70 extern "C" s4 dseg_add_float(codegendata *cd, float value);
71 s4 dseg_add_double(codegendata *cd, double value);
72 s4 dseg_add_address(codegendata *cd, void *value);
73 
76 
77 #if defined(__I386__) || defined(__X86_64__) || defined(__XDSPCORE__) || defined(ENABLE_INTRP)
78 void dseg_adddata(codegendata *cd);
79 void dseg_resolve_datareferences(jitdata *jd);
80 #endif
81 
82 #if !defined(NDEBUG)
83 void dseg_display(jitdata *jd);
84 #endif
85 
86 
87 #endif // DSEG_HPP_
88 
89 
90 /*
91  * These are local overrides for various environment variables in Emacs.
92  * Please do not remove this and leave it at the end of the file, where
93  * Emacs will automagically detect them.
94  * ---------------------------------------------------------------------
95  * Local variables:
96  * mode: c++
97  * indent-tabs-mode: t
98  * c-basic-offset: 4
99  * tab-width: 4
100  * End:
101  * vim:noexpandtab:sw=4:ts=4:
102  */
s4 dseg_add_double(codegendata *cd, double value)
Definition: dseg.cpp:465
u2 flags
Definition: dseg.hpp:50
Definition: jit.hpp:126
s4 dseg_add_unique_address(codegendata *cd, void *value)
Definition: dseg.cpp:525
s4 disp
Definition: dseg.hpp:51
s4 dseg_add_address(codegendata *cd, void *value)
Definition: dseg.cpp:542
s4 dseg_add_unique_double(codegendata *cd, double value)
Definition: dseg.cpp:448
s4 dseg_add_unique_float(codegendata *cd, float value)
Definition: dseg.cpp:375
u2 type
Definition: dseg.hpp:49
void dseg_add_target(codegendata *cd, basicblock *target)
Definition: dseg.cpp:565
int64_t s8
Definition: types.hpp:48
void dseg_display(jitdata *jd)
Definition: dseg.cpp:633
s4 dseg_add_s4(codegendata *cd, s4 value)
Definition: dseg.cpp:246
uint16_t u2
Definition: types.hpp:43
dsegentry * next
Definition: dseg.hpp:53
void dseg_finish(jitdata *jd)
Definition: dseg.cpp:46
int32_t s4
Definition: types.hpp:45
s4 dseg_add_unique_s4(codegendata *cd, s4 value)
Definition: dseg.cpp:229
void dseg_add_unique_target(codegendata *cd, basicblock *target)
imm_union val
Definition: dseg.hpp:52
s4 dseg_add_s8(codegendata *cd, s8 value)
Definition: dseg.cpp:319
BeginInst * target
s4 dseg_add_float(codegendata *cd, float value)
Definition: dseg.cpp:392
s4 dseg_add_unique_s8(codegendata *cd, s8 value)
Definition: dseg.cpp:302