Re: Confused about PAP object layout

2020-02-27 Thread Simon Marlow
b 2020 Pzt, 13:45 > tarihinde şunu yazdı: > > > > I’m not following this in detail, but do please make sure that the > results of this discussion end up in a suitable Note. Obviously it’s not > transparently clear as-is, and I can see clarity emerging > > > >

Re: Confused about PAP object layout

2020-02-26 Thread Ömer Sinan Ağacan
discussion end up in a suitable Note. Obviously it’s not > > transparently clear as-is, and I can see clarity emerging > > > > > > > > Thanks! > > > > > > Simon > > > > > > > > From: ghc-devs On Behalf Of Simon Marlow > &g

Re: Confused about PAP object layout

2020-02-26 Thread Ömer Sinan Ağacan
t; > Simon > > > > From: ghc-devs On Behalf Of Simon Marlow > Sent: 24 February 2020 08:22 > To: Ömer Sinan Ağacan > Cc: ghc-devs > Subject: Re: Confused about PAP object layout > > > > On Thu, 20 Feb 2020 at 09:21, Ömer Sinan Ağacan wrote: > >

RE: Confused about PAP object layout

2020-02-24 Thread Simon Peyton Jones via ghc-devs
Sinan Ağacan Cc: ghc-devs Subject: Re: Confused about PAP object layout On Thu, 20 Feb 2020 at 09:21, Ömer Sinan Ağacan mailto:omeraga...@gmail.com>> wrote: > I'm not sure what you mean by "garbage". The bitmap merely determines whether > a field is a pointer, I think the

Re: Confused about PAP object layout

2020-02-24 Thread Simon Marlow
On Thu, 20 Feb 2020 at 09:21, Ömer Sinan Ağacan wrote: > > I'm not sure what you mean by "garbage". The bitmap merely determines > whether > > a field is a pointer, > > I think the bitmap is for liveness, not for whether a field is pointer or > not. > Relevant code for building an info table for

Re: Confused about PAP object layout

2020-02-20 Thread Ben Gamari
Ömer Sinan Ağacan writes: >> I'm not sure what you mean by "garbage". The bitmap merely determines whether >> a field is a pointer, > > I think the bitmap is for liveness, not for whether a field is pointer or not. > Relevant code for building an info table for a function: > > mk_pieces (Fun

Re: Confused about PAP object layout

2020-02-20 Thread Ömer Sinan Ağacan
> I'm not sure what you mean by "garbage". The bitmap merely determines whether > a field is a pointer, I think the bitmap is for liveness, not for whether a field is pointer or not. Relevant code for building an info table for a function: mk_pieces (Fun arity (ArgGen arg_bits)) srt_label

Re: Confused about PAP object layout

2020-02-14 Thread Ben Gamari
Ömer Sinan Ağacan writes: > I think that makes sense, with the invariant that n_args <= bitmap_size. We > evacuate the arguments used by the function but not others. Thanks. > > It's somewhat weird to see an object with useful stuff, then garbage, then > useful stuff again in the heap, but

Re: Confused about PAP object layout

2020-02-14 Thread Ömer Sinan Ağacan
I think that makes sense, with the invariant that n_args <= bitmap_size. We evacuate the arguments used by the function but not others. Thanks. It's somewhat weird to see an object with useful stuff, then garbage, then useful stuff again in the heap, but that's not an issue by itself. For example

Re: Confused about PAP object layout

2020-02-14 Thread Ben Gamari
Ömer Sinan Ağacan writes: > Right, I think that's the problem. We then pass the same "size" to > scavenge_large_bitmap as the size of the bitmap. So we assume size of the > bitmap > is pap->n_args. > > So the call stack is > > - scavenge_PAP, calls scavenge_PAP_payload with pap->n_args as

Re: Confused about PAP object layout

2020-02-14 Thread Alexis King
Disclaimer: I am not an expert. But I happened to have been looking at this code just yesterday, so I’ll try to answer to check my understanding. :) Fundamentally, a PAP is not fully-saturated, so the number of arguments in its payload may be smaller than the information contained in the

Re: Confused about PAP object layout

2020-02-14 Thread Ömer Sinan Ağacan
Right, I think that's the problem. We then pass the same "size" to scavenge_large_bitmap as the size of the bitmap. So we assume size of the bitmap is pap->n_args. So the call stack is - scavenge_PAP, calls scavenge_PAP_payload with pap->n_args as "size" - scavenge_PAP_payload, calls

Re: Confused about PAP object layout

2020-02-14 Thread Simon Marlow
On Fri, 14 Feb 2020 at 11:49, Ömer Sinan Ağacan wrote: > Hi Simon, > > In this code: (slightly simplified) > > StgPtr > scavenge_PAP (StgPAP *pap) > { > evacuate(>fun); > return scavenge_PAP_payload (pap->fun, pap->payload, pap->n_args); > } > > StgPtr >