|
| 1 | + |
| 2 | +{-# LANGUAGE GHC2021 #-} |
| 3 | +{-# LANGUAGE AllowAmbiguousTypes #-} |
| 4 | +{-# LANGUAGE DataKinds #-} |
| 5 | +{-# LANGUAGE DerivingVia #-} |
| 6 | +{-# LANGUAGE GADTs #-} |
| 7 | +{-# LANGUAGE ImpredicativeTypes #-} |
| 8 | +{-# LANGUAGE LinearTypes #-} |
| 9 | +{-# LANGUAGE MagicHash #-} |
| 10 | +{-# LANGUAGE PatternSynonyms #-} |
| 11 | +{-# LANGUAGE RecordWildCards #-} |
| 12 | +{-# LANGUAGE ScopedTypeVariables #-} |
| 13 | +{-# LANGUAGE TypeFamilies #-} |
| 14 | +{-# LANGUAGE UnboxedTuples #-} |
| 15 | +{-# LANGUAGE UndecidableInstances #-} |
| 16 | +{-# OPTIONS_GHC -Wno-name-shadowing #-} |
| 17 | +{-# OPTIONS_GHC -ddump-simpl -ddump-to-file -dsuppress-all #-} |
| 18 | +{-# OPTIONS_HADDOCK hide #-} |
| 19 | + |
| 20 | +module Compact.Destination.GFill where |
| 21 | + |
| 22 | +-- ***************************************************************************** |
| 23 | +-- * THIS FILE IS GENERATED BY SCRIPT GFill.hs.py, PLEASE DO NOT EDIT MANUALLY * |
| 24 | +-- ***************************************************************************** |
| 25 | + |
| 26 | +import Compact.Destination.Internal |
| 27 | +import GHC.Generics |
| 28 | +import Data.Kind (Type) |
| 29 | +import GHC.Exts |
| 30 | +import GHC.TypeLits |
| 31 | +import Unsafe.Coerce (unsafeCoerceAddr) |
| 32 | + |
| 33 | +class GFill# lCtor (specCtor :: (Meta, [(Meta, Type)])) (a :: Type) where |
| 34 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld -> (# State# RealWorld, GDestsOf specCtor r #) |
| 35 | + |
| 36 | +instance ( |
| 37 | + Generic a, |
| 38 | + repA ~ Rep a (), |
| 39 | + metaA ~ GDatatypeMetaOf repA, |
| 40 | + Datatype metaA, |
| 41 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 42 | + Constructor metaCtor, |
| 43 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 44 | + 'Just '(metaCtor, '[ ]) ~ GSpecCtorOf symCtor (Rep a ()) |
| 45 | + ) => GFill# lCtor '(metaCtor, '[ ]) a where |
| 46 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 47 | + -> (# State# RealWorld, () #) |
| 48 | + gFill# c# m# d# s0 = |
| 49 | + case takeMVar# m# s0 of |
| 50 | + (# s1, () #) -> |
| 51 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 52 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 53 | + (# s3, pXInRegion# #) -> case getSlots0# xInRegion bH# bW# s3 of |
| 54 | + (# s4, (# #) #) -> case putMVar# m# () s4 of |
| 55 | + s5 -> putDebugLn# |
| 56 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) []) |
| 57 | + (# s5, () #) |
| 58 | + {-# INLINE gFill# #-} |
| 59 | + |
| 60 | +instance ( |
| 61 | + Generic a, |
| 62 | + repA ~ Rep a (), |
| 63 | + metaA ~ GDatatypeMetaOf repA, |
| 64 | + Datatype metaA, |
| 65 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 66 | + Constructor metaCtor, |
| 67 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 68 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 69 | + NotUnpacked ds0 |
| 70 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0)]) a where |
| 71 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 72 | + -> (# State# RealWorld, (Dest r t0) #) |
| 73 | + gFill# c# m# d# s0 = |
| 74 | + case takeMVar# m# s0 of |
| 75 | + (# s1, () #) -> |
| 76 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 77 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 78 | + (# s3, pXInRegion# #) -> case getSlots1# xInRegion bH# bW# s3 of |
| 79 | + (# s4, (# d0# #) #) -> case putMVar# m# () s4 of |
| 80 | + s5 -> putDebugLn# |
| 81 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#]) |
| 82 | + (# s5, (Dest d0#) #) |
| 83 | + {-# INLINE gFill# #-} |
| 84 | + |
| 85 | +instance ( |
| 86 | + Generic a, |
| 87 | + repA ~ Rep a (), |
| 88 | + metaA ~ GDatatypeMetaOf repA, |
| 89 | + Datatype metaA, |
| 90 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 91 | + Constructor metaCtor, |
| 92 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 93 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 94 | + '( 'MetaSel f1 u1 ss1 ds1, t1)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 95 | + NotUnpacked ds0, |
| 96 | + NotUnpacked ds1 |
| 97 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 98 | + '( 'MetaSel f1 u1 ss1 ds1, t1)]) a where |
| 99 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 100 | + -> (# State# RealWorld, (Dest r t0, Dest r t1) #) |
| 101 | + gFill# c# m# d# s0 = |
| 102 | + case takeMVar# m# s0 of |
| 103 | + (# s1, () #) -> |
| 104 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 105 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 106 | + (# s3, pXInRegion# #) -> case getSlots2# xInRegion bH# bW# s3 of |
| 107 | + (# s4, (# d0#, d1# #) #) -> case putMVar# m# () s4 of |
| 108 | + s5 -> putDebugLn# |
| 109 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#]) |
| 110 | + (# s5, (Dest d0#, Dest d1#) #) |
| 111 | + {-# INLINE gFill# #-} |
| 112 | + |
| 113 | +instance ( |
| 114 | + Generic a, |
| 115 | + repA ~ Rep a (), |
| 116 | + metaA ~ GDatatypeMetaOf repA, |
| 117 | + Datatype metaA, |
| 118 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 119 | + Constructor metaCtor, |
| 120 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 121 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 122 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 123 | + '( 'MetaSel f2 u2 ss2 ds2, t2)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 124 | + NotUnpacked ds0, |
| 125 | + NotUnpacked ds1, |
| 126 | + NotUnpacked ds2 |
| 127 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 128 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 129 | + '( 'MetaSel f2 u2 ss2 ds2, t2)]) a where |
| 130 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 131 | + -> (# State# RealWorld, (Dest r t0, Dest r t1, Dest r t2) #) |
| 132 | + gFill# c# m# d# s0 = |
| 133 | + case takeMVar# m# s0 of |
| 134 | + (# s1, () #) -> |
| 135 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 136 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 137 | + (# s3, pXInRegion# #) -> case getSlots3# xInRegion bH# bW# s3 of |
| 138 | + (# s4, (# d0#, d1#, d2# #) #) -> case putMVar# m# () s4 of |
| 139 | + s5 -> putDebugLn# |
| 140 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#, Ptr d2#]) |
| 141 | + (# s5, (Dest d0#, Dest d1#, Dest d2#) #) |
| 142 | + {-# INLINE gFill# #-} |
| 143 | + |
| 144 | +instance ( |
| 145 | + Generic a, |
| 146 | + repA ~ Rep a (), |
| 147 | + metaA ~ GDatatypeMetaOf repA, |
| 148 | + Datatype metaA, |
| 149 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 150 | + Constructor metaCtor, |
| 151 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 152 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 153 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 154 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 155 | + '( 'MetaSel f3 u3 ss3 ds3, t3)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 156 | + NotUnpacked ds0, |
| 157 | + NotUnpacked ds1, |
| 158 | + NotUnpacked ds2, |
| 159 | + NotUnpacked ds3 |
| 160 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 161 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 162 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 163 | + '( 'MetaSel f3 u3 ss3 ds3, t3)]) a where |
| 164 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 165 | + -> (# State# RealWorld, (Dest r t0, Dest r t1, Dest r t2, Dest r t3) #) |
| 166 | + gFill# c# m# d# s0 = |
| 167 | + case takeMVar# m# s0 of |
| 168 | + (# s1, () #) -> |
| 169 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 170 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 171 | + (# s3, pXInRegion# #) -> case getSlots4# xInRegion bH# bW# s3 of |
| 172 | + (# s4, (# d0#, d1#, d2#, d3# #) #) -> case putMVar# m# () s4 of |
| 173 | + s5 -> putDebugLn# |
| 174 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#, Ptr d2#, Ptr d3#]) |
| 175 | + (# s5, (Dest d0#, Dest d1#, Dest d2#, Dest d3#) #) |
| 176 | + {-# INLINE gFill# #-} |
| 177 | + |
| 178 | +instance ( |
| 179 | + Generic a, |
| 180 | + repA ~ Rep a (), |
| 181 | + metaA ~ GDatatypeMetaOf repA, |
| 182 | + Datatype metaA, |
| 183 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 184 | + Constructor metaCtor, |
| 185 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 186 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 187 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 188 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 189 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 190 | + '( 'MetaSel f4 u4 ss4 ds4, t4)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 191 | + NotUnpacked ds0, |
| 192 | + NotUnpacked ds1, |
| 193 | + NotUnpacked ds2, |
| 194 | + NotUnpacked ds3, |
| 195 | + NotUnpacked ds4 |
| 196 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 197 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 198 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 199 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 200 | + '( 'MetaSel f4 u4 ss4 ds4, t4)]) a where |
| 201 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 202 | + -> (# State# RealWorld, (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4) #) |
| 203 | + gFill# c# m# d# s0 = |
| 204 | + case takeMVar# m# s0 of |
| 205 | + (# s1, () #) -> |
| 206 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 207 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 208 | + (# s3, pXInRegion# #) -> case getSlots5# xInRegion bH# bW# s3 of |
| 209 | + (# s4, (# d0#, d1#, d2#, d3#, d4# #) #) -> case putMVar# m# () s4 of |
| 210 | + s5 -> putDebugLn# |
| 211 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#, Ptr d2#, Ptr d3#, Ptr d4#]) |
| 212 | + (# s5, (Dest d0#, Dest d1#, Dest d2#, Dest d3#, Dest d4#) #) |
| 213 | + {-# INLINE gFill# #-} |
| 214 | + |
| 215 | +instance ( |
| 216 | + Generic a, |
| 217 | + repA ~ Rep a (), |
| 218 | + metaA ~ GDatatypeMetaOf repA, |
| 219 | + Datatype metaA, |
| 220 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 221 | + Constructor metaCtor, |
| 222 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 223 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 224 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 225 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 226 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 227 | + '( 'MetaSel f4 u4 ss4 ds4, t4), |
| 228 | + '( 'MetaSel f5 u5 ss5 ds5, t5)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 229 | + NotUnpacked ds0, |
| 230 | + NotUnpacked ds1, |
| 231 | + NotUnpacked ds2, |
| 232 | + NotUnpacked ds3, |
| 233 | + NotUnpacked ds4, |
| 234 | + NotUnpacked ds5 |
| 235 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 236 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 237 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 238 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 239 | + '( 'MetaSel f4 u4 ss4 ds4, t4), |
| 240 | + '( 'MetaSel f5 u5 ss5 ds5, t5)]) a where |
| 241 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 242 | + -> (# State# RealWorld, (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5) #) |
| 243 | + gFill# c# m# d# s0 = |
| 244 | + case takeMVar# m# s0 of |
| 245 | + (# s1, () #) -> |
| 246 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 247 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 248 | + (# s3, pXInRegion# #) -> case getSlots6# xInRegion bH# bW# s3 of |
| 249 | + (# s4, (# d0#, d1#, d2#, d3#, d4#, d5# #) #) -> case putMVar# m# () s4 of |
| 250 | + s5 -> putDebugLn# |
| 251 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#, Ptr d2#, Ptr d3#, Ptr d4#, Ptr d5#]) |
| 252 | + (# s5, (Dest d0#, Dest d1#, Dest d2#, Dest d3#, Dest d4#, Dest d5#) #) |
| 253 | + {-# INLINE gFill# #-} |
| 254 | + |
| 255 | +instance ( |
| 256 | + Generic a, |
| 257 | + repA ~ Rep a (), |
| 258 | + metaA ~ GDatatypeMetaOf repA, |
| 259 | + Datatype metaA, |
| 260 | + 'MetaCons symCtor fix hasSel ~ metaCtor, |
| 261 | + Constructor metaCtor, |
| 262 | + LiftedCtorToSymbol lCtor ~ symCtor, |
| 263 | + 'Just '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 264 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 265 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 266 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 267 | + '( 'MetaSel f4 u4 ss4 ds4, t4), |
| 268 | + '( 'MetaSel f5 u5 ss5 ds5, t5), |
| 269 | + '( 'MetaSel f6 u6 ss6 ds6, t6)]) ~ GSpecCtorOf symCtor (Rep a ()), |
| 270 | + NotUnpacked ds0, |
| 271 | + NotUnpacked ds1, |
| 272 | + NotUnpacked ds2, |
| 273 | + NotUnpacked ds3, |
| 274 | + NotUnpacked ds4, |
| 275 | + NotUnpacked ds5, |
| 276 | + NotUnpacked ds6 |
| 277 | + ) => GFill# lCtor '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), |
| 278 | + '( 'MetaSel f1 u1 ss1 ds1, t1), |
| 279 | + '( 'MetaSel f2 u2 ss2 ds2, t2), |
| 280 | + '( 'MetaSel f3 u3 ss3 ds3, t3), |
| 281 | + '( 'MetaSel f4 u4 ss4 ds4, t4), |
| 282 | + '( 'MetaSel f5 u5 ss5 ds5, t5), |
| 283 | + '( 'MetaSel f6 u6 ss6 ds6, t6)]) a where |
| 284 | + gFill# :: forall (r :: Type). Compact# -> MVar# RealWorld () -> Addr# -> State# RealWorld |
| 285 | + -> (# State# RealWorld, (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5, Dest r t6) #) |
| 286 | + gFill# c# m# d# s0 = |
| 287 | + case takeMVar# m# s0 of |
| 288 | + (# s1, () #) -> |
| 289 | + case compactAddHollow# c# (unsafeCoerceAddr (reifyInfoTablePtr# (# #) :: InfoTablePtrOf# lCtor)) s1 of |
| 290 | + (# s2, xInRegion, bH#, bW# #) -> case assign# d# xInRegion s2 of |
| 291 | + (# s3, pXInRegion# #) -> case getSlots7# xInRegion bH# bW# s3 of |
| 292 | + (# s4, (# d0#, d1#, d2#, d3#, d4#, d5#, d6# #) #) -> case putMVar# m# () s4 of |
| 293 | + s5 -> putDebugLn# |
| 294 | + (showFill (Ptr d#) (Ptr pXInRegion#) (conName @metaCtor undefined) [Ptr d0#, Ptr d1#, Ptr d2#, Ptr d3#, Ptr d4#, Ptr d5#, Ptr d6#]) |
| 295 | + (# s5, (Dest d0#, Dest d1#, Dest d2#, Dest d3#, Dest d4#, Dest d5#, Dest d6#) #) |
| 296 | + {-# INLINE gFill# #-} |
0 commit comments