[Mono-list] Re: can you explain what you mean?

Tom tom7ca@yahoo.com
Sat, 14 Jul 2001 22:24:47 -0700 (PDT)

--- Miguel de Icaza <miguel@ximian.com> wrote:
> The major difference that I can see Tom is that the
> CLR does not
> really use bytecodes.  They look like bytecodes, and
> smell like
> bytecodes, but they are not really bytecodes.
> They are actually a flattened representation of the
> tree constructed
> by the compiler (there is a technical name for it,
> something like
> postfix attributed something).  
> [...]
> Once you have reconstructed the tree from the stack
> operators, then
> you can do traditional compiler instruction
> selection.  Something that
> with Java is not possible (actually, it is, but then
> you have to write
> a proof engine that will verify that the stack is
> only used to
> recreate a tree, and not for anything else). 

The only way I can think of in which a stack oriented
byte code could fail to be equivalent to a postfix
representation of a parse tree would be if function
calls in the byte code were permitted to consume
and return varying numbers of objects off the stack.
However, because of static type checking, this is not 
the case in the JVM.  The types of any method are
declared, which tells you the arity.  Of course,
a good runtime will verify these declarations,
so maybe the "proof engine" you are thinking of
is the type checker that any JVM (and, presumably, 
any safe CLR implementation) needs anyway (and 
that is pretty trivial to implement).

In fact, it's easy to write something that takes
JVM bytecodes and reconstructs a parse tree (and
even source code).  I have done it, and so have 
many other people.  Conversely, JVM bytecodes are
easily translated into register instructions precisely
because the JIT knows the arity of any function
and primitive that occurs in an instruction sequence.

If you know of other, concrete ways in which the CLR
and the JVM bytecodes differ in this regard, I would 
certainly like to know about it.  I'd also be curious 
where this claim actually originated; is that what 
Microsoft is saying about the JVM?


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail