verifier documentation
[cacao.git] / headers.c
index 947a4bc875e51bccc94f320ed468f80d6c3326cd..6aca204055be3d9e8bd79435de2b8056632bdd4c 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -29,7 +29,7 @@
    Changes: Mark Probst
             Philipp Tomsich
 
-   $Id: headers.c 771 2003-12-13 23:11:08Z stefan $
+   $Id: headers.c 862 2004-01-06 23:42:01Z stefan $
 
 */
 
@@ -41,6 +41,8 @@
 #include "global.h"
 #include "tables.h"
 #include "loader.h"
+#include "builtin.h"
+#include "mm/boehm.h"
 #include "toolbox/chain.h"
 #include "toolbox/memory.h"
 #include "toolbox/loging.h"
@@ -60,6 +62,7 @@ bool initverbose = false;
 bool opt_rt = false;            /* true if RTA parse should be used     RT-CO */
 bool opt_xta = false;           /* true if XTA parse should be used    XTA-CO */
 bool opt_vta = false;           /* true if VTA parse should be used    VTA-CO */
+bool opt_verify = true;        /* true if classfiles should be verified      */
 
 bool showmethods = false;
 bool showconstantpool = false;
@@ -121,7 +124,8 @@ s8 asm_builtin_d2l(double a) { return 0; }
 void asm_builtin_monitorenter(java_objectheader *o) {}
 void asm_builtin_monitorexit(java_objectheader *o) {}
 
-s4 asm_builtin_checkarraycast(java_objectheader *o,arraydescriptor *d) {return 0;}
+s4 asm_builtin_checkarraycast(java_objectheader *obj, vftbl *target) {return 0;}
+
 
 #if defined(__I386__)
 s4 asm_builtin_arrayinstanceof(java_objectheader *obj, classinfo *class) { return 0; }
@@ -147,7 +151,7 @@ java_objectheader *native_new_and_init(void *p) { return NULL; }
 
 /************************ global variables **********************/
 
-java_objectheader *exceptionptr;
+THREADSPECIFIC java_objectheader *_exceptionptr;
 
 static chain *nativemethod_chain;    /* chain with native methods     */
 static chain *nativeclass_chain;                              /* chain with processed classes  */      
@@ -253,7 +257,7 @@ static char *printtype(char *utf_ptr)
 }
 
 
-/******* determine the number of entries of a utf string in the ident chain *****/
+/***** determine the number of entries of a utf string in the ident chain *****/
 
 static int searchidentchain_utf(utf *ident) 
 {
@@ -269,7 +273,7 @@ static int searchidentchain_utf(utf *ident)
 }
 
 
-/**************** print structure for direct access to objects ******************/     
+/************** print structure for direct access to objects ******************/
 
 static void printfields(classinfo *c)
 {
@@ -364,7 +368,7 @@ static void printmethod(methodinfo *m)
 }
 
 
-/****************** remove package-name in fully-qualified classname *********************/
+/******* remove package-name in fully-qualified classname *********************/
 
 static void gen_header_filename(char *buffer, utf *u)
 {
@@ -378,7 +382,7 @@ static void gen_header_filename(char *buffer, utf *u)
 }
 
 
-/*********** create headerfile for classes and store native methods in chain ************/
+/* create headerfile for classes and store native methods in chain ************/
 
 static void headerfile_generate(classinfo *c)
 {
@@ -620,7 +624,8 @@ int main(int argc, char **argv)
        fprintf(file, "#define offbaseval     %3d\n", (int) OFFSET(vftbl, baseval));
        fprintf(file, "#define offdiffval     %3d\n\n", (int) OFFSET(vftbl, diffval));
 
-       fprintf(file, "#define offclassvftbl    %3d\n", (int) OFFSET(classinfo, vftbl));
+       fprintf(file, "#define offclassvftbl  %3d\n", (int) OFFSET(classinfo, vftbl));
+       fprintf(file, "#define offclassinit   %3d\n\n", (int) OFFSET(classinfo, initialized));
 
        fprintf(file, "#define offjniitemtype %3d\n", (int) OFFSET(jni_callblock, itemtype));
        fprintf(file, "#define offjniitem     %3d\n", (int) OFFSET(jni_callblock, item));