[Vm-dev] 64bit FFI?

Eliot Miranda eliot.miranda at gmail.com
Thu Feb 12 19:40:09 UTC 2009

On Thu, Feb 12, 2009 at 11:25 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:

> On 12.02.2009, at 19:29, Eliot Miranda wrote:
>> Um, I have (studied my Agrippa), and I quote:
>> Does my 64-bit VM run both 32-bit and 64-bit images? No. Any VM will run
>> either 32-bit or 64-bit images
> Read it like this:
> Does my 64-bit VM run *both* 32-bit and 64-bit images? No. Any VM will run
> *either* 32-bit *or* 64-bit images
>  Apologies for being so persistent :)
> Well everyone has a thick day once in a while.
>  http://squeakvm.org/squeak64/faq.html
> You still fail to see the crucial distinction the FAQ makes between 64-bit
> *images* and 64-bit *VMs*:
> What is a 64-bit image?
> A 64-bit image is an image in which the object memory uses a 64-bit word
> size for object pointers
> What is a 64-bit VM?
> A 64-bit VM is one which is compiled with the LP64 or ILP64 data model.
> This means, in C terms, that pointers and longs are 64-bits wide.
> These two are independent. There are four kinds of VMs:
> 1) a 32-bit VM compiled to run 32-bit images
> 2) a 32-bit VM compiled to run 64-bit images
> 3) a 64-bit VM compiled to run 32-bit images
> 4) a 64-bit VM compiled to run 64-bit images
> Wether the VM can run 32 or 64 bit *images* is governed by the checkbox in
> VMMaker.
> Wether the VM can run on a 32 or 64 bit host is governed by the C compiler.
> Also, nobody uses 64 bit images yet.
> Please suggest how the FAQ could make this more clear (assuming you
> actually studied the whole thing and not just skimmed it).

Speaking through a self-imposed gag let me suggest the FAQ distinguish
clearly between a 64-bit VM (meaning a VM that runs 64-bit images that
necessarly is compiled as a 64-bit executable) and a 32-bit VM compiled to
run as a 64-bit executable.  The latter doesn't count as a 64-bit VM for me.
 64-bit clean perhaps.

Let me further suggest that 2) is pointless, in that it can't scale beyond
the 32-bit address space but uses about 1.5 times the space of a 32-bit
image as it tries to do so.  i.e. it'll fail a lot earlier than a 32-bit
image.  Further, if a 64-bit image is larger than will fit in a 32-bit
address space one *cant* run it on 2 because it won't fit.  However, one can
derive a 32-bit image from a 64-bit image that isn't too big using the
SystemTracer (don't know if tis has been implemented; we only implemented
32-bit to 64-bit conversion in VsualWorks, uing something akin to the system

So I would suggest the FAQ explain tat there are really three different VMs,
two 32-bit ones and one 64-bit one.  One of the 32-bit VMs is compiled to
run as a 64-bit executable on 64-bit systems but only runs a 32-bit image.
 That at least accords with the planet I grew up on :)

> - Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090212/cfe45bda/attachment.htm

More information about the Vm-dev mailing list