* Merged executionstate branch.
[cacao.git] / src / vmcore / linker.h
index efd6b2ed2721664b0ed62e1f17e25e56f0e90f0a..ad95bcccc824c6c9129e7a6bbcf84896cbc6c003 100644 (file)
@@ -22,7 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: linker.h 7246 2007-01-29 18:49:05Z twisti $
 */
 
 
@@ -82,28 +81,28 @@ typedef struct primitivetypeinfo primitivetypeinfo;
    interfacetablelength = 4
 
                   | ...       |            +----------+
-                     +-----------+            | method 2 |---> method z
-                     | class     |            | method 1 |---> method y
-                     +-----------+            | method 0 |---> method x
-                     | ivftbl  0 |----------> +----------+
-       vftblptr ---> +-----------+
+                  +-----------+            | method 2 |---> method z
+                  | class     |            | method 1 |---> method y
+                  +-----------+            | method 0 |---> method x
+                  | ivftbl  0 |----------> +----------+
+    vftblptr ---> +-----------+
                   | ivftbl -1 |--> NULL    +----------+
                   | ivftbl -2 |--> NULL    | method 1 |---> method x
                   | ivftbl -3 |-----+      | method 0 |---> method a
                   +-----------+     +----> +----------+
      
                               +---------------+
-                                 | length 3 = 2  |
-                                 | length 2 = 0  |
-                                 | length 1 = 0  |
-                                 | length 0 = 3  |
-       interfacevftbllength ---> +---------------+
+                              | length 3 = 2  |
+                              | length 2 = 0  |
+                              | length 1 = 0  |
+                              | length 0 = 3  |
+    interfacevftbllength ---> +---------------+
 
 *******************************************************************************/
 
 struct _vftbl {
        methodptr   *interfacetable[1];    /* interface table (access via macro)  */
-       classinfo   *class;                /* class, the vtbl belongs to          */
+       classinfo   *clazz;                /* class, the vtbl belongs to          */
        arraydescriptor *arraydesc;        /* for array classes, otherwise NULL   */
        s4           vftbllength;          /* virtual function table length       */
        s4           interfacetablelength; /* interface table length              */
@@ -134,34 +133,18 @@ struct arraydescriptor {
 };
 
 
-/* primitivetypeinfo **********************************************************/
-
-struct primitivetypeinfo {
-       classinfo *class_wrap;               /* class for wrapping primitive type */
-       classinfo *class_primitive;          /* primitive class                   */
-       char      *wrapname;                 /* name of class for wrapping        */
-       char       typesig;                  /* one character type signature      */
-       char      *name;                     /* name of primitive class           */
-       char      *arrayname;                /* name of primitive array class     */
-       classinfo *arrayclass;               /* primitive array class             */
-       vftbl_t   *arrayvftbl;               /* vftbl of primitive array class    */
-};
-
-
 /* global variables ***********************************************************/
 
-/* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_ constants   */
-/* (except ARRAYTYPE_OBJECT).                                                 */
+/* This lock must be taken while renumbering classes or while atomically      */
+/* accessing classes.                                                         */
 
-extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
+extern java_object_t *linker_classrenumber_lock;
 
 
 /* function prototypes ********************************************************/
 
-/* initialize the linker subsystem */
-bool linker_init(void);
-
-/* link a class */
+void       linker_preinit(void);
+void       linker_init(void);
 classinfo *link_class(classinfo *c);
 
 #endif /* _LINKER_H */