This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JVM -b backend


Adam Megacz wrote:
> Tom Tromey <tromey@redhat.com> writes:
>>The JVM has a goto instruction.
> Wow, what's it used for? The language doesn't have a goto...

No, but it has loop, conditionals, break, and continue.
These are all implemented using gotos.

>>The real problem is dealing with the different data models, namely
>>pointers.  Even this is solvable though.
>>
> 
> Store everything in byte[]'s and represent pointers as offsets into
> the array?

That is one solution.  It does mean you're not api-compatible with
normal libraries, though.

A more flexible approach is to have the compiler translate all pointer
dereferences into calls to special methods.  These could be native
methods, they could be optimized by a jit or gcj, or they can be
implemented in pure Java using a byte array.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]