VMClassLoader.java (loadClass): Now native.
* java/lang/VMClassLoader.java (loadClass): Now native. * java/lang/natClassLoader.cc (loadClass): Implement. * prims.cc (_Jv_RunMain): Initialize ClassLoader. From-SVN: r72038
This commit is contained in:
parent
2a3bf9aa52
commit
d801e245eb
4 changed files with 25 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2003-10-02 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* java/lang/VMClassLoader.java (loadClass): Now native.
|
||||||
|
* java/lang/natClassLoader.cc (loadClass): Implement.
|
||||||
|
* prims.cc (_Jv_RunMain): Initialize ClassLoader.
|
||||||
|
|
||||||
2003-10-02 Michael Koch <konqueror@gmx.de>
|
2003-10-02 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* java/net/InetAddress.java
|
* java/net/InetAddress.java
|
||||||
|
|
|
@ -142,20 +142,14 @@ final class VMClassLoader
|
||||||
/**
|
/**
|
||||||
* Helper to load a class from the bootstrap class loader.
|
* 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 name the class name to load
|
||||||
* @param resolve whether to resolve it
|
* @param resolve whether to resolve it
|
||||||
* @return the class, loaded by the bootstrap classloader or null
|
* @return the class, loaded by the bootstrap classloader or null
|
||||||
* if the class wasn't found. Returning null is equivalent to throwing
|
* if the class wasn't found. Returning null is equivalent to throwing
|
||||||
* a ClassNotFoundException (but a possible performance optimization).
|
* a ClassNotFoundException (but a possible performance optimization).
|
||||||
*/
|
*/
|
||||||
static final Class loadClass(String name, boolean resolve)
|
static final native Class loadClass(String name, boolean resolve)
|
||||||
throws ClassNotFoundException
|
throws ClassNotFoundException;
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to load a resource from the bootstrap class loader.
|
* Helper to load a resource from the bootstrap class loader.
|
||||||
|
|
|
@ -136,6 +136,17 @@ java::lang::VMClassLoader::getPrimitiveClass (jchar type)
|
||||||
return _Jv_FindClassFromSignature (sig, NULL);
|
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
|
void
|
||||||
_Jv_WaitForState (jclass klass, int state)
|
_Jv_WaitForState (jclass klass, int state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -983,6 +983,12 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
|
||||||
arg_vec = JvConvertArgv (argc - 1, argv + 1);
|
arg_vec = JvConvertArgv (argc - 1, argv + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// We have to initialize this fairly early, to avoid circular
|
||||||
|
// class initialization. In particular we want to start the
|
||||||
|
// initialization of ClassLoader before we start the
|
||||||
|
// initialization of VMClassLoader.
|
||||||
|
_Jv_InitClass (&java::lang::ClassLoader::class$);
|
||||||
|
|
||||||
using namespace gnu::gcj::runtime;
|
using namespace gnu::gcj::runtime;
|
||||||
if (klass)
|
if (klass)
|
||||||
main_thread = new FirstThread (klass, arg_vec);
|
main_thread = new FirstThread (klass, arg_vec);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue