harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Garner" <robin.gar...@anu.edu.au>
Subject Re: half-baked idea? j2me
Date Tue, 01 Nov 2005 13:25:37 GMT
>> On 11/1/05, Robin Garner <Robin.Garner@anu.edu.au> wrote:
>>> Rodrigo Kumpera wrote:
>>>
>>> >AFAIK IKVM, sablevm and jamvm all run on portable devices.
>>> >
>>> >Developing a j2me jvm is not as easier as it seens, first, the
>>> >footprint and execution performance must be really optimized, so
>>> >expect a LOT of assembly coding.
>>> >
>>> >
>>> Back to the language wars again :)  This does not necessarily follow.
>>> Try googling for the 'squawk' VM - they had a poster at OOPSLA last
>>> week.  This is a java-in-java virtual machine targetted at embedded
>>> devices.  The core VM runs in 80KB of memory.  Device drivers are all
>>> written in Java.
>>>
>>
>> Robin,
>>
>> With a java-in-java VM even if you don't write directly in assembly
>> you still need to generate machine code with java anyway, and that
>> will look a lot like asm (JikesRVM baseline JITer for example). With
>> C, for example, you can get away using just an interpreter.
>
> My mistake, obviously.  When you said "performance must be really
> optimized, so expect a LOT of assembly coding", I assumed you were saying
> that large chunks of the VM would need to be written in assembler in order
> to get adequate performance.
>
> So what _was_ the point you were making ?

Actually to be more constructive, I think there is a deeper issue here. 
If an interpreter will give adequate performance, then it can certainly be
written in an ahead-of-time compiled language with little or no call to do
any assembly-like coding.  If you actually need the additional performance
you can get from a compiler, then there is no alternative to writing
assembler in some shape or other.  The JikesRVM compilers are good
examples of the extremes here - the baseline compiler is virtually
straight assembler (or a java representation thereof), while the opt
compilers use all sorts of techniques to avoid actually specifying machine
instructions directly.

So while all compilers need to emit machine instructions (after all,
that's what they do), there is very little need (given an adequate
compiler) to write code in assembler, no matter what language it is
written in.  There's a perfectly adequate AOT java compiler out there, so
anything you can do in C can be done in Java with a little assistance from
the compiler.

cheers


Mime
View raw message