aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang')
-rw-r--r--libjava/java/lang/VMClassLoader.java10
-rw-r--r--libjava/java/lang/natClassLoader.cc11
2 files changed, 13 insertions, 8 deletions
diff --git a/libjava/java/lang/VMClassLoader.java b/libjava/java/lang/VMClassLoader.java
index b46b545..02010e7 100644
--- a/libjava/java/lang/VMClassLoader.java
+++ b/libjava/java/lang/VMClassLoader.java
@@ -142,20 +142,14 @@ final class VMClassLoader
/**
* Helper to load a class from the bootstrap class loader.
*
- * In libgcj, this does nothing, as the default system loader knows
- * how to find classes that have been linked in.
- *
* @param name the class name to load
* @param resolve whether to resolve it
* @return the class, loaded by the bootstrap classloader or null
* if the class wasn't found. Returning null is equivalent to throwing
* a ClassNotFoundException (but a possible performance optimization).
*/
- static final Class loadClass(String name, boolean resolve)
- throws ClassNotFoundException
- {
- return null;
- }
+ static final native Class loadClass(String name, boolean resolve)
+ throws ClassNotFoundException;
/**
* Helper to load a resource from the bootstrap class loader.
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index bfd1f09..e3519f3 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -136,6 +136,17 @@ java::lang::VMClassLoader::getPrimitiveClass (jchar type)
return _Jv_FindClassFromSignature (sig, NULL);
}
+jclass
+java::lang::VMClassLoader::loadClass(jstring name, jboolean resolve)
+{
+ _Jv_Utf8Const *utf = _Jv_makeUtf8Const (name);
+ // FIXME: we culd make _Jv_FindClassFromSignature a template.
+ jclass klass = _Jv_FindClassInCache (utf, NULL);
+ if (klass && resolve)
+ _Jv_InitClass (klass);
+ return klass;
+}
+
void
_Jv_WaitForState (jclass klass, int state)
{