Can we mark DataCon ptrs only in allocation sites and not generate entry code?

Simon Peyton Jones simonpj at microsoft.com
Thu Aug 25 15:41:59 UTC 2016


StgCmmCon.hs:240 reads
             ; return (mkRhsInit dflags reg lf_info hp_plus_n) }

what's that got to do with pointer tagging?


But yes we need to do it in both places.  Consider

f x xs = let y = x:xs
         in g y

We should tag y before passing it to g.  That's the StgCmmCon case.


But also we clearly must do so in the entry code for a data constructor


Simon

|  -----Original Message-----
|  From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Ă–mer
|  Sinan Agacan
|  Sent: 25 August 2016 11:46
|  To: ghc-devs <ghc-devs at haskell.org>
|  Subject: Can we mark DataCon ptrs only in allocation sites and not
|  generate entry code?
|  
|  As far as I can see in the native code compiler we mark DataCon
|  pointers in two places:
|  
|  1. In allocation sites (StgCmmCon.hs:240)
|  2. In DataCon entry code (StgCmm.hs:244)
|  
|  I was wondering why we can't get away with just doing (1). Can anyone
|  give me
|  an example where an allocation doesn't return a tagged pointer and we
|  need to
|  tag it in entry code? If every allocation returns a tagged pointer,
|  then why do
|  we need (2) ?
|  
|  Thanks
|  _______________________________________________
|  ghc-devs mailing list
|  ghc-devs at haskell.org
|  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h
|  askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  devs&data=01%7c01%7csimonpj%40microsoft.com%7cb1571fb2c4e24941998308d3
|  ccd519bb%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=ilDdLBFdfvzY1g6Z
|  iuHyY6W%2bOIq2Y69f5YTgmpqwRO8%3d


More information about the ghc-devs mailing list