[Aegisvm-devel] aegis patches
Status: Pre-Alpha
Brought to you by:
pwlfong
|
From: Justin B. <jus...@ya...> - 2003-05-05 07:50:48
|
Hello all, I've got a working version of aegis that is based on older sources, and to which I've made some modifications. I've tried to incorporate these changes into the latest development source code. I think I've got everything right but it's possible I've missed something new. All of this code works with my version. As well as fixing various minor typos and removing some compilation warnings under my compiler, the changes can be summarized as follows: 1) JNI additions, which were heavily based on code from Gildas Bazin. These implement New<PrimitiveType>Array(), Get<PrimitiveType>ArrayRegion and Set<PrimitiveType>ArrayRegion, as well as GetObjectArrayElement. Files affected: jni.c, jni.h 2) Invocation of static native methods changed to pass class as second parameter, as per the Java Native Interface Specification 1.1, Ch 2, Section Native Method Arguments. Previously only the JNIEnv pointer was being passed to static native methods. This required changing all the built-in static native methods' prototypes. Files affected: invoke.c, jni.c, prepare.c, jpr/ff.c, jpr/ff.h 3) Dynamic expansion of the internal heap used by java programs, by using an algorithm that grows the heap at garbage collection time. Maximum and minimum limits can be set, as well as a maximum number of garbage collection executions before growing. There are surely other ways of making the heap dynamic (probably by re-implementing the gc), but this method allows the garbage collector to largely remain intact. In this algorithm, the heap is seperated into two sections. When the garbage collector copies from one to another (thus performing the garbage collection by only copying valid pointers), and it finds that there isn't enough space left over in the heap afterwards, it re-allocates a larger memory slice for the target section of the heap, effectively growing it. (The next garbage collection the other section grows also). Files Affected: gc.h, gc.c, builtin.c 3) Implemented updated java/lang/String and java/lang/StringBuffer support, allowing sharing of backing arrays whenever reasonable. These were taken from the GNU classpath project, and modified. StringBuffer is essentially the same, with only one added check to ensure that large backing arrays are not hanging around needlessly. String is a mix of (mostly) GNU's String, aegis' String, and some other additions. These changes were made mostly because of internal aegis dependence upon the format of string class. Notably, the StringHashTable has been retained from aegis' version, and the ToUpperCase/toLowerCase() functions were modified. These changes at times provide a big improvement in efficiency and space usage. Note: the GNU StringBuffer class can be used unchanged. The Error.java I submit IS the GNU class. Files affected: java/lang/String.java, java/lang/StringBuffer.java, java/lang/Error.java, gc.c, jni.c, builtin.c, object.h, resolve.c A zip of the diffs is attached. I think aegis is well written and hope these changes will prove useful to it's further development. Please let me know if there are any problems or if you have questions. -Justin Briggs __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |