[Pharo-project] GSoC: ARM jitter for Squeak VM
eliot.miranda at gmail.com
Thu Mar 8 16:46:56 EST 2012
On Thu, Mar 8, 2012 at 1:20 PM, Nick Ager <nick.ager at gmail.com> wrote:
> Hi Elliot,
> I'm probably the least qualified of the people who have responded so far -
> but if at all possible I'd love to try and help.
You're welcome too.
> If you want something to do now, the first thing to do is to produce an
>> ARM simulator plugin, analogous to the Bochs simulator. The first thing to
>> do is go out and find a suitable software simulator, written in either C or
>> C++ (cuz these suit the plugin compilation system) and play with it,
>> configuring an ARM and running some simple assembler on it.
> In terms of ARM emulators a popular one seems to be QEMU  - the Android
> simulator uses it.
Right, but this one is unsuitable because it does dynamic translation.
Because the Squeak VM has a moving garbage collector and because, when
simulating, the entire Cog heap, including generated machine-code, lives in
a single ByteArray, the machine code generated by Cog, when simulating, can
move. So the interface between the processor simulator and the generated
machine code and memory must be based on virtual addresses. I'm pretty
certain that a JIT like QEMU will use real addresses and so its own code
generation would get confused by any movements of the Cog heap ByteArray.
Hence it is I think better to stick with a simple interpretive simulator
such as the Armulator <http://en.wikipedia.org/wiki/ARMulator>, and of
course Bochs <http://en.wikipedia.org/wiki/Bochs>. BTW, the ARM is so
simple that the core instruction set simulator in the ARM is only 1500
lines of C++ (including whitespace). So another approach might be to
implement ARM in Smalltalk, e.g. by back-porting the Armulator code,
although I expect it'll be significantly slower than optimized C++.
>  http://en.wikipedia.org/wiki/QEMU
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev