Re: Java virtual machine as target language for C/C++

dodd@csl.sri.com (Chris Dodd)
6 May 1996 23:16:58 -0400

          From comp.compilers

Related articles
Java virtual machine as target language for C/C++ Drinie@xs4all.nl (1996-05-04)
Re: Java virtual machine as target language for C/C++ roedy@BIX.com (Roedy Green) (1996-05-05)
Re: Java virtual machine as target language for C/C++ dw3u+@andrew.cmu.edu (Daniel C. Wang) (1996-05-05)
Re: Java virtual machine as target language for C/C++ tmb@best.com (1996-05-06)
Re: Java virtual machine as target language for C/C++ albaugh@agames.com (1996-05-06)
Re: Java virtual machine as target language for C/C++ dodd@csl.sri.com (1996-05-06)
Re: Java virtual machine as target language for C/C++ brauch@hpp.stanford.edu (Rupert Brauch) (1996-05-06)
Re: Java virtual machine as target language for C/C++ kik@zia.cray.com (1996-05-08)
Re: Java virtual machine as target language for C/C++ billms@nixon.icsl.ucla.edu (1996-05-08)
Re: Java virtual machine as target language for C/C++ sal714@rs710.gsfc.nasa.gov (1996-05-08)
Re: Java virtual machine as target language for C/C++ bnm@indica.bbt.com (1996-05-10)
Re: Java virtual machine as target language for C/C++ mbk@caffeine.engr.utk.edu (1996-05-10)
[18 later articles]
| List of all articles for this month |

From: dodd@csl.sri.com (Chris Dodd)
Newsgroups: comp.lang.java,comp.lang.c++,comp.compilers
Date: 6 May 1996 23:16:58 -0400
Organization: Computer Science Lab, SRI International
References: 96-05-036
Keywords: Java



Drinie@xs4all.nl (Rinie Kervel) writes:
>Is it possible (and will Sun allow it) to extend the JVM to support
>pointer arithmetic.


No need, the JVM already supports pointer arithmetic. That is,
there's nothing in the VM that prevents you from doing an `add'
instruction on a pointer and an integer.


The `security' in java-enabled browsers an the like comes from a
security scanner that scans through the byte-code looking for things
like pointer arithmetic. If it finds any, the code is rejected. Once
the code is past the securty, no further checking is done.


You could write a C-to-JVM translator that used pointer arithmetic
just like normal C compilers and run that code with something like
appletviewer (which doesn't do the security scan) just fine. Of
course, since the garbage collecter might assume that no pointer
arithmetic is occurring it might get confused and cause problems.
Unfortunately, the JVM specification doesn't really talk about the
garbage collecter at all (other than to say that it exists)


Chris Dodd
dodd@csl.sri.com
--


Post a followup to this message

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