[Vm-dev] VM Maker: ImageFormat-dtl.14.mcz

Frank Shearar frank.shearar at gmail.com
Thu Nov 1 18:46:46 UTC 2012


On 1 November 2012 11:52,  <commits at source.squeak.org> wrote:
>
> David T. Lewis uploaded a new version of ImageFormat to project VM Maker:
> http://source.squeak.org/VMMaker/ImageFormat-dtl.14.mcz
>
> ==================== Summary ====================
>
> Name: ImageFormat-dtl.14
> Author: dtl
> Time: 1 November 2012, 7:52:14.48 am
> UUID: 76bad473-3b56-48fa-8fa7-80d8c7afc523
> Ancestors: ImageFormat-dtl.13
>
> Add updates to ImageFormat to report #availableBits and bitAssignments.
>
> Add ImageFileHeader and CogImageFileHeader with tests in ImageFileHeaderTest.
>
> The purpose of ImageFileHeader is to document the current formats of Cog and interpreter image file headers, and to provide a convenient way to inspect the data values an image file header.
>
> To explore the file header of an image file:
>
>   | fs |
>   fs := (FileStream readOnlyFileNamed: Smalltalk imageName) binary.
>   ([CogImageFileHeader readFrom: fs] ensure: [fs close]) explore
>
> =============== Diff against ImageFormat-dtl.13 ===============
>
> Item was removed:
> - SystemOrganization addCategory: #ImageFormat!
>
> Item was added:
> + SystemOrganization addCategory: #'ImageFormat-Header'!
> + SystemOrganization addCategory: #'ImageFormat-Tests'!
>
> Item was added:
> + ImageFileHeader subclass: #CogImageFileHeader
> +       instanceVariableNames: 'desiredNumStackPages unknownShortOrCodeSizeInKs desiredEdenBytes maxExtSemTabSizeSet'
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'ImageFormat-Header'!
> +
> + !CogImageFileHeader commentStamp: 'dtl 10/31/2012 20:23' prior: 0!
> + CogImageFileHeader is an extension of ImageFileHeader with additional fields that are used by Cog and Stack VMs. Some of the additional fields are encoded as short short integers, which are 16 bits when the header word size is 32, and 32 bits when the header word size is 64. All current Cog VMs use 32 bit word size with 16 bit short integer fields.!
>
> Item was added:
> + ----- Method: CogImageFileHeader>>desiredEdenBytes (in category 'accessing') -----
> + desiredEdenBytes
> +
> +       ^ desiredEdenBytes!
>
> Item was added:
> + ----- Method: CogImageFileHeader>>desiredEdenBytes: (in category 'accessing') -----
> + desiredEdenBytes: anObject
> +
> +       desiredEdenBytes := anObject!

What types are expected here? I'd sort've guess that anObject would be
some kind of Integer, but then I'd  expect to see the argument named
anInteger or aNumber.

> Item was added:
> + ----- Method: CogImageFileHeader>>desiredNumStackPages (in category 'accessing') -----
> + desiredNumStackPages
> +
> +       ^ desiredNumStackPages!
>
> Item was added:
> + ----- Method: CogImageFileHeader>>desiredNumStackPages: (in category 'accessing') -----
> + desiredNumStackPages: anObject
> +
> +       desiredNumStackPages := anObject!

Here it's more obvious from the selector name that anObject is some
kind of numeric value, presumably an Integer?

I have similar comments about the other argument names, but I'll
condense my replies as this: I often - especially here, where I am
nearly completely ignorant about all things VM-ish - wonder what on
earth some setter is supposed to take. I rely heavily on the
aExpectedType or someThings naming conventions in trying to understand
foreign code.

frank


More information about the Vm-dev mailing list