Hi Phil,

Congratulations, you have found a bug in Factor.

Here is a simple test case:

ulong-array virtual-sequence classes-intersect? . => t

I will fix this soon.

Slava

Phil Dawes wrote:
> Hi Slava, Hi Factor list,
>
> I'm attempting to optimize the generated machine code for a reduce 
> across a 32bit array, but I don't seem to be able to get the optimizer 
> to inline the method 'nth-unsafe' even when it knows the argument is of 
> my ulong-array class. 'length' however gets inlined fine:
>
> ( scratchpad ) [ { ulong-array } declare length ] f optimized-quot.
> [ 5 slot ]
>
> ( scratchpad ) [ { ulong-array } declare nth-unsafe ] f optimized-quot.
> [ nth-unsafe ]
>
> the nth-unsafe method is:
>
> TUPLE: ulong-array address length ;
>
> M: ulong-array nth-unsafe ulong-array-address ulong-nth ;
>
> Is there a trick I'm missing here? I had a glance through 
> optimizer.inlining and found 'method-body-inline?' which tests if the 
> method's flat-length is <=10 before inlining. I had a play with this but 
> could only come up with '4'.
>
> ( scratchpad ) \ ulong-array \ nth-unsafe method flat-length .
> 4
>
> Any pointers would be much appreciated,
>
> Many thanks,
>
> Phil
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to