Merged with tip.
[cacao.git] / src / vm / global.h
index 0b7c7990e2a4774f7b7559fe1ad482809bad0994..2a09e47c1fdafb958d9fedf361c010c83051c87d 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/global.h - global definitions
 
-   Copyright (C) 1996-2005, 2007, 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.
 
@@ -30,6 +28,7 @@
 
 #include "config.h"
 
+#include <stdbool.h>
 #include <stdint.h>
 
 #include "vm/types.h"
@@ -41,12 +40,6 @@ typedef void *voidptr;                  /* generic pointer                    */
 typedef void (*functionptr) (void);     /* generic function pointer           */
 typedef u1* methodptr;
 
-typedef unsigned int bool;              /* boolean data type                  */
-
-#define true         1
-#define false        0
-
-
 #if defined(ENABLE_SSA)
 /* immediate to get an addidional target Local Var Index */
 /* for IINC in Combination with SSA */
@@ -80,6 +73,24 @@ typedef union {
 #define ALIGN_2(a)                      ALIGN_EVEN(a)
 
 
+/* printf format defines ******************************************************/
+
+/* Define printf formats which change size between 32- and 64-bit. */
+
+#if SIZEOF_VOID_P == 8
+# define PRINTF_FORMAT_INT64_T    "%ld"
+#else
+# define PRINTF_FORMAT_INT64_T    "%lld"
+#endif
+
+
+/* convenience macros *********************************************************/
+
+/* Makes a string of the argument (which is not macro-expanded). */
+
+#define STR(a)  #a
+
+
 /* forward typedefs ***********************************************************/
 
 typedef struct java_object_t java_object_t; 
@@ -195,6 +206,11 @@ typedef struct java_objectarray_t java_objectarray_t;
 #define ACC_METHOD_BUILTIN     0x00010000     /* use for descriptor parsing   */
 #define ACC_METHOD_IMPLEMENTED 0x00020000     /* there is an implementation   */
 #define ACC_METHOD_MONOMORPHIC 0x00040000     /* currently monomorphic method */
+#define ACC_METHOD_EA          0x00080000     /* method being escape analyzed */
+#define ACC_METHOD_MONOMORPHY_USED \
+                               0x00100000
+#define ACC_METHOD_PARENT_MONOMORPHY_USED \
+                               0x00200000
 
 
 /* data structures of the runtime system **************************************/
@@ -208,7 +224,6 @@ typedef struct java_objectarray_t java_objectarray_t;
 
 *******************************************************************************/
 
-#define HDRFLAG_FLC           0x01
 #define HDRFLAG_MARK1         0x02
 #define HDRFLAG_MARK2         0x04
 #define HDRFLAG_UNCOLLECTABLE 0x08
@@ -221,8 +236,13 @@ struct java_object_t {                 /* header for all objects              */
 #if defined(ENABLE_THREADS)
        uintptr_t      lockword;
 #endif
-#if defined(ENABLE_THREADS) || defined(ENABLE_GC_CACAO)
-       uintptr_t      hdrflags;           /* word containing the FLC and GC bits */
+#if defined(ENABLE_GC_CACAO)
+       uintptr_t      hdrflags;           /* word containing the GC bits         */
+#endif
+#if defined(ENABLE_ESCAPE_CHECK)
+       void *method;
+       void *thread;
+       uintptr_t escape;
 #endif
 };