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
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.