- Calling the class loader
- Running the main method
- $Id: cacao.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: cacao.c 2195 2005-04-03 16:53:16Z edwin $
*/
#include "vm/statistics.h"
#include "vm/stringlocal.h"
#include "vm/tables.h"
+#include "vm/classcache.h"
#include "vm/jit/asmpart.h"
#include "vm/jit/jit.h"
mainstring = getmainclassnamefromjar((JNIEnv *) &env, mainstring);
}
- /* get system classloader */
-
- m = class_resolveclassmethod(class_java_lang_ClassLoader,
- utf_new_char("getSystemClassLoader"),
- utf_new_char("()Ljava/lang/ClassLoader;"),
- class_java_lang_Object,
- false);
-
- cl = (classinfo *) asm_calljavafunction(m, NULL, NULL, NULL, NULL);
-
- /* get `loadClass' method */
-
- m = class_resolveclassmethod(cl->header.vftbl->class,
- utf_loadClass,
- utf_java_lang_String__java_lang_Class,
- class_java_lang_Object,
- false);
-
/* load the main class */
- mainclass =
- (classinfo *) asm_calljavafunction(m,
- cl,
- javastring_new_char(mainstring),
- NULL,
- NULL);
+ if (!load_class_from_sysloader(utf_new_char(mainstring),&mainclass))
+ throw_main_exception_exit();
/* error loading class, clear exceptionptr for new exception */
methodinfo *m;
u4 slot;
s4 i;
+ classcache_name_entry *nmen;
+ classcache_class_entry *clsen;
+ classcache_loader_entry *lden;
/* create all classes found in the classpath */
/* XXX currently only works with zip/jar's */
create_all_classes();
- /* load and link all classes */
- for (slot = 0; slot < class_hash.size; slot++) {
- c = class_hash.ptr[slot];
-
- while (c) {
- assert(c->loaded);
-
- if (!c->linked)
- if (!link_class(c))
- throw_main_exception_exit();
-
- /* compile all class methods */
- for (i = 0; i < c->methodscount; i++) {
- m = &(c->methods[i]);
- if (m->jcode) {
- (void) jit_compile(m);
+ /* link all classes */
+ for (slot=0; slot<classcache_hash.size; ++slot) {
+ nmen = (classcache_name_entry *) classcache_hash.ptr[slot];
+ for (; nmen; nmen=nmen->hashlink) {
+ /* iterate over all class entries */
+ for (clsen=nmen->classes; clsen; clsen=clsen->next) {
+ c = clsen->classobj;
+ if (!c)
+ continue;
+
+ assert(c);
+ assert(c->loaded);
+ /*utf_fprint_classname(stderr,c->name);fprintf(stderr,"\n");*/
+
+ if (!c->linked)
+ if (!link_class(c))
+ throw_main_exception_exit();
+
+ /* compile all class methods */
+ for (i = 0; i < c->methodscount; i++) {
+ m = &(c->methods[i]);
+ if (m->jcode) {
+ /*fprintf(stderr," compiling:");utf_fprint(stderr,m->name);fprintf(stderr,"\n");*/
+ (void) jit_compile(m);
+ }
}
}
-
- c = c->hashlink;
}
}
}
methodinfo *m;
/* create, load and link the main class */
- if (!load_class_bootstrap(utf_new_char(mainstring),&mainclass))
+ if (!load_class_from_sysloader(utf_new_char(mainstring),&mainclass))
throw_main_exception_exit();
if (!link_class(mainclass))
Martin Platter
Christian Thalinger
- $Id: jni.c 2194 2005-04-03 16:13:27Z twisti $
+ $Id: jni.c 2195 2005-04-03 16:53:16Z edwin $
*/
jclass FindClass(JNIEnv *env, const char *name)
{
- classinfo *c;
+ classinfo *c = NULL;
if (!load_class_bootstrap(utf_new_char_classname((char *) name),&c) || !link_class(c)) {
- class_remove(c);
-
return NULL;
}
java_objectheader *ivte;
*exceptionptr = NULL;
- ivtec = class_new(utf_new_char("java/lang/reflect/InvocationTargetException"));
- ivte = builtin_new(ivtec);
- asm_calljavafunction(class_resolvemethod(ivtec,
- utf_new_char("<init>"),
- utf_new_char("(Ljava/lang/Throwable;)V")),
- ivte,
- exceptionToWrap,
- 0,
- 0);
+ if (load_class_bootstrap(utf_new_char("java/lang/reflect/InvocationTargetException"),
+ &ivtec))
+ {
+ ivte = builtin_new(ivtec);
+ asm_calljavafunction(class_resolvemethod(ivtec,
+ utf_new_char("<init>"),
+ utf_new_char("(Ljava/lang/Throwable;)V")),
+ ivte,
+ exceptionToWrap,
+ 0,
+ 0);
+ }
if (*exceptionptr != NULL)
panic("jni.c: error while creating InvocationTargetException wrapper");
Changes: Christian Thalinger
- $Id: native.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: native.c 2195 2005-04-03 16:53:16Z edwin $
*/
}
}
+ c = class_array_of(class_java_lang_Class,true);
+ if (!c)
+ return NULL;
tmpArray = (java_objectarray*)
- builtin_newarray(size, class_array_of(class_java_lang_Class)->vftbl);
+ builtin_newarray(size, c->vftbl);
for(i = 0, current = start; i < size; i++, current--) {
c = *current;
Changes: Joseph Wenninger
Christian Thalinger
- $Id: VMClass.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: VMClass.c 2195 2005-04-03 16:53:16Z edwin $
*/
u = javastring_toutf(s, true);
- /* create a new class, ... */
-
- c = class_new(u);
-
/* try to load, ... */
- if (!load_class_bootstrap(c)) {
+ if (!load_class_bootstrap(u,&c)) {
classinfo *xclass;
xclass = (*exceptionptr)->vftbl->class;
int idx;
/* create Field object */
-/* c = (classinfo *) loader_load(utf_new_char("java/lang/reflect/Field")); */
- c = class_new(utf_new_char("java/lang/reflect/Field"));
+ if (!load_class_bootstrap(utf_new_char("java/lang/reflect/Field"),&c))
+ return NULL;
o = (java_lang_reflect_Field *) native_new_and_init(c);
/* get fieldinfo entry */
if ((c->fields[i].flags & ACC_PUBLIC) || (!public_only))
public_fields++;
-/* class_field = loader_load(utf_new_char("java/lang/reflect/Field")); */
- class_field = class_new(utf_new_char("java/lang/reflect/Field"));
-
- if (!class_field)
+ if (!load_class_bootstrap(utf_new_char("java/lang/reflect/Field"),&class_field))
return NULL;
/* create array of fields */
java_objectarray *exceptiontypes; /* the exceptions thrown by the method */
methodinfo *m; /* the method to be represented */
-/* c = (classinfo *) loader_load(utf_new_char("java/lang/reflect/Method")); */
- c = class_new(utf_new_char("java/lang/reflect/Method"));
+ if (!load_class_bootstrap(utf_new_char("java/lang/reflect/Method"),&c))
+ return NULL;
o = (java_lang_reflect_Method *) native_new_and_init(c);
/* find the method */
int pos = 0;
int i;
-/* class_method = (classinfo*) loader_load(utf_new_char ("java/lang/reflect/Method")); */
- class_method = class_new(utf_new_char("java/lang/reflect/Method"));
-
- if (!class_method)
+ if (!load_class_bootstrap(utf_new_char ("java/lang/reflect/Method"),&class_method))
return NULL;
/* JOWENN: array classes do not declare methods according to mauve test. It should be considered, if
u = javastring_toutf(name, true);
- /* class_new "loads" the array class */
-
- c = class_new(u);
+ /* load the array class */
- /* set the classloader */
-
- c->classloader = (java_objectheader*) classloader; /* XXX is this correct? */
+ if (!load_class_from_classloader(u,(java_objectheader*)classloader,&c))
+ return NULL;
use_class_as_object(c);
Changes: Joseph Wenninger
Christian Thalinger
- $Id: VMClassLoader.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: VMClassLoader.c 2195 2005-04-03 16:53:16Z edwin $
*/
classinfo *c;
classinfo *r;
classbuffer *cb;
+ utf *utfname;
if ((off < 0) || (len < 0) || ((off + len) > buf->header.size)) {
*exceptionptr =
}
/* convert '.' to '/' in java string */
+ utfname = javastring_toutf(name, true);
+
+ /* check if this class has already been defined */
+ c = classcache_lookup_defined((java_objectheader *)this,utfname);
+ if (c)
+ return c;
- c = class_new(javastring_toutf(name, true));
+ /* create a new classinfo struct */
+ c = create_classinfo(utfname);
#if defined(USE_THREADS)
/* enter a monitor on the class */
-
builtin_monitorenter((java_objectheader *) c);
#endif
if (!r) {
/* If return value is NULL, we had a problem and the class is not */
/* loaded. */
-
- c->loaded = false;
-
/* now free the allocated memory, otherwise we could ran into a DOS */
- class_remove(c);
+ class_free(c);
return NULL;
}
Changes:
- $Id: VMStackWalker.c 1919 2005-02-10 10:08:53Z twisti $
+ $Id: VMStackWalker.c 2195 2005-04-03 16:53:16Z edwin $
*/
*/
JNIEXPORT java_objectarray* JNICALL Java_gnu_classpath_VMStackWalker_getClassContext(JNIEnv *env, jclass clazz)
{
+ classinfo *c;
if (cacao_initializing)
return 0;
#else
/* XXX TWISTI: only a quick hack */
- return (java_objectarray *) builtin_newarray(0, class_array_of(class_java_lang_Class)->vftbl);
+ c = class_array_of(class_java_lang_Class,true);
+ if (!c)
+ return NULL;
+ return (java_objectarray *) builtin_newarray(0, c->vftbl);
#endif
}
Changes: Joseph Wenninger
- $Id: VMThread.c 1971 2005-03-01 20:06:36Z carolyn $
+ $Id: VMThread.c 2195 2005-04-03 16:53:16Z edwin $
*/
JNIEXPORT java_lang_Thread* JNICALL Java_java_lang_VMThread_currentThread(JNIEnv *env, jclass clazz)
{
java_lang_Thread *t;
+ classinfo *threadgroupclass;
if (runverbose)
log_text("java_lang_VMThread_currentThread called");
if (runverbose)
log_text("java_lang_VMThread_currentThread 222");
- t->group = (java_lang_ThreadGroup *)
- native_new_and_init(class_new(utf_new_char("java/lang/ThreadGroup")));
+ if (!load_class_bootstrap(utf_new_char("java/lang/ThreadGroup"),&threadgroupclass))
+ return NULL;
+
+ t->group = (java_lang_ThreadGroup *) native_new_and_init(threadgroupclass);
if (runverbose)
log_text("java_lang_VMThread_currentThread 333");
{
methodinfo *m;
java_objectheader *o;
- classinfo *c=class_new(utf_new_char("java/lang/VMThread"));
-
- if (!c)
- return *exceptionptr;
+ classinfo *c;
+
+ if (!load_class_bootstrap(utf_new_char("java/lang/VMThread"),&c))
+ return *exceptionptr;
o = builtin_new(c); /* create object */
void
initThreads(u1 *stackbottom)
{
+ classinfo *c;
thread *the_main_thread;
int i;
char mainname[] = "main";
}
/* Allocate a thread to be the main thread */
+ if (!load_class_bootstrap(utf_new_char("java/lang/Thread"),&c))
+ panic("Could not load java/lang/Thread");
liveThreads = the_main_thread =
- (thread *) builtin_new(class_new(utf_new_char("java/lang/Thread")));
+ (thread *) builtin_new(c);
the_main_thread->vmThread=init_vmthread(the_main_thread);
assert(the_main_thread != 0);
calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: builtin.c 2195 2005-04-03 16:53:16Z edwin $
*/
java_objectarray *builtin_anewarray(s4 size, classinfo *component)
{
+ classinfo *c;
+
/* is class loaded */
assert(component->loaded);
if (!link_class(component))
return NULL;
- return (java_objectarray *) builtin_newarray(size, class_array_of(component)->vftbl);
+ c = class_array_of(component,true);
+ if (!c)
+ return NULL;
+ return (java_objectarray *) builtin_newarray(size, c->vftbl);
}
Andreas Krall
Christian Thalinger
- $Id: class.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: class.c 2195 2005-04-03 16:53:16Z edwin $
*/
#include "vm/tables.h"
#include "vm/utf8.h"
#include "vm/loader.h"
+#include "vm/classcache.h"
/******************************************************************************/
/* global variables ***********************************************************/
-hashtable class_hash; /* hashtable for classes */
-
list unlinkedclasses; /* this is only used for eager class */
/* loading */
classinfo *pseudo_class_Null = NULL;
classinfo *pseudo_class_New = NULL;
-/* class_new *******************************************************************
-
- Searches for the class with the specified name in the classes
- hashtable, if there is no such class a new classinfo structure is
- created and inserted into the list of classes to be loaded.
-
-*******************************************************************************/
-
-classinfo *class_new(utf *classname)
-{
- classinfo *c;
-
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- tables_lock();
-#endif
-
- /* we support eager class loading and linking on demand */
- if (opt_eager) {
- classinfo *tc;
- classinfo *tmp;
-
- list_init(&unlinkedclasses, OFFSET(classinfo, listnode));
-
- if (!load_class_bootstrap(classname,&c)) {
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- tables_unlock();
-#endif
- return NULL;
- }
-
- /* link all referenced classes */
-
- tc = list_first(&unlinkedclasses);
-
- while (tc) {
- /* skip the current loaded/linked class */
- if (tc != c) {
- if (!link_class(tc)) {
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- tables_unlock();
-#endif
- return c;
- }
- }
-
- /* we need a tmp variable here, because list_remove sets prev and
- next to NULL */
- tmp = list_next(&unlinkedclasses, tc);
- list_remove(&unlinkedclasses, tc);
- tc = tmp;
- }
-
- if (!c->linked) {
- if (!link_class(c)) {
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- tables_unlock();
-#endif
- return c;
- }
- }
- }
- else {
- c = class_new_intern(classname);
- }
-
-
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- tables_unlock();
-#endif
-
- return c;
-}
-
-
-classinfo *class_new_intern(utf *classname)
+classinfo *create_classinfo(utf *classname)
{
classinfo *c; /* hashtable element */
- u4 key; /* hashkey computed from classname */
- u4 slot; /* slot in hashtable */
- u2 i;
-
- key = utf_hashkey(classname->text, classname->blength);
- slot = key & (class_hash.size - 1);
- c = class_hash.ptr[slot];
-
- /* search external hash chain for the class */
- while (c) {
- if (c->name->blength == classname->blength) {
- for (i = 0; i < classname->blength; i++)
- if (classname->text[i] != c->name->text[i]) goto nomatch;
-
- /* class found in hashtable */
- return c;
- }
-
- nomatch:
- c = c->hashlink; /* next element in external chain */
- }
-
- /* location in hashtable found, create new classinfo structure */
#if defined(STATISTICS)
if (opt_stat)
c->classloader = NULL;
c->sourcefile = NULL;
- /* insert class into the hashtable */
- c->hashlink = class_hash.ptr[slot];
- class_hash.ptr[slot] = c;
-
- /* update number of hashtable-entries */
- class_hash.entries++;
-
- if (class_hash.entries > (class_hash.size * 2)) {
-
- /* reorganization of hashtable, average length of
- the external chains is approx. 2 */
-
- u4 i;
- classinfo *c;
- hashtable newhash; /* the new hashtable */
-
- /* create new hashtable, double the size */
- init_hashtable(&newhash, class_hash.size * 2);
- newhash.entries = class_hash.entries;
-
- /* transfer elements to new hashtable */
- for (i = 0; i < class_hash.size; i++) {
- c = (classinfo *) class_hash.ptr[i];
- while (c) {
- classinfo *nextc = c->hashlink;
- u4 slot = (utf_hashkey(c->name->text, c->name->blength)) & (newhash.size - 1);
-
- c->hashlink = newhash.ptr[slot];
- newhash.ptr[slot] = c;
-
- c = nextc;
- }
- }
-
- /* dispose old table */
- MFREE(class_hash.ptr, void*, class_hash.size);
- class_hash = newhash;
- }
-
- /* Array classes need further initialization. */
if (c->name->text[0] == '[') {
/* Array classes are not loaded from classfiles. */
- c->loaded = true;
- class_new_array(c);
c->packagename = array_packagename;
} else {
return c;
}
-
-/* class_get *******************************************************************
-
- Searches for the class with the specified name in the classes
- hashtable if there is no such class NULL is returned.
-
-*******************************************************************************/
-
-classinfo *class_get(utf *classname)
-{
- classinfo *c; /* hashtable element */
- u4 key; /* hashkey computed from classname */
- u4 slot; /* slot in hashtable */
- u2 i;
-
- key = utf_hashkey(classname->text, classname->blength);
- slot = key & (class_hash.size-1);
- c = class_hash.ptr[slot];
-
- /* search external hash-chain */
- while (c) {
- if (c->name->blength == classname->blength) {
- /* compare classnames */
- for (i = 0; i < classname->blength; i++)
- if (classname->text[i] != c->name->text[i])
- goto nomatch;
-
- /* class found in hashtable */
- return c;
- }
-
- nomatch:
- c = c->hashlink;
- }
-
- /* class not found */
- return NULL;
-}
-
-
-/* class_remove ****************************************************************
-
- Removes the class entry wth the specified name in the classes
- hashtable, furthermore the class' resources are freed if there is
- no such class false is returned.
-
-*******************************************************************************/
-
-bool class_remove(classinfo *c)
-{
- classinfo *tc; /* hashtable element */
- classinfo *pc;
- u4 key; /* hashkey computed from classname */
- u4 slot; /* slot in hashtable */
- u2 i;
-
- key = utf_hashkey(c->name->text, c->name->blength);
- slot = key & (class_hash.size - 1);
- tc = class_hash.ptr[slot];
- pc = NULL;
-
- /* search external hash-chain */
- while (tc) {
- if (tc->name->blength == c->name->blength) {
-
- /* compare classnames */
- for (i = 0; i < c->name->blength; i++)
- if (tc->name->text[i] != c->name->text[i])
- goto nomatch;
-
- /* class found in hashtable */
- if (!pc)
- class_hash.ptr[slot] = tc->hashlink;
- else
- pc->hashlink = tc->hashlink;
-
- class_free(tc);
-
- return true;
- }
-
- nomatch:
- pc = tc;
- tc = tc->hashlink;
- }
-
- /* class not found */
- return false;
-}
-
-
/* class_freepool **************************************************************
Frees all resources used by this classes Constant Pool.
/* GCFREE(c); */
}
+/* get_array_class *************************************************************
+
+ Returns the array class with the given name for the given classloader.
+
+*******************************************************************************/
+
+static classinfo *get_array_class(utf *name,java_objectheader *initloader,
+ java_objectheader *defloader,bool link)
+{
+ classinfo *c;
+
+ /* lookup this class in the classcache */
+ c = classcache_lookup(initloader,name);
+ if (c)
+ return c;
+ c = classcache_lookup_defined(defloader,name);
+ if (c)
+ return c;
+
+ /* we have to create it */
+ c = create_classinfo(name);
+ if (!load_newly_created_array(c,initloader))
+ return NULL;
+
+ CLASS_ASSERT(c);
+ CLASS_ASSERT(c->loaded);
+ CLASS_ASSERT(c->classloader == defloader);
+
+ if (link && !c->linked)
+ if (!link_class(c))
+ return NULL;
+
+ CLASS_ASSERT(!link || c->linked);
+
+ return c;
+}
/* class_array_of **************************************************************
*******************************************************************************/
-classinfo *class_array_of(classinfo *component)
+classinfo *class_array_of(classinfo *component,bool link)
{
s4 namelen;
char *namebuf;
- classinfo *c;
+ utf *arrayname;
/* Assemble the array class name */
namelen = component->name->blength;
namelen += 3;
}
- c = class_new(utf_new(namebuf, namelen));
-
- /* load this class and link it */
-
- c->loaded = true;
-
- if (!c->linked)
- if (!link_class(c))
- return NULL;
-
- return c;
+ return get_array_class(utf_new(namebuf, namelen),component->classloader,component->classloader,link);
}
*******************************************************************************/
-classinfo *class_multiarray_of(s4 dim, classinfo *element)
+classinfo *class_multiarray_of(s4 dim, classinfo *element,bool link)
{
s4 namelen;
char *namebuf;
}
memset(namebuf, '[', dim);
- return class_new(utf_new(namebuf, namelen));
+ return get_array_class(utf_new(namebuf, namelen),element->classloader,element->classloader,link);
}
/* class_lookup_classref *******************************************************
Changes:
- $Id: class.h 2193 2005-04-02 19:33:43Z edwin $
+ $Id: class.h 2195 2005-04-03 16:53:16Z edwin $
*/
u2 innerclasscount; /* number of inner classes */
innerclassinfo *innerclass;
- classinfo *hashlink; /* link for external hash chain */
bool classvftbl; /* has its own copy of the Class vtbl */
s4 classUsed; /* 0= not used 1 = used CO-RT */
/* global variables ***********************************************************/
-extern hashtable class_hash; /* hashtable for classes */
-
extern list unlinkedclasses; /* this is only used for eager class loading */
/* function prototypes ********************************************************/
-/* search for class and create it if not found */
-classinfo *class_new(utf *u);
-
-/* without locking (caller already holding lock*/
-classinfo *class_new_intern(utf *u);
-
-/* search for class in classtable */
-classinfo *class_get(utf *u);
-
-/* remove class from classtable */
-bool class_remove(classinfo *c);
+/* create a new classinfo struct */
+classinfo *create_classinfo(utf *u);
/* frees all resources used by the class */
void class_free(classinfo *);
/* return an array class with the given component class */
-classinfo *class_array_of(classinfo *component);
+classinfo *class_array_of(classinfo *component,bool link);
/* return an array class with the given dimension and element class */
-classinfo *class_multiarray_of(s4 dim, classinfo *element);
+classinfo *class_multiarray_of(s4 dim, classinfo *element,bool link);
/* return a classref for the given class name */
/* (does a linear search!) */
Changes:
- $Id: classcache.c 2190 2005-04-02 10:07:44Z edwin $
+ $Id: classcache.c 2195 2005-04-03 16:53:16Z edwin $
*/
/* GLOBAL VARIABLES */
/*============================================================================*/
-static hashtable classcache_hash;
+hashtable classcache_hash;
/*============================================================================*/
/* */
return cls;
}
+/* classcache_lookup_defined ***************************************************
+
+ Lookup a class with the given name and defining loader
+
+ IN:
+ defloader........defining loader
+ classname........class name
+
+ RETURN VALUE:
+ The return value is a pointer to the cached class object,
+ or NULL, if the class is not in the cache.
+
+*******************************************************************************/
+
+classinfo *
+classcache_lookup_defined(classloader *defloader,utf *classname)
+{
+ classcache_name_entry *en;
+ classcache_class_entry *clsen;
+ classcache_loader_entry *lden;
+ classinfo *cls = NULL;
+
+ CLASSCACHE_LOCK();
+
+ en = classcache_lookup_name(classname);
+
+ if (en) {
+ /* iterate over all class entries */
+ for (clsen=en->classes; clsen; clsen=clsen->next) {
+ if (!clsen->classobj)
+ continue;
+
+ /* check if this entry has been defined by defloader */
+ if (clsen->classobj->classloader == defloader) {
+ cls = clsen->classobj;
+ goto found;
+ }
+ }
+ }
+found:
+ CLASSCACHE_UNLOCK();
+ return cls;
+}
+
/* classcache_store ************************************************************
Store a loaded class
classcache_loader_entry *lden;
CLASSCACHE_ASSERT(cls);
+ CLASSCACHE_ASSERT(cls->loaded);
#ifdef CLASSCACHE_VERBOSE
fprintf(stderr,"classcache_store(%p,",initloader);
Changes:
- $Id: classcache.h 2181 2005-04-01 16:53:33Z edwin $
+ $Id: classcache.h 2195 2005-04-03 16:53:16Z 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 ********************************************************************/
classinfo * classcache_lookup(classloader *initloader,utf *classname);
+/* classcache_lookup_defined ***************************************************
+
+ Lookup a class with the given name and defining loader
+
+ IN:
+ defloader........defining loader
+ classname........class name
+
+ RETURN VALUE:
+ The return value is a pointer to the cached class object,
+ or NULL, if the class is not in the cache.
+
+*******************************************************************************/
+
+classinfo * classcache_lookup_defined(classloader *defloader,utf *classname);
+
/* classcache_store ************************************************************
Store a loaded class
Authors: Carolyn Oates
- $Id: parseXTA.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: parseXTA.c 2195 2005-04-03 16:53:16Z edwin $
*/
char *class;
char *desc;
classSetNode *p=NULL;
+ classinfo *clsinfo;
+
if (debugInfo >= 1) {
printf("In descriptor2typesL >>>\t"); fflush(stdout);
utf_display(m->class->name); printf(".");
class = strtok(desc,";");
desc = strtok(NULL,"\0");
/* get/save classinfo ptr */
- classtypes[pcount-1] = class_get(utf_new_char(class));
- p = addClassCone(p, class_get(utf_new_char(class)));
+ if (!load_class_bootstrap(utf_new_char(class),&clsinfo))
+ panic("could not load class in descriptor2typesL");
+ classtypes[pcount-1] = clsinfo;
+ p = addClassCone(p, clsinfo);
if (debugInfo >= 1) {
printf("LParam#%i 's class type is: %s\n",pcount-1,class);fflush(stdout);
printf("Lclasstypes[%i]=",pcount-1);fflush(stdout);
class = strtok(desc,";");
desc = strtok(NULL,"\0");
/* get/save classinfo ptr */
- classtypes[pcount-1] = class_get(utf_new_char(class));
- p= addClassCone(p, class_get(utf_new_char(class)));
+ if (!load_class_bootstrap(utf_new_char(class),&clsinfo))
+ panic("could not load class in descriptor2typesL");
+ classtypes[pcount-1] = clsinfo;
+ p= addClassCone(p, clsinfo);
if (debugInfo >= 1) {
printf("[Param#%i 's class type is: %s\n",pcount-1,class);
printf("[classtypes[%i]=",pcount-1);fflush(stdout);
/* get class string */
class = strtok(desc,";");
- m->returnclass = class_get(utf_new_char(class));
+ if (!load_class_bootstrap(utf_new_char(class),&clsinfo))
+ panic("could not load class in descriptor2typesL");
+ m->returnclass = clsinfo;
if (m->returnclass == NULL) {
printf("class=<%s>\t",class); fflush(stdout);
panic ("return class not found");
desc = MNEW(char, 256);
strcpy(desc,++utf_ptr);
cname = strtok(desc,";");
- class = class_get(utf_new_char(cname));
+ if (!load_class_bootstrap(utf_new_char(cname),&class))
+ panic("could not load class in xtaAddFldClassTypeInfo");
fi->xta->fldClassType= class; /* save field's type class ptr */
}
}
Edwin Steiner
Joseph Wenninger
- $Id: parse.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: parse.c 2195 2005-04-03 16:53:16Z edwin $
*/
i = code_get_u2(p + 1,inline_env->method);
{
classinfo *component;
+ classinfo *c;
constant_classref *cr =
(constant_classref*) class_getconstant(inline_env->method->class, i, CONSTANT_Class);
cr,resolveEager,true,&component))
return NULL;
- LOADCONST_A_BUILTIN(class_array_of(component)->vftbl);
+ c = class_array_of(component,true);
+ if (!c)
+ return NULL;
+ LOADCONST_A_BUILTIN(c->vftbl);
s_count++;
BUILTIN2(BUILTIN_newarray, TYPE_ADR, currentline);
}
Authors: Joseph Wenninger
- $Id: stacktrace.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: stacktrace.c 2195 2005-04-03 16:53:16Z edwin $
*/
}
}
+ c = class_array_of(class_java_lang_Class,true);
+ if (!c)
+ panic("Could not create array class in classContextCollector");
tmpArray =
- builtin_newarray(targetSize, class_array_of(class_java_lang_Class)->vftbl);
+ builtin_newarray(targetSize, c->vftbl);
for(i = 0, current = start; i < targetSize; i++, current++) {
if (current->method==0) { i--; continue;}
Authors: Edwin Steiner
- $Id: typeinfo.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: typeinfo.c 2195 2005-04-03 16:53:16Z edwin $
*/
}
else {
vftbl_t *comp;
+
+ if (!srcarray->typeclass.cls->linked)
+ if (!link_class(srcarray->typeclass.cls))
+ panic("XXX could not link class");
TYPEINFO_ASSERT(srcarray->typeclass.cls->vftbl);
TYPEINFO_ASSERT(srcarray->typeclass.cls->vftbl->arraydesc);
elementclass.any = NULL;
}
else {
- common.cls = class_multiarray_of(dimension,pseudo_class_Arraystub);
+ common.cls = class_multiarray_of(dimension,pseudo_class_Arraystub,true);
+ if (!common.cls)
+ panic("XXX Coult not create array class");
elementtype = ARRAYTYPE_OBJECT;
elementclass.cls = pseudo_class_Arraystub;
}
/* DEBUG */ /* log_text("finding resulting array class: "); */
if (IS_CLASSREF(elementclass))
common.ref = class_get_classref_multiarray_of(dimension,elementclass.ref);
- else
- common.cls = class_multiarray_of(dimension,elementclass.cls);
+ else {
+ common.cls = class_multiarray_of(dimension,elementclass.cls,true);
+ if (!common.cls)
+ panic("XXX Coult not create array class");
+ }
/* DEBUG */ /* utf_display(common->name); printf("\n"); */
}
else {
info->elementtype = ARRAYTYPE_OBJECT;
info->elementclass = info->typeclass;
}
- info->typeclass = class_array_of(info->typeclass);
+ info->typeclass = class_array_of(info->typeclass,true);
}
#endif
Edwin Steiner
Christian Thalinger
- $Id: linker.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: linker.c 2195 2005-04-03 16:53:16Z edwin $
*/
/* pseudo class for Arraystubs (extends java.lang.Object) */
- pseudo_class_Arraystub = class_new_intern(utf_new_char("$ARRAYSTUB$"));
+ pseudo_class_Arraystub = create_classinfo(utf_new_char("$ARRAYSTUB$"));
pseudo_class_Arraystub->loaded = true;
pseudo_class_Arraystub->super.cls = class_java_lang_Object;
pseudo_class_Arraystub->interfacescount = 2;
pseudo_class_Arraystub->interfaces = MNEW(classref_or_classinfo, 2);
pseudo_class_Arraystub->interfaces[0].cls = class_java_lang_Cloneable;
pseudo_class_Arraystub->interfaces[1].cls = class_java_io_Serializable;
+ if (!classcache_store(NULL,pseudo_class_Arraystub))
+ panic("could not cache pseudo_class_Arraystub");
if (!link_class(pseudo_class_Arraystub))
return false;
/* pseudo class representing the null type */
- pseudo_class_Null = class_new_intern(utf_new_char("$NULL$"));
+ pseudo_class_Null = create_classinfo(utf_new_char("$NULL$"));
pseudo_class_Null->loaded = true;
pseudo_class_Null->super.cls = class_java_lang_Object;
+ if (!classcache_store(NULL,pseudo_class_Null))
+ panic("could not cache pseudo_class_Null");
if (!link_class(pseudo_class_Null))
return false;
/* pseudo class representing new uninitialized objects */
- pseudo_class_New = class_new_intern(utf_new_char("$NEW$"));
+ pseudo_class_New = create_classinfo(utf_new_char("$NEW$"));
pseudo_class_New->loaded = true;
pseudo_class_New->linked = true; /* XXX is this allright? */
pseudo_class_New->super.cls = class_java_lang_Object;
-
+ if (!classcache_store(NULL,pseudo_class_New))
+ panic("could not cache pseudo_class_New");
/* create classes representing primitive types */
continue;
/* create primitive class */
- c = class_new_intern(utf_new_char(primitivetype_table[i].name));
+ c = create_classinfo(utf_new_char(primitivetype_table[i].name));
c->classUsed = NOTUSED; /* not used initially CO-RT */
c->impldBy = NULL;
/* prevent loader from loading primitive class */
c->loaded = true;
+ if (!classcache_store(NULL,c)) {
+ log_text("Could not cache primitive class");
+ return false;
+ }
if (!link_class(c))
return false;
/* create the primitive array class */
if (primitivetype_table[i].arrayname) {
- c = class_new_intern(utf_new_char(primitivetype_table[i].arrayname));
+ c = create_classinfo(utf_new_char(primitivetype_table[i].arrayname));
+ if (!load_newly_created_array(c,NULL))
+ return false;
primitivetype_table[i].arrayclass = c;
- c->loaded = true;
+ assert(c->loaded);
if (!c->linked)
if (!link_class(c))
return false;
{
classinfo *r;
+ if (!c) {
+ *exceptionptr = new_nullpointerexception();
+ return NULL;
+ }
+
#if defined(USE_THREADS)
/* enter a monitor on the class */
switch (c->name->text[1]) {
case '[':
/* c is an array of arrays. */
- comp = class_new(utf_new_intern(c->name->text + 1, namelen - 1));
- if (!comp)
- panic("Could not find component array class.");
+ if (!load_class_from_classloader(utf_new_intern(c->name->text + 1, namelen - 1),
+ c->classloader,&comp))
+ return NULL;
break;
case 'L':
/* c is an array of objects. */
- comp = class_new(utf_new_intern(c->name->text + 2, namelen - 3));
- if (!comp)
- panic("Could not find component class.");
+ if (!load_class_from_classloader(utf_new_intern(c->name->text + 2, namelen - 3),
+ c->classloader,&comp))
+ return NULL;
break;
}
/* If the component type has not been linked, link it now */
+ assert(!comp || comp->loaded);
if (comp && !comp->linked) {
- assert(comp->loaded);
if (!link_class(comp))
return NULL;
Edwin Steiner
Christian Thalinger
- $Id: loader.c 2193 2005-04-02 19:33:43Z edwin $
+ $Id: loader.c 2195 2005-04-03 16:53:16Z edwin $
*/
#undef JOWENN_DEBUG1
#undef JOWENN_DEBUG2
+#ifdef LOADER_VERBOSE
+static int loader_recursion = 0;
+#define LOADER_INDENT() do { int i; for(i=0;i<loader_recursion;++i) fputs(" ",stderr); } while (0)
+#define LOADER_INC() loader_recursion++
+#define LOADER_DEC() loader_recursion--
+#else
+#define LOADER_INC()
+#define LOADER_DEC()
+#endif
+
/********************************************************************
list of classpath entries (either filesystem directories or
void create_all_classes()
{
classpath_info *cpi;
+ classinfo *c;
for (cpi = classpath_entries; cpi != 0; cpi = cpi->next) {
#if defined(USE_ZLIB)
ce = s->cacao_dir_list;
while (ce) {
- (void) class_new(ce->name);
+ load_class_bootstrap(ce->name,&c);
ce = ce->next;
}
return true;
}
+/* load_class_from_sysloader ***************************************************
+
+ Load the class with the given name using the system class loader
+
+ IN:
+ name.............the classname
+
+
+ OUT:
+ *result..........set to the loaded class
+
+ RETURN VALUE:
+ true.............everything ok
+ false............an exception has been thrown
+
+*******************************************************************************/
+
+bool load_class_from_sysloader(utf *name,classinfo **result)
+{
+ methodinfo *m;
+ java_objectheader *cl;
+ bool success;
+
+#ifdef LOADER_VERBOSE
+ LOADER_INDENT();
+ fprintf(stderr,"load_class_from_sysloader(");
+ utf_fprint(stderr,name);fprintf(stderr,")\n");
+#endif
+
+ LOADER_ASSERT(class_java_lang_Object);
+ LOADER_ASSERT(class_java_lang_ClassLoader);
+ LOADER_ASSERT(class_java_lang_ClassLoader->linked);
+
+ m = class_resolveclassmethod(class_java_lang_ClassLoader,
+ utf_new_char("getSystemClassLoader"), /* XXX use variable */
+ utf_new_char("()Ljava/lang/ClassLoader;"), /* XXX use variable */
+ class_java_lang_Object,
+ false);
+
+ if (!m)
+ return false; /* exception */
+
+ cl = (java_objectheader *) asm_calljavafunction(m, NULL, NULL, NULL, NULL);
+ if (!cl)
+ return false; /* exception */
+
+ LOADER_INC();
+ success = load_class_from_classloader(name,cl,result);
+ LOADER_DEC();
+ return success;
+}
/* load_class_from_classloader *************************************************
bool load_class_from_classloader(utf *name,java_objectheader *cl,classinfo **result)
{
classinfo *r;
+ bool success;
LOADER_ASSERT(name);
LOADER_ASSERT(result);
#ifdef LOADER_VERBOSE
+ LOADER_INDENT();
fprintf(stderr,"load_class_from_classloader(");
utf_fprint(stderr,name);fprintf(stderr,",%p)\n",(void*)cl);
#endif
/* lookup if this class has already been loaded */
*result = classcache_lookup(cl,name);
+#ifdef LOADER_VERBOSE
+ if (*result)
+ fprintf(stderr," cached -> %p\n",(void*)(*result));
+#endif
+
if (*result)
return true;
if (cl) {
methodinfo *lc;
+ /* handle array classes */
+ if (name->text[0] == '[') {
+ char *utf_ptr = name->text + 1;
+ int len = name->blength - 1;
+ classinfo *comp;
+ switch (*utf_ptr) {
+ case 'L':
+ utf_ptr++;
+ len -= 2;
+ /* FALLTHROUGH */
+ case '[':
+ /* load the component class */
+ LOADER_INC();
+ if (!load_class_from_classloader(utf_new(utf_ptr,len),cl,&comp)) {
+ LOADER_DEC();
+ return false;
+ }
+ LOADER_DEC();
+ /* create the array class */
+ *result = class_array_of(comp,false);
+ return (*result != 0);
+ break;
+ default:
+ /* primitive array classes are loaded by the bootstrap loader */
+ LOADER_INC();
+ success = load_class_bootstrap(name,result);
+ LOADER_DEC();
+ return success;
+ }
+ }
+
LOADER_ASSERT(class_java_lang_Object);
lc = class_resolveclassmethod(cl->vftbl->class,
if (!lc)
return false; /* exception */
+ LOADER_INC();
r = (classinfo *) asm_calljavafunction(lc,
cl,
javastring_new(name),
NULL, NULL);
+ LOADER_DEC();
/* store this class in the loaded class cache */
if (r && !classcache_store(cl,r)) {
r->loaded = false;
- class_remove(r);
+ class_free(r);
r = NULL; /* exception */
}
return (r != NULL);
}
- return load_class_bootstrap(name,result);
+ LOADER_INC();
+ success = load_class_bootstrap(name,result);
+ LOADER_DEC();
+ return success;
}
if (*result)
return true;
+ /* check if this class has already been defined */
+ *result = classcache_lookup_defined(NULL,name);
+ if (*result)
+ return true;
+
#ifdef LOADER_VERBOSE
+ LOADER_INDENT();
fprintf(stderr,"load_class_bootstrap(");
utf_fprint(stderr,name);fprintf(stderr,")\n");
#endif
/* create the classinfo */
- c = class_new(name);
-
- if (name == utf_java_lang_Object)
- class_java_lang_Object = c;
-
- /* store this class in the loaded class cache */
- /* XXX we temporarily need this to avoid loading a bootstrap class multiple times */
- if (!classcache_store(NULL,c)) {
- c->loaded = false;
- class_remove(c);
- return false;
- }
-
- if (c->loaded) {
+ c = create_classinfo(name);
+
+ /* handle array classes */
+ if (name->text[0] == '[') {
+ LOADER_INC();
+ load_newly_created_array(c,NULL);
+ LOADER_DEC();
+ LOADER_ASSERT(c->loaded);
*result = c;
return true;
}
/* load the class from the buffer */
+ LOADER_INC();
r = load_class_from_classbuffer(cb);
-
- /* if return value is NULL, we had a problem and the class is not loaded */
- if (!r) {
- c->loaded = false;
-
- /* now free the allocated memory, otherwise we could ran into a DOS */
- class_remove(c);
- }
+ LOADER_DEC();
/* free memory */
suck_stop(cb);
compilingtime_start();
#endif
-#if XXX
+ if (!r) {
+#if defined(USE_THREADS)
+ builtin_monitorexit((java_objectheader *) c);
+#endif
+ class_free(c);
+ }
+
/* store this class in the loaded class cache */
if (r && !classcache_store(NULL,c)) {
- c->loaded = false;
- class_remove(c);
+#if defined(USE_THREADS)
+ builtin_monitorexit((java_objectheader *) c);
+#endif
+ class_free(c);
r = NULL; /* exception */
}
-#endif
#if defined(USE_THREADS)
/* leave the monitor */
- builtin_monitorexit((java_objectheader *) c);
+ if (c) builtin_monitorexit((java_objectheader *) c);
#endif
*result = r;
if (c->loaded)
return c;
+#ifdef LOADER_VERBOSE
+ LOADER_INDENT();
+ fprintf(stderr,"load_class_from_classbuffer(");
+ utf_fprint(stderr,c->name);fprintf(stderr,")\n");
+ LOADER_INC();
+#endif
+
#if defined(STATISTICS)
if (opt_stat)
count_class_loads++;
if (loadverbose)
log_message_class("Loading done class: ", c);
+ LOADER_DEC();
return c;
return_exception:
dump_release(dumpsize);
/* an exception has been thrown */
+ LOADER_DEC();
return NULL;
}
-/******************* Function: class_new_array *********************************
+/***************** Function: load_newly_created_array**** **********************
+
+ Load a newly created array class.
+
+ Note:
+ This is an internal function. Do not use it unless you know exactly
+ what you are doing!
- This function is called by class_new to setup an array class.
+ Use one of the load_class_... functions for general array class loading.
*******************************************************************************/
-void class_new_array(classinfo *c)
+bool load_newly_created_array(classinfo *c,java_objectheader *loader)
{
classinfo *comp = NULL;
methodinfo *clone;
methoddesc *clonedesc;
constant_classref *classrefs;
int namelen;
+ java_objectheader *definingloader = NULL;
+
+#ifdef LOADER_VERBOSE
+ LOADER_INDENT();
+ fprintf(stderr,"load_newly_created_array(");utf_fprint_classname(stderr,c->name);
+ fprintf(stderr,") loader=%p\n",loader);
+#endif
/* Check array class name */
namelen = c->name->blength;
- if (namelen < 2 || c->name->text[0] != '[')
- panic("Invalid array class name");
+ if (namelen < 2 || c->name->text[0] != '[') {
+ *exceptionptr = new_internalerror("Invalid array class name");
+ return false;
+ }
/* Check the component type */
switch (c->name->text[1]) {
case '[':
/* c is an array of arrays. We have to create the component class. */
- if (opt_eager) {
- comp = class_new_intern(utf_new_intern(c->name->text + 1,
- namelen - 1));
- LOADER_ASSERT(comp->loaded);
- list_addfirst(&unlinkedclasses, comp);
-
- } else {
- comp = class_new(utf_new_intern(c->name->text + 1, namelen - 1));
+ LOADER_INC();
+ if (!load_class_from_classloader(utf_new_intern(c->name->text + 1,
+ namelen - 1),
+ loader,
+ &comp))
+ {
+ LOADER_DEC();
+ return false;
}
+ LOADER_DEC();
+ LOADER_ASSERT(comp->loaded);
+ if (opt_eager)
+ if (!link_class(c))
+ return false;
+ definingloader = comp->classloader;
break;
case 'L':
/* c is an array of objects. */
- if (namelen < 4 || c->name->text[namelen - 1] != ';')
- panic("Invalid array class name");
-
- if (opt_eager) {
- comp = class_new_intern(utf_new_intern(c->name->text + 2,
- namelen - 3));
- LOADER_ASSERT(comp->loaded);
- list_addfirst(&unlinkedclasses, comp);
+ if (namelen < 4 || c->name->text[namelen - 1] != ';') {
+ *exceptionptr = new_internalerror("Invalid array class name");
+ return false;
+ }
- } else {
- comp = class_new(utf_new_intern(c->name->text + 2, namelen - 3));
+ LOADER_INC();
+ if (!load_class_from_classloader(utf_new_intern(c->name->text + 2,
+ namelen - 3),
+ loader,
+ &comp))
+ {
+ LOADER_DEC();
+ return false;
}
+ LOADER_DEC();
+ LOADER_ASSERT(comp->loaded);
+ if (opt_eager)
+ if (!link_class(c))
+ return false;
+ definingloader = comp->classloader;
break;
}
c->parseddescsize = sizeof(methodinfo);
c->classrefs = classrefs;
c->classrefcount = 1;
+ c->classloader = definingloader;
- /* XXX insert class into the loaded class cache */
+ /* insert class into the loaded class cache */
+ if (!classcache_store(loader,c))
+ return false;
+
+ return true;
}
void loader_close()
{
- classinfo *c;
- s4 slot;
-
- for (slot = 0; slot < class_hash.size; slot++) {
- c = class_hash.ptr[slot];
-
- while (c) {
- class_free(c);
- c = c->hashlink;
- }
- }
}
Authors: Reinhard Grafl
- $Id: loader.h 2193 2005-04-02 19:33:43Z edwin $
+ $Id: loader.h 2195 2005-04-03 16:53:16Z edwin $
*/
void loader_close(void);
/* class loading functions */
+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 */
/* return the primitive class inidicated by the given signature character */
classinfo *class_primitive_from_sig(char sig);
-/* (used by class_new, don't use directly) */
-void class_new_array(classinfo *c);
/* debug helpers */
void fprintflags(FILE *fp, u2 f);
Changes:
- $Id: resolve.c 2194 2005-04-03 16:13:27Z twisti $
+ $Id: resolve.c 2195 2005-04-03 16:53:16Z edwin $
*/
return true; /* be lazy */
}
/* create the array class */
- cls = class_array_of(cls);
+ cls = class_array_of(cls,false);
+ if (!cls)
+ return false; /* exception */
}
}
else {
RESOLVE_ASSERT(mode == resolveEager || mode == resolveLazy);
RESOLVE_ASSERT(result);
+#ifdef RESOLVE_VERBOSE
+ fprintf(stderr,"resolve_classref_or_classinfo(");
+ utf_fprint(stderr,(IS_CLASSREF(cls)) ? cls.ref->name : cls.cls->name);
+ fprintf(stderr,",%i,%i)\n",mode,link);
+#endif
+
*result = NULL;
if (IS_CLASSREF(cls)) {
#ifdef RESOLVE_VERBOSE
fprintf(stderr,"unresolved_subtype_set_from_typeinfo\n");
#ifdef TYPEINFO_DEBUG
- typeinfo_print(stderr,tinfo,4);
+ /*typeinfo_print(stderr,tinfo,4);*/
fprintf(stderr,"\n");
#endif
fprintf(stderr," declared type:");utf_fprint(stderr,declaredtype->name);
fprintf(stderr," desc : ");utf_fprint(stderr,fieldref->descriptor);fputc('\n',stderr);
fprintf(stderr," type : ");descriptor_debug_print_typedesc(stderr,fieldref->parseddesc.fd);
fputc('\n',stderr);
- fprintf(stderr," opcode : %d %s\n",iptr[0].opc,icmd_names[iptr[0].opc]);
+ /*fprintf(stderr," opcode : %d %s\n",iptr[0].opc,icmd_names[iptr[0].opc]);*/
#endif
ref->fieldref = fieldref;
fprintf(stderr," class : ");utf_fprint(stderr,methodref->classref->name);fputc('\n',stderr);
fprintf(stderr," name : ");utf_fprint(stderr,methodref->name);fputc('\n',stderr);
fprintf(stderr," desc : ");utf_fprint(stderr,methodref->descriptor);fputc('\n',stderr);
- fprintf(stderr," opcode : %d %s\n",iptr[0].opc,icmd_names[iptr[0].opc]);
+ /*fprintf(stderr," opcode : %d %s\n",iptr[0].opc,icmd_names[iptr[0].opc]);*/
#endif
ref = NEW(unresolved_method);
- the heap
- additional support functions
- $Id: tables.c 2098 2005-03-27 19:00:02Z edwin $
+ $Id: tables.c 2195 2005-04-03 16:53:16Z edwin $
*/
{
init_hashtable(&utf_hash, UTF_HASHSTART); /* hashtable for utf8-symbols */
init_hashtable(&string_hash, HASHSTART); /* hashtable for javastrings */
- init_hashtable(&class_hash, HASHSTART); /* hashtable for classes */
classcache_init();
/* dispose hashtable structures */
MFREE(utf_hash.ptr, void*, utf_hash.size);
MFREE(string_hash.ptr, void*, string_hash.size);
- MFREE(class_hash.ptr, void*, class_hash.size);
}