<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 19 Mar 2019 at 16:47, Ben Coman <<a href="mailto:btc@openinworld.com">btc@openinworld.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 17 Mar 2019 at 02:49, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div dir="ltr">Hi Ben,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 15, 2019 at 2:13 AM Ben Coman <<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div>Found some recent WebAssembly articles that may impact issues previously raised as impediments to Smalltalk-on-WebAssembly.</div><div>Do these indicate anything useful for the possibility of running Squeak/Pharo on WebAssembly...</div><div><br></div><div>Calls between JavaScript and WebAssembly are finally fast<br></div><div><a href="https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%F0%9F%8E%89/" target="_blank">https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%F0%9F%8E%89/</a><br></div><div><br></div><div><br></div><div>WebAssembly architecture for Go</div></div><div><a href="https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4/preview#" target="_blank">https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4/preview#</a></div></div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>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.</div></div></div></blockquote></div></div></blockquote><div><br></div><div><div>From <span class="gmail-il">WebAssembly</span> Illustrated...</div><div><a href="https://takenobu-hs.github.io/downloads/WebAssembly_illustrated.pdf" target="_blank">https://takenobu-hs.github.io/downloads/WebAssembly_illustrated.pdf</a></div></div><div>* Slide 23 - Call stack</div><div><br></div><div>I haven't spent any time trying to understand the code in this link, but does it give some hints...?</div><div><a href="https://github.com/llvm-mirror/llvm/blob/master/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp">https://github.com/llvm-mirror/llvm/blob/master/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp</a> </div><div><br></div><div>Something formal...</div><div><a href="https://webassembly.github.io/spec/core/exec/runtime.html#frames">https://webassembly.github.io/spec/core/exec/runtime.html#frames</a> </div><div><br></div><div>At a stretch for hints, V8 handling of walking WebAssembly frames...</div><div><a href="https://github.com/v8/v8/blob/master/src/isolate.cc#L1664-L1690">https://github.com/v8/v8/blob/master/src/isolate.cc#L1664-L1690</a>  <br></div><div><br></div><div> cheers -ben<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Can you point me to the code where this happens?<br></div><div><br></div><div>And is there a good general description of this that I could refer to if I was discussing this with someone outside our community?</div></div></div></blockquote><div><br></div><div><br></div><div>P.S. I vaguely remember a concern about non-local-returns </div><div>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."</div><div><a href="https://clementbera.wordpress.com/2015/01/21/context-and-blockclosure-implementation/">https://clementbera.wordpress.com/2015/01/21/context-and-blockclosure-implementation/</a>  <br></div><div><br></div><div>I wonder if such walking-the-stack could be helped by using WebAssembly traps<br>described as "Traps are bubbled up through nested instruction sequences"</div><div><a href="https://webassembly.github.io/spec/core/exec/runtime.html#administrative-instructions">https://webassembly.github.io/spec/core/exec/runtime.html#administrative-instructions</a> <br></div><div><br></div><br class="gmail-Apple-interchange-newline"><div> </div></div></div></div></div></div>