|Compiling pointer arithmetic targeting JVM email@example.com (2003-11-21)|
|Re: Compiling pointer arithmetic targeting JVM firstname.lastname@example.org (glen herrmannsfeldt) (2003-12-03)|
|Re: Compiling pointer arithmetic targeting JVM email@example.com (2003-12-03)|
|Re: Compiling pointer arithmetic targeting JVM firstname.lastname@example.org (Joachim Durchholz) (2003-12-08)|
|Re: Compiling pointer arithmetic targeting JVM email@example.com (Fergus Henderson) (2003-12-13)|
|From:||glen herrmannsfeldt <firstname.lastname@example.org>|
|Date:||3 Dec 2003 17:55:51 -0500|
|Posted-Date:||03 Dec 2003 17:55:51 EST|
Mohd Hanafiah Abdullah wrote:
> Is there any literature that explains how to mimic memory architecture in
> JVM so that we could compile pointer arithmetic inherent in languages like
> C and Pascal. Thanks for any tips.
I have thought some about compiling C to JVM.
A pointer variable needs at least an Object reference and offset.
Pointer increment/decrement operations will change the offset. Equality
comparisons check both the Object reference and offset, inequalities, at
least in C, only need to compare the offset. Dereferencing uses both.
Most likely it should also include something about the type of pointer
it represents. The C rules on unsigned char pointers complicate
anything that works with them, but it should be possible to do it.
Return to the
Search the comp.compilers archives again.