Strictness in data declaration not matched in assembler?
Lennart Augustsson
lennart at augustsson.net
Wed Oct 15 11:08:57 EDT 2008
I totally agree. Getting the value of the field should just evaluate
x and then use a pointer indirection; there should be no conditional
jumps involved in getting the value.
GHC is just doing the wrong thing.
-- Lennart
On Wed, Oct 15, 2008 at 3:58 PM, Tyson Whitehead <twhitehead at gmail.com> wrote:
> On Wednesday 15 October 2008 10:48:26 you wrote:
>> Strictness does not imply unboxing.
>>
>> To see why not, think about the fact that unboxing breaks sharing. By
>> keeping the pointer-indirection in place, we can share even strict
>> fields between related values.
>
> I believe I realize that. What I was wondering about was the fact that it
> seemed to think the pointer might be to a thunk (instead of constructor
> closure). Doesn't the strictness flag mean the following assembler would work
>
> sni_info:
> movq 7(%rbx),%rbx
> movq $snj_info,(%rbp)
> jmp snj_info
>
> (which could be cleaned up further by combining it with snj_info) instead of
>
> sni_info:
> movq 7(%rbx),%rbx
> movq $snj_info,(%rbp)
> testq $7,%rbx
> jne snj_info
> jmp *(%rbx)
>
> (i.e., the whole test if it is a thunk and conditionally evaluate it bit is
> unnecessary due to constructor the strictness flag).
>
> Cheers! -Tyson
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
More information about the Glasgow-haskell-users
mailing list