Skip to content

RTS should provide stg_sel_n_noupd_closure

In StgStdThunks.cmm we define info tables stg_sel_1_upd_info, etc, for "selector thunks", thus:

#define SELECTOR_CODE_UPD(offset)                                       \
  INFO_TABLE_SELECTOR(stg_sel_##offset##_upd, offset, THUNK_SELECTOR, "stg_sel_upd", "stg_sel_upd") \
      (P_ node)                                                         \
...etc...

But we should ALSO define info tables for non-updatable selector thunks, thus stg_sel_1_nonupd_info etc. We didn't generate any such selectors before, but now I'm implementing cardinality analysis, we are.

Would it be possible to beef up this macro to to generate both info tables? Simply omit the update for the nonupd version. (It wasn't quite obvious to me how to do this.)

That would allow me to get rid of this hack in CLabel

pprCLbl (RtsLabel (RtsSelectorInfoTable _upd_reqd offset))
  = hcat [ptext (sLit "stg_sel_"), text (show offset),
                  ptext (sLit "_upd_info")
-- RTS only has updatable selector thunks at the moment
-- so we use just them
--                ptext (if upd_reqd
--                        then (sLit "_upd_info")
--                        else (sLit "_noupd_info"))
        ]

Thanks

Trac metadata
Trac field Value
Version 7.6.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information