Merged revisions 8245-8298 via svnmerge from
[cacao.git] / src / vm / global.h
index 6cee78a254626f7b9843d4372d9699fb1509a887..07963d38f52aa19ffe58b744bad7397afd0a8a67 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: global.h 8179 2007-07-05 11:21:08Z michi $
+   $Id: global.h 8299 2007-08-13 08:41:18Z michi $
 
 */
 
@@ -73,12 +73,15 @@ typedef union {
 
 /* alignment macros ***********************************************************/
 
-#define ALIGN_2(a)    do { if ((a) & 0x1) (a)++; } while (0)
+#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
+typedef struct java_object_t java_object_t
 typedef struct java_objectarray java_objectarray;
 
 
@@ -186,13 +189,14 @@ typedef struct java_objectarray java_objectarray;
 
 /* 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 **************************************/
 
-/* java_objectheader ***********************************************************
+/* java_object_t ***************************************************************
 
    All objects (and arrays) which resides on the heap need the
    following header at the beginning of the data structure.
@@ -209,7 +213,7 @@ typedef struct java_objectarray java_objectarray;
 #define HDRFLAG_HASH_ATTACHED 0x20
 #define HDRFLAG_REFERENCING   0x40
 
-struct java_objectheader {             /* header for all objects              */
+struct java_object_t {                 /* header for all objects              */
        struct _vftbl            *vftbl;   /* pointer to virtual function table   */
 #if defined(ENABLE_THREADS)
        struct lock_record_t *monitorPtr;
@@ -220,6 +224,15 @@ struct java_objectheader {             /* header for all objects              */
 };
 
 
+#if 0
+typedef struct java_handle_t {
+       java_object_t *heap_object;
+} java_handle_t;
+#else
+typedef java_object_t java_handle_t;
+#endif
+
+
 /* arrays **********************************************************************
 
        All arrays are objects (they need the object header with a pointer
@@ -229,7 +242,7 @@ struct java_objectheader {             /* header for all objects              */
 */
 
 typedef struct java_arrayheader {       /* header for all arrays              */
-       java_objectheader objheader;        /* object header                      */
+       java_object_t objheader;            /* object header                      */
        s4 size;                            /* array size                         */
 } java_arrayheader;
 
@@ -284,8 +297,8 @@ typedef struct java_doublearray {
     use the same machine code */
 
 struct java_objectarray {
-       java_arrayheader   header;
-       java_objectheader *data[1];
+       java_arrayheader  header;
+       java_object_t    *data[1];
 };