<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 <<a href="mailto:eliot.miranda@gmail.com" class="">eliot.miranda@gmail.com</a>> 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"> </span><span dir="ltr" class=""><<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>></span><span class="Apple-converted-space"> </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;"> <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 <<a href="mailto:eliot.miranda@gmail.com" target="_blank" class="">eliot.miranda@gmail.com</a>> 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=""> </span><span dir="ltr" class=""><<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>></span><span class=""> </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;"> <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 <<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank" class="">johnmci@smalltalkconsulting.com</a>> 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 maybeInlinePositive32BitIntegerForSignedInteger or maybeInlinePositive32BitIntegerForUnSignedInteger 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? </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 </div><div class=""><br class=""></div><div class="">sendInvokeCallbackContext:</div><div class=""><br class=""></div><div class="">in concrete, when doing this: </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"> </span>((integerValue >=<span class="Apple-converted-space"> </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"> </span>&& ((integerValue ^ (integerValue <<<span class="Apple-converted-space"> </span><span style="color: rgb(39, 42, 216);" class="">1</span>)) >=<span class="Apple-converted-space"> </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 <<<span class="Apple-converted-space"> </span><span style="color: rgb(39, 42, 216);" class="">1</span>) |<span class="Apple-converted-space"> </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"> </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. So <span style="font-size: 14px; font-family: Menlo;" class="">(integerValue ^ (integerValue << </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="">)) >= </span><span style="font-size: 14px; font-family: Menlo; color: rgb(39, 42, 216);" class="">0 </span>must read<span class="Apple-converted-space"> </span><span style="font-size: 14px; font-family: Menlo;" class="">(long)(integerValue ^ (integerValue << </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="">)) >= </span><font color="#272ad8" face="Menlo" class="">0</font>. 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"> </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"> </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"> </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><api></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 << 1))<span class="Apple-converted-space"> </span><b class="">asInteger</b><span class="Apple-converted-space"> </span>>= 0]</div><div class=""><span class="" style="white-space: pre;">                </span>inSmalltalk: [intValue >= 16r-40000000 and: [intValue <= 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=""> </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=""> </span><span dir="ltr" class=""><<a href="mailto:estebanlm@gmail.com" target="_blank" class="">estebanlm@gmail.com</a>></span><span class=""> </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;"> <br class=""><div style="word-wrap: break-word;" class=""><div class="">Hi, </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): </div><div class=""><br class=""></div><div class=""><div class=""><span style="white-space: pre-wrap;" class="">        </span>(integerValue >= 0</div><div class=""><span style="white-space: pre-wrap;" class="">        </span><span class=""> </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. </div><div class=""><br class=""></div><div class="">2) <span style="color: rgb(120, 73, 42); font-family: Menlo; font-size: 11px;" class="">assertCStackWellAligned </span>always fail. No idea why because if does not says anything, just jmp back to the regular flow. </div><div class=""><br class=""></div><div class="">3) finally, <span style="color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;" class="">ceCaptureCStackPointers </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). </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. </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=""> </span><br class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class="">===========================================================================<br class="">John M. McIntosh. Corporate Smalltalk Consulting Ltd <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=""> </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, 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"> </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, Eliot</div></span></div></div></div></div></blockquote></div><br class=""></body></html>