Commit 41abcf4f authored by Ben Gamari's avatar Ben Gamari 🐢

XXX: Allow inline SRTs to be easily disabled

parent d7a3328c
......@@ -743,12 +743,13 @@ oneSRT dflags staticFuns blockids lbls isCAF cafs = do
-- build an SRT object at all, instead we put the singleton SRT
-- entry in the info table.
[one@(SRTEntry lbl)]
| -- Info tables refer to SRTs by offset (as noted in the section
| uSE_INLINE_SRT_FIELD dflags
-- Info tables refer to SRTs by offset (as noted in the section
-- "Referring to an SRT from the info table" of Note [SRTs]). However,
-- when dynamic linking is used we cannot guarantee that the offset
-- between the SRT and the info table will fit in the offset field.
-- Consequently we build a singleton SRT in in this case.
not (labelDynamic dflags this_mod lbl)
&& not (labelDynamic dflags this_mod lbl)
-- MachO relocations can't express offsets between compilation units at
-- all, so we are always forced to build a singleton SRT in this case.
......
......@@ -338,7 +338,7 @@ typedef struct StgConInfoTable_ {
* info must be a Stg[Ret|Thunk]InfoTable* (an info table that has a SRT)
*/
#if defined(TABLES_NEXT_TO_CODE)
#if defined(x86_64_HOST_ARCH)
#if defined(USE_INLINE_SRT_FIELD)
#define GET_SRT(info) \
((StgClosure*) (((StgWord) ((info)+1)) + (info)->i.srt))
#else
......@@ -365,7 +365,7 @@ typedef struct StgConInfoTable_ {
* info must be a StgFunInfoTable*
*/
#if defined(TABLES_NEXT_TO_CODE)
#if defined(x86_64_HOST_ARCH)
#if defined(USE_INLINE_SRT_FIELD)
#define GET_FUN_SRT(info) \
((StgClosure*) (((StgWord) ((info)+1)) + (info)->i.srt))
#else
......
......@@ -628,6 +628,9 @@ wanteds os = concat
-- header sizes)
,constantWord Haskell "MIN_PAYLOAD_SIZE" "MIN_PAYLOAD_SIZE"
-- whether to use inline SRT offsets (see Note [SRTs])
,constantBool Haskell "USE_INLINE_SRT_FIELD" "defined(USE_INLINE_SRT_FIELD)"
,constantInt Haskell "MIN_INTLIKE" "MIN_INTLIKE"
,constantWord Haskell "MAX_INTLIKE" "MAX_INTLIKE"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment