gcc/libjava/gnu/gcj/runtime/natSystemClassLoader.cc
Tom Tromey b149e89e77 Class.h (JV_STATE_LOADING): Added comment.
* java/lang/Class.h (JV_STATE_LOADING): Added comment.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natSystemClassLoader.cc.
	* gnu/gcj/runtime/natSystemClassLoader.cc: New file.
	* gnu/gcj/runtime/SystemClassLoader.java (nativeClasses):
	New field.
	(loadedClasses): Removed.
	(findClass): Declare.
	(addClass): Add to nativeClasses, not loadedClasses.

From-SVN: r113530
2006-05-04 15:29:22 +00:00

32 lines
833 B
C++

// natSystemClassLoader.cc - native code for system class loader
/* Copyright (C) Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <platform.h>
#include <gcj/cni.h>
#include <jvm.h>
#include <execution.h>
#include <gnu/gcj/runtime/SystemClassLoader.h>
#include <java/lang/ClassNotFoundException.h>
#include <java/util/HashMap.h>
jclass
gnu::gcj::runtime::SystemClassLoader::findClass (jstring name)
{
jclass result = (jclass) nativeClasses->get(name);
if (! result)
return URLClassLoader::findClass(name);
// Never return a class whose supers are not installed.
_Jv_Linker::wait_for_state (result, JV_STATE_LOADING);
return result;
}