Authors: Christian Thalinger
- $Id: codegen.inc.h 1339 2004-07-21 16:03:08Z twisti $
+ $Id: codegen.inc.h 1494 2004-11-12 13:34:26Z twisti $
*/
#ifndef _CODEGEN_INC_H
#define _CODEGEN_INC_H
+/* We typedef these structures before #includes to resolve circular */
+/* dependencies. */
+
+typedef struct codegendata codegendata;
+typedef struct branchref branchref;
+typedef struct jumpref jumpref;
+typedef struct dataref dataref;
+typedef struct linenumberref linenumberref;
+typedef struct threadcritnodetemp threadcritnodetemp;
+
#include "types.h"
#include "global.h"
+#include "jit/inline.h"
+#include "jit/reg.h"
#define MCODEINITSIZE (1<<15) /* 32 Kbyte code area initialization size */
#define DSEGINITSIZE (1<<12) /* 4 Kbyte data area initialization size */
#if POINTERSIZE == 8
-#define dseg_addaddress(m, value) dseg_adds8((m), (s8) (value))
+#define dseg_addaddress(cd,value) dseg_adds8((cd), (s8) (value))
#else
-#define dseg_addaddress(m, value) dseg_adds4((m), (s4) (value))
+#define dseg_addaddress(cd,value) dseg_adds4((cd), (s4) (value))
#endif
-typedef struct codegendata codegendata;
-typedef struct branchref branchref;
-typedef struct jumpref jumpref;
-typedef struct dataref dataref;
-typedef struct linenumberref linenumberref;
-typedef struct threadcritnodetemp threadcritnodetemp;
-
-
/************************* critical sections *********************************/
struct threadcritnodetemp {
s4 linenumbertablestartpos;
s4 linenumbertab;
+ methodinfo *method;
+ s4 exceptiontablelength;/* exceptiontable length */
+ exceptiontable *exceptiontable; /* the exceptiontable */
+
threadcritnodetemp *threadcrit; /* List of critical code regions */
threadcritnodetemp threadcritcurrent;
s4 threadcritcount; /* Number of critical regions */
+ int maxstack;
+ int maxlocals;
};
typedef struct _methodtree_element methodtree_element;
struct _methodtree_element {
- void *startpc;
- void *endpc;
+ functionptr startpc;
+ functionptr endpc;
};
#endif
/* function prototypes */
void codegen_init();
-void codegen_setup(methodinfo *m); /* allocates code and data area */
-void codegen(methodinfo *m);
-void codegen_close(methodinfo *m); /* releases temporary storage */
-void codegen_insertmethod(void *startpc, void *endpc);
+void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *e);
+void codegen(methodinfo *m, codegendata *cd, registerdata *rd);
+void codegen_free(methodinfo *m, codegendata *cd);
+void codegen_close();
+void codegen_insertmethod(functionptr startpc, functionptr endpc);
+
+#if defined(__I386__) || defined(__X86_64__)
+void codegen_addreference(codegendata *cd, struct basicblock *target, void *branchptr);
+#endif
-void dseg_display(methodinfo *m);
+void dseg_display(methodinfo *m, codegendata *cd);
void init_exceptions();