1 /* src/vm/jit/dseg.c - data segment handling stuff
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
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., 51 Franklin Street, Fifth Floor, Boston, MA
25 $Id: dseg.h 7903 2007-05-14 11:15:33Z tbfg $
33 /* forward typedefs ***********************************************************/
35 typedef struct dsegentry dsegentry;
36 typedef struct linenumbertable_entry linenumbertable_entry;
37 typedef struct dseg_exception_entry dseg_exception_entry;
43 #include "toolbox/list.h"
45 #include "vm/jit/jit.h"
46 #include "vm/jit/codegen-common.h"
48 #include "vmcore/references.h"
51 /* convenience macros *********************************************************/
53 #define dseg_add_functionptr(cd,value) \
54 dseg_add_address((cd), (void *) (ptrint) (value))
57 /* dataentry ******************************************************************/
59 #define DSEG_FLAG_UNIQUE 0x0001
60 #define DSEG_FLAG_READONLY 0x0002
71 /* linenumbertable_entry ******************************************************/
73 /* Keep the type of line the same as the pointer type, otherwise we
74 run into alignment troubles (like on MIPS64). */
76 struct linenumbertable_entry {
77 ptrint line; /* NOTE: see doc/inlining_stacktrace.txt for */
78 u1 *pc; /* special meanings of line and pc. */
82 /* dseg_exception_entry ********************************************************
84 Datastructure which represents an exception entry in the exception
85 table residing in the data segment.
87 *******************************************************************************/
89 struct dseg_exception_entry {
90 classref_or_classinfo catchtype;
97 /* function prototypes ********************************************************/
99 void dseg_finish(jitdata *jd);
101 s4 dseg_add_unique_s4(codegendata *cd, s4 value);
102 s4 dseg_add_unique_s8(codegendata *cd, s8 value);
103 s4 dseg_add_unique_float(codegendata *cd, float value);
104 s4 dseg_add_unique_double(codegendata *cd, double value);
105 s4 dseg_add_unique_address(codegendata *cd, void *value);
107 s4 dseg_add_s4(codegendata *cd, s4 value);
108 s4 dseg_add_s8(codegendata *cd, s8 value);
109 s4 dseg_add_float(codegendata *cd, float value);
110 s4 dseg_add_double(codegendata *cd, double value);
111 s4 dseg_add_address(codegendata *cd, void *value);
113 void dseg_add_unique_target(codegendata *cd, basicblock *target);
114 void dseg_add_target(codegendata *cd, basicblock *target);
116 void dseg_addlinenumbertablesize(codegendata *cd);
117 void dseg_addlinenumber(codegendata *cd, u2 linenumber);
118 void dseg_addlinenumber_inline_start(codegendata *cd, instruction *iptr);
119 void dseg_addlinenumber_inline_end(codegendata *cd, instruction *iptr);
121 void dseg_createlinenumbertable(codegendata *cd);
123 s4 dseg_get_linenumber_from_pc(methodinfo **pm, u1 *pv, u1 *pc);
125 #if defined(__I386__) || defined(__X86_64__) || defined(__XDSPCORE__) || defined(__M68K__) || defined(ENABLE_INTRP)
126 void dseg_adddata(codegendata *cd);
127 void dseg_resolve_datareferences(jitdata *jd);
131 void dseg_display(jitdata *jd);
138 * These are local overrides for various environment variables in Emacs.
139 * Please do not remove this and leave it at the end of the file, where
140 * Emacs will automagically detect them.
141 * ---------------------------------------------------------------------
144 * indent-tabs-mode: t
148 * vim:noexpandtab:sw=4:ts=4: