<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 9, 2015 at 8:36 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Hi Ryan,</div><div><br></div><div>    IMO the likely issue is register usage in trampoline calls.  The JIT tries to reduce register saving and restoring across trampoline calls by using a notion of the ABI&#39;s caller-saved registers.  Callee-saved registers shouldn&#39;t be an issue because either a run-time call returns to the same trampoline that invoked it, hence restoring callee-saved registers, or enters machine code via an enlopmart which assumes no registers are live and restores any and all registers as appropriate.  But there could be bugs here, and certainly gcc could change over versions, perhaps becoming more aggressive in register saving, and surfacing previously undetected bugs here.</div></div></div></div></blockquote><div><br></div><div>I&#39;ve been using the same compiler versions though, did this change recently in Cog?</div><div><br></div><div>The runtime entries should be marked &quot;extern&quot;. <a href="https://github.com/dart-lang/sdk/blob/6542a451c38c650a5ce9323e474982384a5daf31/runtime/vm/runtime_entry.h#L67" target="_blank">Compare a VM that works at -O3.</a></div><div><br></div><div>Some quick and dirty sed hacking and this partially fixes NSVM on clang 3.4 (can now complete the test suite without crashing about half of the time).</div><div><br></div><div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/void ce/extern void ce/&#39;</div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/void (\*ce/extern void (\*ce/&#39;</div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/sqInt ce/extern sqInt ce/&#39;</div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/VM_EXPORT extern/extern/&#39;</div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/static extern/static/&#39;</div><div>find ns*src -name &#39;*.c&#39; -o -name &#39;*.h&#39; -print0 | xargs -0 sed -i &#39;&#39; -e &#39;s/extern sqInt cesoRetAddr/sqInt cesoRetAddr/&#39;</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8000001907349px">One thing to do is compare a StackInterpreter VM against Cog, at least to locate the blame.</span></blockquote><div><br></div><div>The stack VM is fine.</div><div><br></div><div><br></div><div><br></div><div> </div></div><br></div></div>