[Mono-list] Re: could mono become a hybrid cil/java platform?
Ulf Ochsenfahrt
ulfjack@gmx.de
Wed, 29 May 2002 13:33:39 +0200 (MEST)
Ok, you're right, Jikes actually does produce this type of code,
nevertheless, Javac does not. No argument about which compiler is used more often.
Anyway, a Bytecode to CIL-translator would probably want to start with easy
code and then works toward the more difficult stuff (and thus start with
javac-generated code or code that does not exhibit these problems).
Even then, the problem of resued local variables is a lot easier to solve
that you say. Just split the local variable after types. The Java Virtual
Machine Specification does not allow reading reference types as integers, so
astore_1
iload_1
is not allowed anyway. So a simple translation scheme might do something
like: Generate 1 new local variable for each old pair of (variable position,
variable type).
To answer your last statement:
My statement was not directly about mono, but rather about the project of
JB-CIL-Translation. And CIL is certainly "near" JB. As someone has already
pointed out, it is a superset of JB.
A JB-CIL-Translator is certainly interesting and I should like to take part
if I have enough time (that way I can learn something about CIL).
-- Ulf
---- Original-Message:
On Wed, May 29, 2002 at 09:47:46AM +0200, Ulf Ochsenfahrt wrote:
> The normal Java-Compilers do NOT produce this type of code - reusing local
> variables with different types.
Try compiling the attatched code with Kopi or Jikes (which I have on my box)
and try disassembling it ... (with jdasm of course). See the istore_0 and
lstore_0 in the same function ?
Language specs should be followed , not ignored or taken for granted ....
otherwise you'll find yourself tearing your hair when that app you wrote
doesn't port well..... and it's fun debugging bytecode.
> The real problem is that Java-Code normally uses the Java API ....
That is *after* the bytecode has been correctly parsed ... I guess
this discussion isn't doing mono any good ...... nor is mono going
anywhere near Java (Miguel himself said that he started Mono because
he didn't like Java's "Give and Take" combo)....
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net