harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Tromey <tro...@redhat.com>
Subject Re: Against using Java to implement Java (Was: Java)
Date Wed, 18 May 2005 00:27:42 GMT
>>>>> "David" == David Griffiths <david.griffiths@gmail.com> writes:

David> Maybe a concrete example would help. Let's say you have a GC module
David> written in C. One of it's API calls is to allocate a new object. How
David> is your JIT module going to produce code to use that API? Via a C
David> function pointer?


One way is to mandate link- or compile-time pluggability only.  Then
this can be done by name.  Your JIT just references
'&harmony_allocate_object' in its source and uses this pointer
in the code it generates.

The other way is to have the JIT call some central function to get a
pointer to the allocator function (or functions, in libgcj it turned
out to be useful to have several).  This only needs to be done once,
at startup.

For folks interested in pluggability, I advise downloading a copy of
ORP and reading through it.  ORP already solved these problems in a
fairly reasonable way.


View raw message