[Vm-dev] 64-bit FAQ

David T. Lewis lewis at mail.msen.com
Thu Oct 18 01:39:06 UTC 2007


On Wed, Oct 17, 2007 at 10:35:19PM +0200, Andrew Gaylard wrote:
> 
> I've taken the detailed input on this subject that's been
> posted to the list so far, and turned it into a FAQ for
> posting either to squeakvm.org or the swiki.

Looks good! 

I've provided a couple of edits below.

> 9/
> Does my 64-bit VM run both 32-bit and 64-bit images?
> - All VMs can run both 32-bit and 64-bit images, but this selection needs to
> be made at compile time.  See question 5.

Better answer:

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, but not both. You
can select one or the other when you generate sources with VMMaker,
and you can install both flavors of VM on your system (one each for
32-bit images and 64-bit images).

If try to run a 64-bit image with a VM built for 32-bit images, you will
get an error message such as this:

  This interpreter (vers. 6502) cannot read image file (vers. 68000).

If you try to run a 32-bit image using a VM built for 64-bit images,
you will get an error message such as this:

  This interpreter (vers. 68000) cannot read image file (vers. 6502).

> 18/
> What sizes and alignment does the new 64-bit image format use for
> pointers and integers?
> - Object pointers are 64-bits wide,  allowing for memory up to 2^64 bytes to
> be
>   directly addressable.  They are aligned on 8-byte boundaries.  Integers
> are
>   still implemented as tagged 31-bit values.  They are aligned to 4-byte
>   boundaries.  These alignments were chosen as most 64-bit CPUs require
> them.

Delete the line "They are aligned to 4-byte boundaries." This is incorrect.
(Explanation: In the current 64-bit object memory, integers are encoded as
if they were 32-bit words, but are sign-extended to use the full 64-bit
object word size and therefore are aligned on 8-byte boundaries. Future
enhancements to 64-bit Squeak will probably make use of the larger word
size to increase the range of SmallInteger values, which will require
changes to both the VM and the image in order to be effective.)

Dave



More information about the Vm-dev mailing list