/* 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.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: global.h 8359 2007-08-20 17:02:14Z michi $
-
*/
#define _GLOBAL_H
#include "config.h"
+
+#include <stdint.h>
+
#include "vm/types.h"
#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 */
#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;
*******************************************************************************/
-#define HDRFLAG_FLC 0x01
#define HDRFLAG_MARK1 0x02
#define HDRFLAG_MARK2 0x04
#define HDRFLAG_UNCOLLECTABLE 0x08
#define HDRFLAG_REFERENCING 0x40
struct java_object_t { /* header for all objects */
- struct _vftbl *vftbl; /* pointer to virtual function table */
+ struct _vftbl *vftbl; /* pointer to virtual function table */
#if defined(ENABLE_THREADS)
- struct lock_record_t *monitorPtr;
+ uintptr_t lockword;
#endif
-#if defined(ENABLE_THREADS) || defined(ENABLE_GC_CACAO)
- ptrint hdrflags; /* word containing the FLC and GC bits */
+#if defined(ENABLE_GC_CACAO)
+ uintptr_t hdrflags; /* word containing the GC bits */
#endif
};