use two functions for creating/removing items of the native stackframe list (i386...
[cacao.git] / src / vm / global.h
index f3d46fa35fdfa20741057740a9ecf986ecd5a4c4..8f5f2c63b99bd23e6428be21cdf933d3fc481b45 100644 (file)
@@ -31,7 +31,7 @@
             Philipp Tomsich
                        Edwin Steiner
 
-   $Id: global.h 1442 2004-11-05 13:51:49Z twisti $
+   $Id: global.h 1680 2004-12-04 12:02:08Z jowenn $
 
 */
 
 #ifndef _GLOBAL_H
 #define _GLOBAL_H
 
-
 #include "config.h"
 #include "types.h"
+
+
+/* resolve typedef cycles *****************************************************/
+
+typedef struct utf utf;
+typedef struct literalstring literalstring;
+typedef struct java_objectheader java_objectheader; 
+typedef struct classinfo classinfo; 
+typedef struct _vftbl vftbl_t;
+typedef u1* methodptr;
+typedef struct fieldinfo  fieldinfo; 
+typedef struct exceptiontable exceptiontable;
+typedef struct methodinfo methodinfo; 
+typedef struct lineinfo lineinfo; 
+typedef struct arraydescriptor arraydescriptor;
+
+
+/* additional data types ******************************************************/
+
+typedef void *voidptr;                  /* generic pointer                    */
+typedef void (*functionptr) ();         /* generic function pointer           */
+
+typedef int   bool;                     /* boolean data type                  */
+
+#define true  1
+#define false 0
+
+
+/* additional includes ********************************************************/
+
 #include "toolbox/list.h"
+#include "vm/jit/inline/sets.h"
 
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
 #include <semaphore.h>
 #endif
 
+/* define path to rt.jar plus ending : ****************************************/
+
+#define RT_JAR_PATH    "/jre/lib/rt.jar:"
+
+
 #define STATISTICS          /* if enabled collects program statistics         */
 
 /* 
 #endif
 
 
-/* additional data types ******************************************************/
-
-typedef void *voidptr;          /* generic pointer */
-
-typedef int   bool;             /* boolean data type */
-
-#define true  1
-#define false 0
-
-typedef void (*functionptr) (); /* generic function pointer */
-
-
 /* immediate data union */
 
 typedef union {
-    s4 i;
-    s8 l;
-    float f;
-    double d;
-    void *a;
-    u1 b[8];
+       s4          i;
+       s8          l;
+       float       f;
+       double      d;
+       void       *a;
+       functionptr fp;
+       u1          b[8];
 } imm_union;
 
 
@@ -180,21 +204,7 @@ typedef union {
 #define ACC_NATIVE                0x0100
 #define ACC_INTERFACE             0x0200
 #define ACC_ABSTRACT              0x0400
-#define ACC_STRICT               0x0800
-
-/* resolve typedef cycles *****************************************************/
-
-typedef struct utf utf;
-typedef struct literalstring literalstring;
-typedef struct java_objectheader java_objectheader; 
-typedef struct classinfo classinfo; 
-typedef struct _vftbl vftbl_t;
-typedef u1* methodptr;
-typedef struct fieldinfo  fieldinfo; 
-typedef struct exceptiontable exceptiontable;
-typedef struct methodinfo methodinfo; 
-typedef struct lineinfo lineinfo; 
-typedef struct arraydescriptor arraydescriptor;
+#define ACC_STRICT                0x0800
 
 
 /* constant pool entries *******************************************************
@@ -293,6 +303,7 @@ struct native_stackframeinfo {
        void *oldThreadspecificHeadValue;
        void **addressOfThreadspecificHead;
        methodinfo *method;
+       void *beginOfJavaStackframe; /*only used if != 0*/
        void *returnToFromNative;
 
 #if 0
@@ -317,6 +328,15 @@ struct stacktraceelement {
 
 typedef struct stacktraceelement stacktraceelement;
 
+typedef struct stackTraceBuffer {
+        int needsFree;
+        struct stacktraceelement* start;
+        size_t size;
+        size_t full;
+} stackTraceBuffer;
+
+
+
 /* data structure for calls from c code to java methods */
 
 struct jni_callblock {
@@ -490,7 +510,6 @@ typedef struct primitivetypeinfo {
 
 /* field, method and class structures *****************************************/
 
-#include "jit/sets.h"
 typedef        struct xtafldinfo {
        bool       fieldChecked;                
        classinfo *fldClassType;
@@ -548,7 +567,7 @@ typedef struct xtainfo {
 
        methSet         *calls;            /* methods this method calls                 */ 
        methSet         *calledBy;         /* methods that call this method         */ 
-       methSet         *marked;  //not in Dez         /* methods that marked by this method    */ 
+       methSet         *marked;  /*not in Dez*/         /* methods that marked by this method    */ 
        methSet         *markedBy;
        fldSet          *fldsUsed;         /* fields used by this method             */ 
        /*methSetNode  *interfaceCalls*/   /* methods this method calls as interface */ 
@@ -614,8 +633,8 @@ struct methodinfo {                 /* method structure                       */
 
        u1         *stubroutine;        /* stub for compiling or calling natives  */
        s4          mcodelength;        /* legth of generated machine code        */
-       u1         *mcode;              /* pointer to machine code                */
-       u1         *entrypoint;         /* entry point in machine code            */
+       functionptr mcode;              /* pointer to machine code                */
+       functionptr entrypoint;         /* entry point in machine code            */
 
        /*rtainfo   rta;*/
        xtainfo    *xta;