Re: Compiling pointer arithmetic targeting JVM

glen herrmannsfeldt <gah@ugcs.caltech.edu>
3 Dec 2003 17:55:51 -0500

          From comp.compilers

Related articles
Compiling pointer arithmetic targeting JVM napi@cs.indiana.edu (2003-11-21)
Re: Compiling pointer arithmetic targeting JVM gah@ugcs.caltech.edu (glen herrmannsfeldt) (2003-12-03)
Re: Compiling pointer arithmetic targeting JVM bonzini@gnu.org (2003-12-03)
Re: Compiling pointer arithmetic targeting JVM joachim.durchholz@web.de (Joachim Durchholz) (2003-12-08)
Re: Compiling pointer arithmetic targeting JVM fjh@cs.mu.oz.au (Fergus Henderson) (2003-12-13)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: 3 Dec 2003 17:55:51 -0500
Organization: Comcast Online
References: 03-11-098
Keywords: Java, code
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.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.