<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Oct 2015, at 23:57, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" class="">eliot.miranda@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Tue, Oct 20, 2015 at 2:50 PM, Esteban Lorenzano<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><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;">&nbsp;<br class=""><div style="word-wrap: break-word;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 20 Oct 2015, at 23:35, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank" class="">eliot.miranda@gmail.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">Hi Esteban,<br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Oct 20, 2015 at 2:23 PM, Esteban Lorenzano<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""><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;">&nbsp;<br class=""><div style="word-wrap: break-word;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 20 Oct 2015, at 22:59, John McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank" class="">johnmci@smalltalkconsulting.com</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" class="">Ok, you know you are using maybeInlinePositive32BitIntegerFor for BOTH unsigned and signed integers? That to me rings alarm bells, so do you need&nbsp;maybeInlinePositive32BitIntegerForSignedInteger or&nbsp;maybeInlinePositive32BitIntegerForUnSignedInteger &nbsp;or always cast the incoming value to an unsigned integer, or is it signed? If so are you sure you understand the math involved and the possible input values?&nbsp;</div></div></blockquote><div class=""><br class=""></div><div class="">I’m not using maybeInlinePositive32BitIntegerFor for anything. Is Eliot who is doing it :)</div><div class="">But yes, I thought that first, then I followed the logic and figured out the intent was kept just changing the input type… but I might be wrong… Eliot should know better :)</div></div></div></blockquote><div class=""><br class=""></div><div class="">what's the context?</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I spotted the problem when calling&nbsp;</div><div class=""><br class=""></div><div class="">sendInvokeCallbackContext:</div><div class=""><br class=""></div><div class="">in concrete, when doing this:&nbsp;</div><div class=""><br class=""></div><div class=""><div class=""><span style="white-space: pre-wrap;" class="">        </span>self push: (self positiveMachineIntegerFor: vmCallbackContext asUnsignedInteger).</div><div class=""><br class=""></div><div class="">positiveMachineIntegerFor: always inlines the callback context (answering then a random position in memory).</div><div class=""><br class=""></div><div class="">and after analysis, I found that the casting of oop with “unsigned long” makes that the two comparisons in:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="white-space: pre-wrap;" class="">        </span><span style="color: rgb(187, 44, 162);" class="">if</span><span class="Apple-converted-space">&nbsp;</span>((integerValue &gt;=<span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(39, 42, 216);" class="">0</span>)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="white-space: pre-wrap;" class="">        </span><span class="Apple-converted-space">&nbsp;</span>&amp;&amp; ((integerValue ^ (integerValue &lt;&lt;<span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(39, 42, 216);" class="">1</span>)) &gt;=<span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(39, 42, 216);" class="">0</span>)) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="white-space: pre-wrap;" class="">                </span>object3 = ((integerValue &lt;&lt;<span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(39, 42, 216);" class="">1</span>) |<span class="Apple-converted-space">&nbsp;</span><span style="color: rgb(39, 42, 216);" class="">1</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="white-space: pre-wrap;" class="">                </span><span style="color: rgb(187, 44, 162);" class="">goto</span><span class="Apple-converted-space">&nbsp;</span>l12;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="white-space: pre-wrap;" class="">        </span>}</div></div><div class=""><br class=""></div><div class="">always evaluates to true, no matter the value it receives.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Right.&nbsp; So &nbsp;<span style="font-size: 14px; font-family: Menlo;" class="">(integerValue ^ (integerValue &lt;&lt;&nbsp;</span><span style="font-size: 14px; font-family: Menlo; color: rgb(39, 42, 216);" class="">1</span><span style="font-size: 14px; font-family: Menlo;" class="">)) &gt;=&nbsp;</span><span style="font-size: 14px; font-family: Menlo; color: rgb(39, 42, 216);" class="">0&nbsp;</span>must read<span class="Apple-converted-space">&nbsp;</span><span style="font-size: 14px; font-family: Menlo;" class="">(long)(integerValue ^ (integerValue &lt;&lt;&nbsp;</span><span style="font-size: 14px; font-family: Menlo; color: rgb(39, 42, 216);" class="">1</span><span style="font-size: 14px; font-family: Menlo;" class="">)) &gt;=&nbsp;</span><font color="#272ad8" face="Menlo" class="">0</font>.&nbsp; So we probably need isIntegerValue: to read<br class=""><br class="">isIntegerValue: intValue</div><div class=""><div class=""><span class="" style="white-space: pre;">        </span>"Answer if the given value can be represented as a Smalltalk integer value.</div><div class=""><span class="" style="white-space: pre;">        </span><span class="Apple-converted-space">&nbsp;</span>In C, use a shift and XOR to set the sign bit if and only if the top two bits of the given</div><div class=""><span class="" style="white-space: pre;">        </span><span class="Apple-converted-space">&nbsp;</span>value are the same, then test the sign bit. Note that the top two bits are equal for</div><div class=""><span class="" style="white-space: pre;">        </span><span class="Apple-converted-space">&nbsp;</span>exactly those integers in the range that can be represented in 31-bits or 63-bits."</div><div class=""><span class="" style="white-space: pre;">        </span>&lt;api&gt;</div><div class=""><span class="" style="white-space: pre;">        </span>^self</div><div class=""><span class="" style="white-space: pre;">                </span>cCode: [(intValue bitXor: (intValue &lt;&lt; 1))<span class="Apple-converted-space">&nbsp;</span><b class="">asInteger</b><span class="Apple-converted-space">&nbsp;</span>&gt;= 0]</div><div class=""><span class="" style="white-space: pre;">                </span>inSmalltalk: [intValue &gt;= 16r-40000000 and: [intValue &lt;= 16r3FFFFFFF]]</div></div><div class=""><br class=""></div><div class="">I'll be able to test thing change soon.</div></div></div></blockquote><div><br class=""></div><div>it is working for me (at least on first pass) :)</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class=""></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;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">Esteban</div></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">&nbsp;</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;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><br class=""></div><div class="">Esteban</div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""><div class=""><br class=""></div><div class=""><br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Oct 19, 2015 at 9:31 AM, Esteban Lorenzano<span class="">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>&gt;</span><span class="">&nbsp;</span>wrote:<br class=""><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;">&nbsp;<br class=""><div style="word-wrap: break-word;" class=""><div class="">Hi,&nbsp;</div><div class=""><br class=""></div><div class="">Does anyone tested Alien on Spur and "El capitan"? specifically callbacks?</div><div class="">For me, a completely broken :(</div><div class=""><br class=""></div><div class="">1) this structure (in maybeInlinePositive32BitIntegerFor: and others):&nbsp;</div><div class=""><br class=""></div><div class=""><div class=""><span style="white-space: pre-wrap;" class="">        </span>(integerValue &gt;= 0</div><div class=""><span style="white-space: pre-wrap;" class="">        </span><span class="">&nbsp;</span>and: [objectMemory isIntegerValue: integerValue]) ifTrue:</div><div class=""><span style="white-space: pre-wrap;" class="">                </span>[^objectMemory integerObjectOf: integerValue].</div></div><div class=""><br class=""></div><div class="">Does not works if “integer value” is an unsigned long, because compiler assumes it will always be true, then remove the if, then answers a wrong value.&nbsp;</div><div class=""><br class=""></div><div class="">2)&nbsp;<span style="color: rgb(120, 73, 42); font-family: Menlo; font-size: 11px;" class="">assertCStackWellAligned&nbsp;</span>always fail. No idea why because if does not says anything, just jmp back to the regular flow.&nbsp;</div><div class=""><br class=""></div><div class="">3) finally,&nbsp;<span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">ceCaptureCStackPointers&nbsp;</span>also fails… this can be because (2) or because other reasons (it also jmps back so no clue) (method generateCaptureCStackPointers: clarifies is a hack, so I suppose it stopped to work).&nbsp;</div><div class=""><br class=""></div><div class="">I guess solution of (1) is easy: argument number just has to be a sqLong instead an unsigned long.&nbsp;</div><div class=""><br class=""></div><div class="">But for 2 and 3 I have no idea where to start.</div><div class=""><br class=""></div><div class="">Does anyone has an idea?</div><div class=""><br class=""></div><div class="">Esteban</div><div class=""><br class=""></div></div><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="">&nbsp;</span><br class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class="">===========================================================================<br class="">John M. McIntosh. Corporate Smalltalk Consulting Ltd&nbsp;<a href="https://www.linkedin.com/in/smalltalk" target="_blank" class="">https://www.linkedin.com/in/smalltalk</a><br class="">===========================================================================<br class=""></div></div></div></div></div></div></blockquote></div><br class=""></div><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="">&nbsp;</span><br class=""><div class=""><div dir="ltr" class=""><div class=""><span style="font-size: small; border-collapse: separate;" class=""><div class="">_,,,^..^,,,_<br class=""></div><div class="">best,&nbsp;Eliot</div></span></div></div></div></div></div></div></blockquote></div><br class=""></div><br class=""></blockquote></div><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br clear="all" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space">&nbsp;</span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_signature" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr" class=""><div class=""><span style="font-size: small; border-collapse: separate;" class=""><div class="">_,,,^..^,,,_<br class=""></div><div class="">best,&nbsp;Eliot</div></span></div></div></div></div></blockquote></div><br class=""></body></html>