[Vm-dev] Re: Alien on Spur and "el capitan"?

John McIntosh johnmci at smalltalkconsulting.com
Tue Oct 20 20:48:35 UTC 2015


Ok, you know there is a test plugin squeakSUnitTester (See the *m/h files)
 I made to check types being passed to/from the Objective-C interface to
confirm things are being transferred/received correctly.  However I did
write something similar for the FFI interface where, or using using
Smalltalk code where I iterated over the entire range of +/- 2 billion then
edge cases for LargePositive/Negative integers for each point where we
added another byte of accuracy for a few bytes.   The reasons for that was
to confirm that integer conversion was working correctly for all cases when
we had migrated to 32bit clean code a decade back.


On Tue, Oct 20, 2015 at 1:35 PM, Esteban Lorenzano <estebanlm at gmail.com>
wrote:

>
> well… I solve the problem.
> Everything is about the first issue report (comparison is always true).
> I changed first from “unsigned long” to “sqLong” but then I realised
> sqLong is defined as “long long” so this expression:
>
> intValue bitXor: (intValue << 1)) >= 0
>
> since number fitted in "long long”, was also always true. Then of course
> it was converting into a SmallInteger a number that should be a
> LongPositiveInteger.
>
> my fix: just to change #maybeInlinePositive32BitIntegerFor: and around to
> ensure parameter is “sqInt”.
> That works.
>
> Now, I have this doubts:
>
> - how is possible this was working before? maybe this is a change in clang
> 7 (apple)?
> - now I have a lot of complains of “comparison of unsigned expression is
> always true” all around the image. Should we take care about them?
>
> I will do some tests and commit to VMMaker tomorrow.
>
> cheers,
> Esteban
>
>
> On 19 Oct 2015, at 18:31, Esteban Lorenzano <estebanlm at gmail.com> wrote:
>
> Hi,
>
> Does anyone tested Alien on Spur and "El capitan"? specifically callbacks?
> For me, a completely broken :(
>
> 1) this structure (in maybeInlinePositive32BitIntegerFor: and others):
>
> (integerValue >= 0
> and: [objectMemory isIntegerValue: integerValue]) ifTrue:
> [^objectMemory integerObjectOf: integerValue].
>
> 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.
>
> 2) assertCStackWellAligned always fail. No idea why because if does not
> says anything, just jmp back to the regular flow.
>
> 3) finally, ceCaptureCStackPointers 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).
>
> I guess solution of (1) is easy: argument number just has to be a sqLong
> instead an unsigned long.
>
> But for 2 and 3 I have no idea where to start.
>
> Does anyone has an idea?
>
> Esteban
>
>
>
>


-- 
===========================================================================
John M. McIntosh. Corporate Smalltalk Consulting Ltd
https://www.linkedin.com/in/smalltalk
===========================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151020/ef25e3b8/attachment-0001.htm


More information about the Vm-dev mailing list