update to more recent version of Android class library

Lots has changed since we forked Android's libcore, so merging the
latest upstream code has required extensive changes to the
Avian/Android port.

One big change is that we now use Avian's versions of
java.lang.Object, java.lang.Class, java.lang.ClassLoader, some
java.lang.reflect.* classes, etc. instead of the Android versions.
The main reason is that the Android versions have become very
Dex/Dalvik-specific, and since Avian is based on Java class files, not
dex archives, that code doesn't make sense here.  This has the side
benefit that we can share more native code with classpath-avian.cpp
and reduce the amount of Java/C++ code duplication.
This commit is contained in:
Joel Dice
2014-08-21 13:09:42 -06:00
parent ba808a8589
commit b96cc3c575
21 changed files with 556 additions and 1393 deletions

View File

@ -19,6 +19,7 @@ import java.util.Collections;
import java.util.Enumeration;
import java.util.Map;
import java.util.HashMap;
import java.security.ProtectionDomain;
public abstract class ClassLoader {
private final ClassLoader parent;
@ -92,6 +93,12 @@ public abstract class ClassLoader {
(avian.Classes.defineVMClass(this, b, offset, length));
}
protected Class defineClass(String name, byte[] b, int offset, int length,
ProtectionDomain domain)
{
return defineClass(name, b, offset, length);
}
protected Class findClass(String name) throws ClassNotFoundException {
throw new ClassNotFoundException();
}
@ -196,6 +203,10 @@ public abstract class ClassLoader {
return urls;
}
protected String findLibrary(String name) {
return null;
}
static native Class getCaller();
static native void load(String name, Class caller, boolean mapName);