aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natVMClassLoader.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-01-10 19:39:26 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-01-10 19:39:26 +0000
commit3fd8010046b910ac2477b0feb22f187b653655d1 (patch)
tree966d2f436ef2b2ebadf80447ac97eca99afd09f7 /libjava/java/lang/natVMClassLoader.cc
parent2f2bc52472b9fee4d0dd20044e9d41ece39ba4cb (diff)
downloadgcc-3fd8010046b910ac2477b0feb22f187b653655d1.zip
gcc-3fd8010046b910ac2477b0feb22f187b653655d1.tar.gz
gcc-3fd8010046b910ac2477b0feb22f187b653655d1.tar.bz2
PR libgcj/12016, PR libgcj/18405, PR libgcj/17738:
* java/lang/Package.java (getPackages): Use VMClassLoader when appropriate. (getPackage): Likewise. * prims.cc (_Jv_CreateJavaVM): Call _Jv_RegisterBootstrapPackages. * include/jvm.h (_Jv_RegisterBootstrapPackages): Declare. * java/lang/VMClassLoader.java (getPackage): Rewrote. (getPackages): Likewise. (definedPackages): New field. (definePackageForNative): New method. * java/lang/Class.h (_Jv_FindClassInCache): Updated. * java/lang/natVMClassLoader.cc (loadClass): Updated. * defineclass.cc (handleClassBegin): Use ClassLoader.findLoadedClass. * java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader): Rewrote. (struct _Jv_LoaderInfo): Removed. (initiated_classes): Likewise. (_Jv_UnregisterClass): Don't use initiated_classes. (_Jv_FindClassInCache): Likewise. Removed 'loader' argument. (_Jv_FindClass): Register classes found during boostrap. (BOOTSTRAP_CLASS_LIST_SIZE): New define. (bootstrap_class_list): New global. (bootstrap_index): Likewise. (_Jv_RegisterBootstrapPackages): New function. * gnu/gcj/runtime/natVMClassLoader.cc (findClass): Call definePackageForNative. (findClass): Updated. * gnu/gcj/runtime/VMClassLoader.java (definePackageForNative): New method. From-SVN: r93155
Diffstat (limited to 'libjava/java/lang/natVMClassLoader.cc')
-rw-r--r--libjava/java/lang/natVMClassLoader.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/libjava/java/lang/natVMClassLoader.cc b/libjava/java/lang/natVMClassLoader.cc
index 841b3e0..e34be99 100644
--- a/libjava/java/lang/natVMClassLoader.cc
+++ b/libjava/java/lang/natVMClassLoader.cc
@@ -1,6 +1,6 @@
// natVMClassLoader.cc - VMClassLoader native methods
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -130,7 +130,7 @@ jclass
java::lang::VMClassLoader::loadClass(jstring name, jboolean resolve)
{
_Jv_Utf8Const *utf = _Jv_makeUtf8Const (name);
- jclass klass = _Jv_FindClassInCache (utf, NULL);
+ jclass klass = _Jv_FindClassInCache (utf);
if (klass)
{
// We never want to return a class without its supers linked.
@@ -140,6 +140,9 @@ java::lang::VMClassLoader::loadClass(jstring name, jboolean resolve)
_Jv_InitClass (klass);
else
_Jv_Linker::wait_for_state (klass, JV_STATE_LOADING);
+
+ definePackageForNative(name);
}
+
return klass;
}