[Vm-dev] tracking WebAssembly

Ben Coman btc at openinworld.com
Sat Mar 30 05:38:53 UTC 2019


On Tue, 19 Mar 2019 at 16:47, Ben Coman <btc at openinworld.com> wrote:

>
>
> On Sun, 17 Mar 2019 at 02:49, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
>
>>
>> Hi Ben,
>>
>> On Fri, Mar 15, 2019 at 2:13 AM Ben Coman <btc at openinworld.com> wrote:
>>
>>>
>>> Found some recent WebAssembly articles that may impact issues previously
>>> raised as impediments to Smalltalk-on-WebAssembly.
>>> Do these indicate anything useful for the possibility of running
>>> Squeak/Pharo on WebAssembly...
>>>
>>> Calls between JavaScript and WebAssembly are finally fast
>>>
>>> https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%F0%9F%8E%89/
>>>
>>>
>>> WebAssembly architecture for Go
>>>
>>> https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4/preview#
>>>
>>
>> Good to read.  What can you find that discusses the range of stack frame
>> formats?  To map the StackInterpreter to WebAssembly conveniently we would
>> need there ability to store the current method/closure in each frame.
>>
>
>From WebAssembly Illustrated...
https://takenobu-hs.github.io/downloads/WebAssembly_illustrated.pdf
* Slide 23 - Call stack

I haven't spent any time trying to understand the code in this link, but
does it give some hints...?
https://github.com/llvm-mirror/llvm/blob/master/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp


Something formal...
https://webassembly.github.io/spec/core/exec/runtime.html#frames

At a stretch for hints, V8 handling of walking WebAssembly frames...
https://github.com/v8/v8/blob/master/src/isolate.cc#L1664-L1690

 cheers -ben


> Can you point me to the code where this happens?
>
> And is there a good general description of this that I could refer to if I
> was discussing this with someone outside our community?
>


P.S. I vaguely remember a concern about non-local-returns
described as  "A blockClosure has a direct pointer to its outerContext, the
context that created the blockClosure. With this variable, the blockClosure
can ... perform non local return. ... A blockClosure can return either to
its sender (see our example with false as argument) or to its homeContext
sender. This non local returns requires the virtual machine to walk up the
stack until it finds the stack frame to return to. This can be done only
using the outerContext field."
https://clementbera.wordpress.com/2015/01/21/context-and-blockclosure-implementation/


I wonder if such walking-the-stack could be helped by using WebAssembly
traps
described as "Traps are bubbled up through nested instruction sequences"
https://webassembly.github.io/spec/core/exec/runtime.html#administrative-instructions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190330/223a8ce5/attachment.html>


More information about the Vm-dev mailing list