Changes:
- $Id: classcache.h 2181 2005-04-01 16:53:33Z edwin $
+ $Id: classcache.h 3810 2005-11-27 14:11:44Z edwin $
*/
#include <stdio.h> /* for FILE */
#include "vm/references.h"
+#include "vm/tables.h"
/* forward declarations *******************************************************/
typedef java_objectheader classloader;
+/* global variables ***********************************************************/
+
+extern hashtable classcache_hash;
+
/* structs ********************************************************************/
struct classcache_name_entry
{
utf *name; /* class name */
- classcache_name_entry *hashlink; /* link for external chaining */
+ classcache_name_entry *hashlink; /* link for external chaining */
classcache_class_entry *classes; /* equivalence classes for this name*/
};
/* function prototypes ********************************************************/
-/* classcache_init *************************************************************
-
- Initialize the loaded class cache
-
-*******************************************************************************/
-
-void classcache_init();
-
-/* classcache_free *************************************************************
-
- Free the memory used by the class cache
-
- NOTE:
- The class cache may not be used any more after this call, except
- when it is reinitialized with classcache_init.
-
-*******************************************************************************/
-
-void classcache_free();
-
-/* classcache_lookup ***********************************************************
-
- Lookup a possibly loaded class
-
- IN:
- initloader.......initiating loader for resolving the class name
- classname........class name to look up
-
- RETURN VALUE:
- The return value is a pointer to the cached class object,
- or NULL, if the class is not in the cache.
-
-*******************************************************************************/
+/* initialize the loaded class cache */
+bool classcache_init(void);
+void classcache_free(void);
classinfo * classcache_lookup(classloader *initloader,utf *classname);
+classinfo * classcache_lookup_defined(classloader *defloader,utf *classname);
+classinfo * classcache_lookup_defined_or_initiated(classloader *loader,utf *classname);
-/* classcache_store ************************************************************
-
- Store a loaded class
-
- IN:
- initloader.......initiating loader used to load the class
- cls..............class object to cache
-
- RETURN VALUE:
- true.............everything ok, the class was stored in
- the cache if necessary,
- false............an exception has been thrown.
-
-*******************************************************************************/
-
-bool classcache_store(classloader *initloader,classinfo *cls);
-
-/* classcache_add_constraint ***************************************************
-
- Add a loading constraint
-
- IN:
- a................first initiating loader
- b................second initiating loader
- classname........class name
-
- RETURN VALUE:
- true.............everything ok, the constraint has been added,
- false............an exception has been thrown.
-
-*******************************************************************************/
+bool classcache_store_unique(classinfo *cls);
+classinfo * classcache_store(classloader *initloader,classinfo *cls,bool mayfree);
+classinfo * classcache_store_defined(classinfo *cls);
bool classcache_add_constraint(classloader *a,classloader *b,utf *classname);
-/* classcache_debug_dump *******************************************************
-
- Print the contents of the loaded class cache to a stream
-
- IN:
- file.............output stream
-
-*******************************************************************************/
-
void classcache_debug_dump(FILE *file);
#endif /* _CLASSCACHE_H */