Peter Trommler pushed to branch wip/T26579 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Cmm/Info.hs
    ... ... @@ -28,7 +28,7 @@ module GHC.Cmm.Info (
    28 28
       conInfoTableSizeB,
    
    29 29
       stdSrtBitmapOffset,
    
    30 30
       stdClosureTypeOffset,
    
    31
    -  stdPtrsOffset, stdNonPtrsOffset,
    
    31
    +  stdPtrsOffset, stdNonPtrsOffset
    
    32 32
     ) where
    
    33 33
     
    
    34 34
     import GHC.Prelude
    
    ... ... @@ -215,6 +215,15 @@ mkInfoTableContents profile
    215 215
            ; return (prof_data ++ ct_data, (std_info, extra_bits)) }
    
    216 216
       where
    
    217 217
         platform = profilePlatform profile
    
    218
    +    mk_extra_bits :: Int -> Int -> [CmmLit]
    
    219
    +    mk_extra_bits low high
    
    220
    +      = if platformTablesNextToCode platform
    
    221
    +        then [ mkStgHalfWordCLit platform high
    
    222
    +             , mkStgHalfWordCLit platform low
    
    223
    +             ]
    
    224
    +        else [ mkStgHalfWordCLit platform low
    
    225
    +             , mkStgHalfWordCLit platform high
    
    226
    +             ]
    
    218 227
         mk_pieces :: ClosureTypeInfo -> [CmmLit]
    
    219 228
                   -> UniqDSM ( Maybe CmmLit   -- Override the SRT field with this
    
    220 229
                              , Maybe [CmmLit] -- Override the layout field with this
    
    ... ... @@ -235,18 +244,16 @@ mkInfoTableContents profile
    235 244
              -- Layout known (one free var); we use the layout field for offset
    
    236 245
     
    
    237 246
         mk_pieces (Fun arity (ArgSpec fun_type)) srt_label
    
    238
    -      = do { let extra_bits = mkStgHalfWordCLit platform fun_type
    
    239
    -                            : mkStgHalfWordCLit platform arity
    
    240
    -                            : srt_label
    
    247
    +      = do { let extra_bits = mk_extra_bits fun_type arity
    
    248
    +                           ++ srt_label
    
    241 249
                ; return (Nothing, Nothing,  extra_bits, []) }
    
    242 250
     
    
    243 251
         mk_pieces (Fun arity (ArgGen arg_bits)) srt_label
    
    244 252
           = do { (liveness_lit, liveness_data) <- mkLivenessBits platform arg_bits
    
    245 253
                ; let fun_type | null liveness_data = aRG_GEN
    
    246 254
                               | otherwise          = aRG_GEN_BIG
    
    247
    -                 extra_bits = mkStgHalfWordCLit platform fun_type
    
    248
    -                            : mkStgHalfWordCLit platform arity
    
    249
    -                            : (if inlineSRT platform then [] else [ srt_lit ])
    
    255
    +                 extra_bits = mk_extra_bits fun_type arity
    
    256
    +                           ++ (if inlineSRT platform then [] else [ srt_lit ])
    
    250 257
                                ++ [ liveness_lit, slow_entry ]
    
    251 258
                ; return (Nothing, Nothing, extra_bits, liveness_data) }
    
    252 259
           where