Re: Why Virtual Machines? (was: C++ -> Java VM compiler)

Arch Robison <robison@kai.com>
3 Feb 1997 13:46:08 -0500

          From comp.compilers

Related articles
[5 earlier articles]
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) albaugh@agames.com (1997-01-29)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) jhummel@esp.ICS.UCI.EDU (Joe Hummel) (1997-01-30)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) haahr@netcom.com (1997-02-02)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) nr@adder.cs.virginia.edu (Norman Ramsey) (1997-02-02)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) Bronikov@srv2.ic.net (Dmitri Bronnikov) (1997-02-02)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) apalanis@students.uwf.edu (1997-02-03)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) robison@kai.com (Arch Robison) (1997-02-03)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) bothner@cygnus.com (1997-02-07)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) haahr@netcom.com (1997-02-07)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) markt@harlequin.co.uk (1997-02-07)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) robison@kai.com (Arch Robison) (1997-02-11)
Re: Why Virtual Machines? (was: C++ -> Java VM compiler) gah@u.washington.edu (1997-02-22)
| List of all articles for this month |

From: Arch Robison <robison@kai.com>
Newsgroups: comp.compilers
Date: 3 Feb 1997 13:46:08 -0500
Organization: Kuck & Associates, Inc.
References: <01bbfca0$a284a6f0$041b6682@tecel> 97-01-094 97-01-120 97-01-139 97-01-225
Keywords: architecture, Java

Bronikov@srv2.ic.net
In article 97-02-021 Dmitri Bronnikov writes:


>> Perhaps a better term for Java bytecode would be "preparsed source".


> Perhaps not. Java VM code is pretty much of the same level as any
> other VM. If you modified JVM addressing of operands to refer to
> offsets in stack, rather than bringing operands which happened to be
> not at the top using stack management instructions, then you'll get
> what one used to see in other machines "virtual or not".


No. The Java VM has a static typing rule that distinguishes it from
other virtual machines. See:


        Java Intermediate Bytecodes, SIGPLAN Workshop on Intermediate
        Representations, SIGPLAN Notices, March 1995, pp. 111-118


> And this I assume was not done to enable reverse compilation, Java
> VM chose not to define object reference size or representation -
> hence locals generally should not be allocated by javac. Method
> invocation/binding is again different due to mobility of Java.


Quite the opposite. The Java VM does define object reference size:
it's 32 bits. The reason for the JVM addressing (and much more) is
explained by Gosling himself (from the SIGPLAN article):


        "The solution we chose was to compile to a byte coded machine-independent
        instruction set that bears a certain resemblance to things like the UCSD
        Pascal P-Code [Bowles78]. While compact and amenable to interpretation,
        such a representation is, in general, unsuitable for higher-level, more
        abstract, manipulation. We applied a number of twists: there is an
        unusual amount of type information, there are restrictions on the use
        of the operand stack, and there is a heavy reliance on symbolic
        references and on-the-fly code rewriting."


> I'm far from being a Java or JVM lawyer, I rather belong to C++ cast. I'd
> say that JVM is not "just VM" because it's so much Java and not quite
> friendly/efficient for use with other languages.


That's proving my point: JVM bytecode is preparsed Java source. That's why
it does not work well as a target for C++.


> One java lawyer posted a reply in comp.compilers (quite some time ago) to
> those who requested expansion of JVM to suite C++, saying "why C++ people
> do not come up with VM for C/C++?". Indeed, why not?!


There already are. See http://www.cs.utah.edu/~ampsem/omniware.html .


Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 Champaign IL 61820
Lead Developer for KAI C++ http://www.kai.com/C_plus_plus/index.html
--


Post a followup to this message

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