X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fglobal.h;h=ab6165cd98c154c05ed7047c705323d9208a6387;hb=bccccf5f248ad2ff37925424765b50fa4d769c2b;hp=a55b753b1e640a9b29af7a720c50fc15e3156586;hpb=56baa0f429abb78fb91d04e5ffe4a56741fb54d4;p=cacao.git diff --git a/src/vm/global.h b/src/vm/global.h index a55b753b1..ab6165cd9 100644 --- a/src/vm/global.h +++ b/src/vm/global.h @@ -1,6 +1,6 @@ /* src/vm/global.h - global definitions - Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel, + 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 @@ -22,17 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Contact: cacao@cacaojvm.org - - Authors: Reinhard Grafl - Andreas Krall - Mark Probst - Philipp Tomsich - Edwin Steiner - Joseph Wenninger - Christian Thalinger - - $Id: global.h 7675 2007-04-05 14:23:04Z michi $ + $Id: global.h 8210 2007-07-18 12:51:00Z twisti $ */ @@ -81,6 +71,14 @@ typedef union { } imm_union; +/* alignment macros ***********************************************************/ + +#define ALIGN_EVEN(a) ((a) = (((a) + 1) & ~1)) +#define ALIGN_ODD(a) ((a) = (a) | 1 ) + +#define ALIGN_2(a) ALIGN_EVEN(a) + + /* forward typedefs ***********************************************************/ typedef struct java_objectheader java_objectheader; @@ -120,29 +118,6 @@ typedef struct java_objectarray java_objectarray; #define IS_VOID_TYPE(a) ((a) == TYPE_VOID) -/* primitive data types *******************************************************/ - -/* These values are used in parsed descriptors and in some other - places were the different types handled internally as TYPE_INT have - to be distinguished. */ - -#define PRIMITIVETYPE_COUNT 11 /* number of primitive types (+ dummies) */ - -/* CAUTION: Don't change the numerical values! These constants are - used as indices into the primitive type table. */ - -#define PRIMITIVETYPE_INT TYPE_INT -#define PRIMITIVETYPE_LONG TYPE_LNG -#define PRIMITIVETYPE_FLOAT TYPE_FLT -#define PRIMITIVETYPE_DOUBLE TYPE_DBL -#define PRIMITIVETYPE_DUMMY1 TYPE_ADR /* not used! */ -#define PRIMITIVETYPE_BYTE 5 -#define PRIMITIVETYPE_CHAR 6 -#define PRIMITIVETYPE_SHORT 7 -#define PRIMITIVETYPE_BOOLEAN 8 -#define PRIMITIVETYPE_DUMMY2 9 /* not used! */ -#define PRIMITIVETYPE_VOID TYPE_VOID - /* some Java related defines **************************************************/ #define JAVA_VERSION "1.5.0" /* this version is supported by CACAO */ @@ -203,16 +178,20 @@ typedef struct java_objectarray java_objectarray; #define ACC_CLASS_REFLECT_MASK 0x0000ffff/* flags reported by reflection */ #define ACC_CLASS_PRIMITIVE 0x00010000/* class is a primitive class */ + #define ACC_CLASS_HAS_POINTERS 0x00020000/* instance contains pointers */ -#define ACC_CLASS_SOFT_REFERENCE 0x00040000 -#define ACC_CLASS_WEAK_REFERENCE 0x00080000 -#define ACC_CLASS_PHANTOM_REFERENCE 0x00100000 + +#define ACC_CLASS_REFERENCE_MASK 0x001c0000 +#define ACC_CLASS_REFERENCE_SOFT 0x00040000 +#define ACC_CLASS_REFERENCE_WEAK 0x00080000 +#define ACC_CLASS_REFERENCE_PHANTOM 0x00100000 /* special flags used in methodinfo *******************************************/ -#define ACC_METHOD_IMPLEMENTED 0x00010000 /* there is an implementation */ -#define ACC_METHOD_MONOMORPHIC 0x00020000 /* currently monomorphic method */ +#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 */ /* data structures of the runtime system **************************************/ @@ -247,20 +226,6 @@ struct java_objectheader { /* header for all objects */ which is referenced by the vftbl. */ -/* CAUTION: Don't change the numerical values! These constants (with - * the exception of ARRAYTYPE_OBJECT) are used as indices in the - * primitive type table. - */ -#define ARRAYTYPE_INT PRIMITIVETYPE_INT -#define ARRAYTYPE_LONG PRIMITIVETYPE_LONG -#define ARRAYTYPE_FLOAT PRIMITIVETYPE_FLOAT -#define ARRAYTYPE_DOUBLE PRIMITIVETYPE_DOUBLE -#define ARRAYTYPE_BYTE PRIMITIVETYPE_BYTE -#define ARRAYTYPE_CHAR PRIMITIVETYPE_CHAR -#define ARRAYTYPE_SHORT PRIMITIVETYPE_SHORT -#define ARRAYTYPE_BOOLEAN PRIMITIVETYPE_BOOLEAN -#define ARRAYTYPE_OBJECT PRIMITIVETYPE_VOID /* don't use as index! */ - typedef struct java_arrayheader { /* header for all arrays */ java_objectheader objheader; /* object header */ s4 size; /* array size */