On Thu, 2006-04-20 at 00:26 +0200, Dalibor Topic wrote:
> On Wed, 2006-04-19 at 21:33 +0300, Tayfun Elmas wrote:
Hi Tayfun,
> > However, in the filr Hjava_lang_Object.h,
> > there is only the template of the struct type and it says the real
> > version is created by Kaffeh.
>
> Yes. The real version of the file is created in the
> $builddir/include/java_lang_Object.h file when you build Kaffe using the
> make command.
Argh. I spoke without actually checking and it turned out that my memory
was wrong.
The actual struct for Hjava_lang_Object is *not* created by kaffeh.
Kaffeh has specific bits of code to avoid emitting any field information
for java.lang.Object and java.lang.Class, since those classes are
somewhat special.
Instead, the actual definition of Hjava_lang_Object can be found in the
file include/native.h.
> > Is there any way to insert the field into
> > the structure by modifying some file?
>
> You could modify the java file
> libraries/javalib/external/classpath/java/lang/Object.java , and add a
> field there. Such a field should then show up in the generated headers
> as well.
That's wrong advice, sorry for that. Actually, the right way to insert a
field into Object is to add it to the definition in include/native.h.
I've attached a patch, which adds a void * data, and passes the
regression tests (make check). I have not tested it further, but I am
sure you'll have some fun with that. ;)
cheers,
dalibor topic
Index: include/native.h
===================================================================
RCS file: /cvs/kaffe/kaffe/include/native.h,v
retrieving revision 1.21
diff -u -r1.21 native.h
--- include/native.h 18 Apr 2006 15:57:56 -0000 1.21
+++ include/native.h 19 Apr 2006 20:56:22 -0000
@@ -44,6 +44,7 @@
typedef struct Hjava_lang_Object {
struct _dispatchTable* vtable;
struct _iLock* lock;
+ void * data;
/* This pointer contains the VM function which should be called
* to handle object finalization.
*/
_______________________________________________
kaffe mailing list
[email protected]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe