/* src/vm/jit/dseg.c - data segment handling stuff
- 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
+ Copyright (C) 1996-2005, 2006, 2007, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Contact: cacao@cacaojvm.org
-
- Authors: Reinhard Grafl
- Andreas Krall
-
- Changes: Christian Thalinger
- Joseph Wenninger
-
- $Id: dseg.h 5929 2006-11-06 17:13:40Z twisti $
-
*/
/* forward typedefs ***********************************************************/
typedef struct dsegentry dsegentry;
-typedef struct jumpref jumpref;
-typedef struct dataref dataref;
-typedef struct exceptionref exceptionref;
-typedef struct patchref patchref;
-typedef struct linenumberref linenumberref;
-typedef struct dseg_exception_entry dseg_exception_entry;
#include "config.h"
-
#include "vm/types.h"
-#include "toolbox/list.h"
-#include "vm/jit/jit.h"
-#include "vm/jit/codegen-common.h"
+#include "vm/references.h"
-
-/* XXX don't-break-trunk macros ***********************************************/
-
-#define dseg_adds4(cd,value) dseg_add_unique_s4((cd), (value))
-#define dseg_adds8(cd,value) dseg_add_unique_s8((cd), (value))
-#define dseg_addfloat(cd,value) dseg_add_unique_float((cd), (value))
-#define dseg_adddouble(cd,value) dseg_add_unique_double((cd), (value))
-#define dseg_addaddress(cd,value) dseg_add_unique_address((cd), (void *) (ptrint) (value))
-#define dseg_addtarget(cd,value) dseg_add_target((cd), (value))
+#include "vm/jit/jit.hpp"
+#include "vm/jit/codegen-common.hpp"
/* convenience macros *********************************************************/
};
-/* jumpref ********************************************************************/
-
-struct jumpref {
- s4 tablepos; /* patching position in data segment */
- basicblock *target; /* target basic block */
- jumpref *next; /* next element in jumpref list */
-};
-
-
-/* dataref ********************************************************************/
-
-struct dataref {
- s4 datapos; /* patching position in generated code */
- dataref *next; /* next element in dataref list */
-};
-
-
-/* exceptionref ***************************************************************/
-
-struct exceptionref {
- s4 branchpos; /* patching position in code segment */
- s4 reg; /* used for ArrayIndexOutOfBounds index reg */
- functionptr function; /* function pointer to generate exception */
- exceptionref *next; /* next element in exceptionref list */
-};
-
-
-/* patchref *******************************************************************/
-
-struct patchref {
- s4 branchpos; /* relative offset to method entrypoint */
- s4 disp; /* displacement of ref in the data segment */
- functionptr patcher; /* patcher function to call */
- voidptr ref; /* reference passed */
-/* listnode linkage; */
- patchref *next;
-};
-
-
-/* linenumberref **************************************************************/
-
-struct linenumberref {
- s4 tablepos; /* patching position in data segment */
- s4 linenumber; /* line number, used for inserting into the */
- /* table and for validity checking */
- /* -1......start of inlined body */
- /* -2......end of inlined body */
- /* <= -3...special entry with methodinfo * */
- /* (see doc/inlining_stacktrace.txt) */
- ptrint targetmpc; /* machine code program counter of first */
- /* instruction for given line */
- /* NOTE: for linenumber <= -3 this is a the */
- /* (methodinfo *) of the inlined method */
- linenumberref *next; /* next element in linenumberref list */
-};
-
-
-/* dseg_exception_entry ********************************************************
-
- Datastructure which represents an exception entry in the exception
- table residing in the data segment.
-
-*******************************************************************************/
-
-struct dseg_exception_entry {
- classref_or_classinfo catchtype;
- u1 *handlerpc;
- u1 *endpc;
- u1 *startpc;
-};
-
-
/* function prototypes ********************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void dseg_finish(jitdata *jd);
s4 dseg_add_unique_s4(codegendata *cd, s4 value);
void dseg_add_unique_target(codegendata *cd, basicblock *target);
void dseg_add_target(codegendata *cd, basicblock *target);
-void dseg_addlinenumbertablesize(codegendata *cd);
-void dseg_addlinenumber(codegendata *cd, u2 linenumber);
-void dseg_addlinenumber_inline_start(codegendata *cd, instruction *iptr);
-void dseg_addlinenumber_inline_end(codegendata *cd, instruction *iptr);
-
-void dseg_createlinenumbertable(codegendata *cd);
-
-#if defined(__I386__) || defined(__X86_64__) || defined(__XDSPCORE__) || defined(ENABLE_INTRP)
+#if defined(__I386__) || defined(__X86_64__) || defined(__XDSPCORE__) || defined(__M68K__) || defined(ENABLE_INTRP)
void dseg_adddata(codegendata *cd);
void dseg_resolve_datareferences(jitdata *jd);
#endif
void dseg_display(jitdata *jd);
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _DSEG_H */