old ARGVAR handling in stack.c eliminated
[cacao.git] / src / vm / loader.h
index 04e331d6c39fde3180ac95f0cf322a8f918146fb..1840727d3377f6802712f3589e9ac5e12d00b875 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: loader.h 2148 2005-03-30 16:49:40Z twisti $
+   $Id: loader.h 2199 2005-04-03 21:42:44Z twisti $
 */
 
 
@@ -42,13 +42,11 @@ typedef struct classbuffer classbuffer;
 typedef struct classpath_info classpath_info;
 
 
-#include "config.h"
-#include "types.h"
-#include "vm/class.h"
-#include "vm/descriptor.h"
 #include "vm/global.h"
-#include "vm/method.h"
 #include "vm/utf8.h"
+#include "vm/references.h"
+#include "vm/descriptor.h"
+#include "vm/method.h"
 
 #if defined(USE_ZLIB)
 # include "vm/unzip.h"
@@ -86,15 +84,6 @@ typedef struct classpath_info classpath_info;
 
 *******************************************************************************/
 
-typedef struct {            /* Fieldref, Methodref and InterfaceMethodref     */
-       classinfo *class;       /* class containing this field/method/intfmeth.   */ /* XXX remove */
-       constant_classref *classref;  /* class containing this field/meth./intfm. */
-       utf       *name;        /* field/method/interfacemethod name              */
-       utf       *descriptor;  /* field/method/intfmeth. type descriptor string  */
-       parseddesc parseddesc;  /* parsed descriptor                              */
-} constant_FMIref;
-
-
 typedef struct {            /* Integer                                        */
        s4 value;
 } constant_integer;
@@ -179,9 +168,12 @@ inline u4 suck_u4(classbuffer *cb);
 void loader_close(void);
 
 /* class loading functions */
-classinfo *load_class_from_classloader(classinfo *c, java_objectheader *cl);
-classinfo *load_class_bootstrap(classinfo *c);
+bool load_class_from_sysloader(utf *name, classinfo **result);
+bool load_class_from_classloader(utf *name, java_objectheader *cl, classinfo **result);
+bool load_class_bootstrap(utf *name,classinfo **result);
+/* (don't use the following directly:) */
 classinfo *load_class_from_classbuffer(classbuffer *cb);
+bool load_newly_created_array(classinfo *c,java_objectheader *loader);
 
 
 /* retrieve constantpool element */
@@ -207,55 +199,17 @@ methodinfo *class_resolvemethod_approx(classinfo *c, utf *name, utf *dest);
 
 bool class_issubclass(classinfo *sub, classinfo *super);
 
-/* call initializer of class */
-classinfo *class_init(classinfo *c);
-
 /* debug purposes */
 void class_showmethods(classinfo *c);
 void class_showconstantpool(classinfo *c);
-void print_arraydescriptor(FILE *file, arraydescriptor *desc);
 
 /* return the primitive class inidicated by the given signature character */
 classinfo *class_primitive_from_sig(char sig);
 
 
-/* return the class indicated by the given descriptor */
-/* (see loader.c for documentation) */
-#define CLASSLOAD_NEW           0      /* default */
-#define CLASSLOAD_LOAD          0x0001
-#define CLASSLOAD_SKIP          0x0002
-#define CLASSLOAD_PANIC         0      /* default */
-#define CLASSLOAD_NOPANIC       0x0010
-#define CLASSLOAD_PRIMITIVE     0      /* default */
-#define CLASSLOAD_NULLPRIMITIVE 0x0020
-#define CLASSLOAD_VOID          0      /* default */
-#define CLASSLOAD_NOVOID        0x0040
-#define CLASSLOAD_NOCHECKEND    0      /* default */
-#define CLASSLOAD_CHECKEND      0x1000
-
-classinfo *class_from_descriptor(char *utf_ptr,char *end_ptr,char **next,int mode);
-int type_from_descriptor(classinfo **cls,char *utf_ptr,char *end_ptr,char **next,int mode);
-
-/* (used by class_new, don't use directly) */
-void class_new_array(classinfo *c);
-
-#define LAZYLOADING(class) { \
-        if (!class->loaded) \
-            if (!class_load(class)) \
-                return 0; \
-        if (!class->linked) \
-            if (!class_link(class)) \
-                return 0; }
-
-
-
-#define LAZYLOADING1(class) { \
-        if (!class->loaded) \
-            if (!class_load(class)) \
-                return; \
-        if (!class->linked) \
-            if (!class_link(class)) \
-                return; }
+/* debug helpers */
+void fprintflags(FILE *fp, u2 f);
+void printflags(u2 f);
 
 #endif /* _LOADER_H */