[GHC] #7771: RTS should provide stg_sel_n_noupd_closure
GHC
cvs-ghc at haskell.org
Thu Mar 14 14:36:27 CET 2013
#7771: RTS should provide stg_sel_n_noupd_closure
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
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
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7771>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list