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

Clément Bera bera.clement at gmail.com
Thu Mar 8 16:40:46 UTC 2018


On Thu, Mar 8, 2018 at 4:57 PM, Eliot Miranda <eliot.miranda at gmail.com>
wrote:

>
> Hi Alistair,
>
>
>
> _,,,^..^,,,_ (phone)
> On Mar 8, 2018, at 6:59 AM, Alistair Grant <akgrant0710 at gmail.com> wrote:
>
> 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?
>
>
Here is a description with some warm-up exercises to get started with the
VM simulator:
https://clementbera.wordpress.com/2016/05/30/simulating-the-cog-vm/
(Note that now the does not feature any more the processor simulators by
default that post is 2y old)

My video deals with machine code stepping. I'm happy if you watch it, but
that's different from what you want to do with the simulator. I would use
the StackVMSimulator to debug a plugin like yours unless there's a specific
bug with a JIT interaction.


>
> It should be as simple as following the instructions on
> http://www.mirandabanda.org/cogblog/build-image/
> but since we no longer include the processor simulator plugins in the
> standard vm builds, the VM obtained by
>     image/getGoodSpur[64]VM.sh
> won't allow simulating the CoInterpreter (the JIT), only the
> StackInterpreter.  So this needs to be fixed.
>
> I could build the processor simulator plugins and put them on my website
> or we could set up a build on the CI infrastructure.  But with the latter I
> could do with some help.
>
>
>
> 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
>
>
>


-- 
Clément Béra
Pharo consortium engineer
https://clementbera.github.io/
https://clementbera.wordpress.com/
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180308/8524f891/attachment.html>


More information about the Vm-dev mailing list