[fpc-devel] Updated FPC JVM snapshot

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Mon Nov 7 13:46:59 CET 2011



On Mon, 7 Nov 2011, Jonas Maebe wrote:

>
> On 07 Nov 2011, at 12:21, Michael.VanCanneyt at Wisa.be wrote:
>
>> TextRec uses THandle for everything, I assume it can be used to store a 
>> pointer to an object (or whatever Java uses for files), since in Java 
>> everything is
>> an object anyway ?
>
> Yes (once THandle is added to the JVM RTL and it is defined to Pointer or 
> JLObject, at least :). It's generally a PrintStream: 
> http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#out

Do you have a preference for either of them ?

>
> There is however some functionality (e.g. writestr with ansistring) that uses 
> the UserData byte array to store a pointer, which won't work on the JVM 
> target. Some extra classes will also have to be moved from the jdk15 unit to 
> the system unit to implement the functionality.

That brings me to my second question/remark: 
(which I had already prepared before sending my first mail ;) ):

It would be easier if the system unit could depend on jdk15 in the
implementation section.

However, this is something that FPC never has been able to do, while Delphi can. 
It would be good if FPC could do the same, it would make some system units easier
to manage. (in casu: the Java one)

I realize that the system unit cannot depend on just about any arbitrary unit, 
but some simple import units, or units containing only
strings/constants/types should be possible.

However, I suspect that this is not a trivial task and maybe out of the
scope of the JVM port.

Michael.



More information about the fpc-devel mailing list