Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: loader.c 8230 2007-07-25 08:23:10Z twisti $
-
*/
#include "mm/memory.h"
+#include "native/llni.h"
+
#include "threads/lock-common.h"
#include "toolbox/logging.h"
#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/global.h"
+#include "vm/primitive.h"
#include "vm/stringlocal.h"
#include "vm/vm.h"
#include "vmcore/loader.h"
#include "vmcore/method.h"
#include "vmcore/options.h"
-#include "vmcore/primitive.h"
#include "vmcore/rt-timing.h"
#if defined(ENABLE_STATISTICS)
if (!(class_java_util_Vector = load_class_bootstrap(utf_java_util_Vector)))
return false;
+# if defined(WITH_CLASSPATH_SUN)
+ if (!(class_sun_reflect_MagicAccessorImpl =
+ load_class_bootstrap(utf_new_char("sun/reflect/MagicAccessorImpl"))))
+ return false;
+# endif
+
if (!(arrayclass_java_lang_Object =
load_class_bootstrap(utf_new_char("[Ljava/lang/Object;"))))
return false;
+
+#if defined(ENABLE_ANNOTATIONS)
+ /* needed by annotation support */
+ if (!(class_sun_reflect_ConstantPool =
+ load_class_bootstrap(utf_new_char("sun/reflect/ConstantPool"))))
+ return false;
+
+#if defined(WITH_CLASSPATH_GNU)
+ /* needed by GNU Classpaths annotation support */
+ if (!(class_sun_reflect_annotation_AnnotationParser =
+ load_class_bootstrap(utf_new_char("sun/reflect/annotation/AnnotationParser"))))
+ return false;
+#endif
#endif
+#endif
+
return true;
}
classinfo *load_class_from_sysloader(utf *name)
{
- methodinfo *m;
- java_objectheader *cl;
- classinfo *c;
+ methodinfo *m;
+ classloader *cl;
+ classinfo *c;
assert(class_java_lang_Object);
assert(class_java_lang_ClassLoader);
*******************************************************************************/
-classinfo *load_class_from_classloader(utf *name, java_objectheader *cl)
+classinfo *load_class_from_classloader(utf *name, classloader *cl)
{
- java_objectheader *o;
- classinfo *c;
- classinfo *tmpc;
- java_objectheader *string;
+ java_handle_t *o;
+ classinfo *c;
+ classinfo *tmpc;
+ java_handle_t *string;
#if defined(ENABLE_RT_TIMING)
struct timespec time_start, time_lookup, time_prepare, time_java,
time_cache;
RT_TIMING_GET_TIME(time_java);
- c = (classinfo *) o;
+ c = LLNI_classinfo_unwrap(o);
if (c != NULL) {
/* Store this class in the loaded class cache. If another
RT_TIMING_GET_TIME(time_setup);
/* load fields */
+
if (!suck_check_classbuffer_size(cb, 2))
goto return_exception;
c->fieldscount = suck_u2(cb);
-#if defined(ENABLE_GC_CACAO)
- c->fields = MNEW(fieldinfo, c->fieldscount);
+ c->fields = MNEW(fieldinfo, c->fieldscount);
+
MZERO(c->fields, fieldinfo, c->fieldscount);
-#else
- c->fields = GCNEW_UNCOLLECTABLE(fieldinfo, c->fieldscount);
-#endif
for (i = 0; i < c->fieldscount; i++) {
if (!field_load(cb, &(c->fields[i]), descpool))
RT_TIMING_GET_TIME(time_fields);
/* load methods */
+
if (!suck_check_classbuffer_size(cb, 2))
goto return_exception;
c->methodscount = suck_u2(cb);
- c->methods = MNEW(methodinfo, c->methodscount);
+ c->methods = MNEW(methodinfo, c->methodscount);
MZERO(c->methods, methodinfo, c->methodscount);
*******************************************************************************/
-classinfo *load_newly_created_array(classinfo *c, java_objectheader *loader)
+classinfo *load_newly_created_array(classinfo *c, classloader *loader)
{
classinfo *comp = NULL;
methodinfo *clone;