[kaffe] CVS kaffe (guilhem): Changed required inheritancy for GetDirectBufferAddress.
Kaffe CVS
cvs-commits at kaffe.org
Fri Dec 16 12:43:11 PST 2005
PatchSet 7007
Date: 2005/12/16 20:35:43
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Changed required inheritancy for GetDirectBufferAddress.
* kaffe/kaffevm/jni/jni-helpers.c
(GetDirectBufferAddress): Authorize all classes inheriting
java/nio/Buffer.
* kaffe/kaffevm/baseClasses.h
(initBaseClasses): Preload java/nio/Buffer.
Members:
ChangeLog:1.4527->1.4528
kaffe/kaffevm/baseClasses.c:1.70->1.71
kaffe/kaffevm/baseClasses.h:1.24->1.25
kaffe/kaffevm/jni/jni-helpers.c:1.10->1.11
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4527 kaffe/ChangeLog:1.4528
--- kaffe/ChangeLog:1.4527 Fri Dec 16 19:57:47 2005
+++ kaffe/ChangeLog Fri Dec 16 20:35:43 2005
@@ -1,5 +1,14 @@
2005-12-16 Guilhem Lavaux <guilhem at kaffe.org>
+ * kaffe/kaffevm/jni/jni-helpers.c
+ (GetDirectBufferAddress): Authorize all classes inheriting
+ java/nio/Buffer.
+
+ * kaffe/kaffevm/baseClasses.h
+ (initBaseClasses): Preload java/nio/Buffer.
+
+2005-12-16 Guilhem Lavaux <guilhem at kaffe.org>
+
* kaffe/kaffevm/baseClasses.c
kaffe/kaffevm/baseClasses.h
(initBaseClasses): Resolve java.nio.DirectByteBufferImpl and
Index: kaffe/kaffe/kaffevm/baseClasses.c
diff -u kaffe/kaffe/kaffevm/baseClasses.c:1.70 kaffe/kaffe/kaffevm/baseClasses.c:1.71
--- kaffe/kaffe/kaffevm/baseClasses.c:1.70 Fri Dec 16 19:56:55 2005
+++ kaffe/kaffe/kaffevm/baseClasses.c Fri Dec 16 20:35:47 2005
@@ -87,6 +87,7 @@
Hjava_lang_Class* javaLangFloatClass;
Hjava_lang_Class* javaLangDoubleClass;
+Hjava_lang_Class *javaNioBufferClass;
Hjava_lang_Class *javaNioDirectByteBufferImplClass;
Hjava_lang_Class *javaNioDirectByteBufferImplReadWriteClass;
Hjava_lang_Class *gnuClasspathPointerClass;
@@ -381,6 +382,7 @@
loadStaticClass(&javaLangRefPhantomReference, "java/lang/ref/PhantomReference");
/* NIO helpers */
+ loadStaticClass(&javaNioBufferClass, "java/nio/Buffer");
loadStaticClass(&javaNioDirectByteBufferImplClass, "java/nio/DirectByteBufferImpl");
loadStaticClass(&javaNioDirectByteBufferImplReadWriteClass, "java/nio/DirectByteBufferImpl$ReadWrite");
#if SIZEOF_VOID_P == 4
Index: kaffe/kaffe/kaffevm/baseClasses.h
diff -u kaffe/kaffe/kaffevm/baseClasses.h:1.24 kaffe/kaffe/kaffevm/baseClasses.h:1.25
--- kaffe/kaffe/kaffevm/baseClasses.h:1.24 Fri Dec 16 19:56:55 2005
+++ kaffe/kaffe/kaffevm/baseClasses.h Fri Dec 16 20:35:47 2005
@@ -53,6 +53,7 @@
extern struct Hjava_lang_Class *javaNioDirectByteBufferImplClass;
extern struct Hjava_lang_Class *javaNioDirectByteBufferImplReadWriteClass;
+extern struct Hjava_lang_Class *javaNioBufferClass;
extern struct Hjava_lang_Class *gnuClasspathPointerClass;
extern Field *gnuClasspathPointerAddress;
Index: kaffe/kaffe/kaffevm/jni/jni-helpers.c
diff -u kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.10 kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.11
--- kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.10 Fri Dec 16 19:56:56 2005
+++ kaffe/kaffe/kaffevm/jni/jni-helpers.c Fri Dec 16 20:35:47 2005
@@ -61,9 +61,11 @@
buffer_local = (Hjava_lang_Object *)unveil(buffer);
- if (!instanceof(javaNioDirectByteBufferImplClass, OBJECT_CLASS(buffer_local)))
+ if (!instanceof(javaNioBufferClass, OBJECT_CLASS(buffer_local)))
+ {
+ printf("buffer_local is %s\n", OBJECT_CLASS(buffer_local)->name->data);
address = NULL;
- else
+ } else
{
address_obj = KNI_GET_FIELD(Hjava_lang_Object *, buffer_local, directByteBufferImplAddress);
address = KNI_GET_FIELD(void *, address_obj, gnuClasspathPointerAddress);
More information about the kaffe
mailing list