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

billms@nixon.icsl.ucla.edu (Bill Mangione-Smith)
8 May 1996 00:28:37 -0400

          From comp.compilers

Related articles
[2 earlier articles]
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)
Re: Java virtual machine as target language for C/C++ Drinie@xs4all.nl (1996-05-10)
Re: Java virtual machine as target language for C/C++ dean@psy.uq.oz.au (1996-05-10)
Re: Java virtual machine as target language for C/C++ khays@sequent.com (1996-05-13)
[15 later articles]
| List of all articles for this month |
From: billms@nixon.icsl.ucla.edu (Bill Mangione-Smith)
Newsgroups: comp.lang.java,comp.lang.c++,comp.compilers
Date: 8 May 1996 00:28:37 -0400
Organization: School of Engineering & Applied Science, UCLA.
References: 96-05-036 96-05-049
Keywords: Java

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


dodd@csl.sri.com (Chris Dodd) writes:
      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.


Actually, after re-reading parts of the spec, I'm fairly sure this is
not true. The August 21 release specifically says that jvm programs
must respect typing, and the typed instructions specifically reflect
this as well. The current implementation uses a load-time scanner for
type checking, but if you circumvent this you are still technically
breaking a key aspect of the VM. A seperate, though completely
compliant, virtual machine could shoot down your code as illegal at
runtime by using type flags on the stack. The spec says that this is
not necessary (and it isn't if load time checking is done) but it
certainly is one legal way to do the type checks.


Bill
--


Post a followup to this message

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