[Vm-dev] VM Maker: VMMaker.oscog-eem.2347.mcz

Alistair Grant akgrant0710 at gmail.com
Thu Mar 8 14:59:31 UTC 2018


Hi Eliot,

On Wed, Mar 07, 2018 at 10:46:41PM +0000, commits at source.squeak.org wrote:
>  
> Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2347.mcz
> 
> ==================== Summary ====================
> 
> Name: VMMaker.oscog-eem.2347
> Author: eem
> Time: 7 March 2018, 2:46:20.98144 pm
> UUID: 062614a7-e3da-4b30-997a-9568911b9ff5
> Ancestors: VMMaker.oscog-akg.2346
> 
> Review of Alistair's recent FilePlugin changes:
> 
> Alistair, in var:type: declarations use symbols for types, as these are shared in lots of cases.

In my defense, the slang code I was looking at used strings.  But this
makes sense and I'll change.


> With several plugins, but especially the FilePlugin and SocketPlugin, avoid using cCode: 'aString(...)' inSmalltalk: [passive default] because this is not simulateable.  For example in FilePlugin>>#primitiveFileWrite you'll see
> 	bytesWritten := self
> 						sqFile: file
> 						Write: count * elementSize
> 						From: (interpreterProxy cCoerce: (interpreterProxy firstIndexableField: array) to: #'char *')
> 						At: startIndex - 1 * elementSize.
> instead of a self cCode: 'sqFileWriteFromAt(...)' form and you'll find an implementation at FilePluginSimulator>>#sqFile:Write:From:At:

It looks like it's at the point where I need to understand
the simulator (which I haven't looked at yet).

I haven't seen it yet, but I'll definitely watch Clémnt's video.
Where else should I look to get started with the simulator?


> In primitiveConnectToFile[Descriptor] you write
> 
> 	interpreterProxy failed ifFalse:
> 		[^interpreterProxy pop: 3 "rcvr, name, writeFlag"
> 							thenPush: filePointer].
> 	^interpreterProxy primitiveFail.
> 
> but there's no point calling primitiveFail a secoind time given that interpreterProxy failed tells you the primitive has already failed.  Simply write
> 
> 	interpreterProxy failed ifFalse: 
> 		[interpreterProxy pop: 3 "rcvr, name, writeFlag"
> 							thenPush: filePointer]

OK.

Thanks for the feedback,
Alistair


More information about the Vm-dev mailing list