Authored by simonmar on Nov 9 2016, 5:15 AM.



We currently have two info tables for a constructor

  • XXX_con_info: the info table for a heap-resident instance of the constructor, It has type CONSTR, or one of the specialised types like CONSTR_1_0
  • XXX_static_info: the info table for a static instance of this constructor, which has type CONSTR_STATIC or CONSTR_STATIC_NOCAF.

I'm getting rid of the latter, and using the con_info info table for
both static and dynamic constructors. For rationale and more details
see Note [static constructors] in SMRep.hs.

I also removed these macros: isSTATIC(), ip_STATIC(),
closure_STATIC(), since they relied on the CONSTR/CONSTR_STATIC
distinction, and anyway HEAP_ALLOCED() does the same job.

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
simonmar updated this revision to Diff 9344.Nov 9 2016, 5:15 AM
simonmar retitled this revision from to Remove CONSTR_STATIC.
simonmar updated this object.
simonmar edited the test plan for this revision. (Show Details)
simonmar added reviewers: bgamari, simonpj, gcampax, niteria.
simonmar updated the Trac tickets for this revision.
simonpj edited edge metadata.Nov 9 2016, 2:29 PM

Don't we need the distinction because the copying GC doesn't copy static constructors, but does copy dynamic ones!

Could you perhaps say in "Note [Static constructors'" in SMRep how this distinction is made even though they share an info table?



simonmar updated this revision to Diff 9349.Nov 10 2016, 4:05 AM
simonmar edited edge metadata.

Address @simonpj comment: mention that the GC uses HEAP_ALLOCED() to
distinguish between static and dynamic closures in the Note.

This revision was automatically updated to reflect the committed changes.