Skip to content
Snippets Groups Projects
  1. Mar 09, 2024
    • Ben Gamari's avatar
      rts: Refactor GHC.Stack.CloneStack.decode · 6519c9ad
      Ben Gamari authored
      Don't allocate a Ptr constructor per frame.
      6519c9ad
    • Ben Gamari's avatar
      rts: Lazily decode IPE tables · 6948e24d
      Ben Gamari authored
      Previously we would eagerly allocate `InfoTableEnt`s for each
      info table registered in the info table provenance map. However, this
      costs considerable memory and initialization time. Instead we now
      lazily decode these tables. This allows us to use one-third the memory
      *and* opens the door to taking advantage of sharing opportunities within
      a module.
      
      This required considerable reworking since lookupIPE now must be passed
      its result buffer.
      6948e24d
    • Ben Gamari's avatar
      base: Move internals of GHC.InfoProv into GHC.InfoProv.Types · e831ce31
      Ben Gamari authored
      Such that we can add new helpers into GHC.InfoProv.Types without
      breakage.
      e831ce31
  2. Mar 08, 2024
  3. Feb 27, 2024
  4. Feb 25, 2024
  5. Feb 08, 2024
    • Ben Gamari's avatar
      Move `base` to `ghc-internal` · 44f6557a
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we move a good deal of the implementation of `base` into a new
      package, `ghc-internal` such that it can be evolved independently
      from the user-visible interfaces of `base`.
      
      While we want to isolate implementation from interfaces, naturally, we
      would like to avoid turning `base` into a mere set of module re-exports.
      However, this is a non-trivial undertaking for a variety of reasons:
      
       * `base` contains numerous known-key and wired-in things, requiring
         corresponding changes in the compiler
      
       * `base` contains a significant amount of C code and corresponding
         autoconf logic, which is very fragile and difficult to break apart
      
       * `base` has numerous import cycles, which are currently dealt with via
         carefully balanced `hs-boot` files
      
       * We must not break existing users
      
      To accomplish this migration, I tried the following approaches:
      
      * [Split-GHC.Base]: Break apart the GHC.Base knot to allow incremental
        migration of modules into ghc-internal: this knot is simply too
        intertwined to be easily pulled apart, especially given the rather
        tricky import cycles that it contains)
      
      * [Move-Core]: Moving the "core" connected component of base (roughly
        150 modules) into ghc-internal. While the Haskell side of this seems
        tractable, the C dependencies are very subtle to break apart.
      
      * [Move-Incrementally]:
      
        1. Move all of base into ghc-internal
        2. Examine the module structure and begin moving obvious modules (e.g.
           leaves of the import graph) back into base
        3. Examine the modules remaining in ghc-internal, refactor as necessary
           to facilitate further moves
        4. Go to (2) iterate until the cost/benefit of further moves is
           insufficient to justify continuing
        5. Rename the modules moved into ghc-internal to ensure that they don't
           overlap with those in base
        6. For each module moved into ghc-internal, add a shim module to base
           with the declarations which should be exposed and any requisite
           Haddocks (thus guaranteeing that base will be insulated from changes
           in the export lists of modules in ghc-internal
      
      Here I am using the [Move-Incrementally] approach, which is empirically
      the least painful of the unpleasant options above
      
      Bumps haddock submodule.
      
      Metric Decrease:
          haddock.Cabal
          haddock.base
      Metric Increase:
          MultiComponentModulesRecomp
          T16875
          size_hello_artifact
      44f6557a
  6. Oct 12, 2023
  7. Oct 12, 2022
  8. Aug 02, 2022
  9. Jul 18, 2022
  10. Sep 23, 2021
    • Sven Tennie's avatar
      Use Info Table Provenances to decode cloned stack (#18163) · 29717ecb
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      Emit an Info Table Provenance Entry (IPE) for every stack represeted info table
      if -finfo-table-map is turned on.
      
      To decode a cloned stack, lookupIPE() is used. It provides a mapping between
      info tables and their source location.
      
      Please see these notes for details:
      
      - [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)]
      - [Mapping Info Tables to Source Positions]
      
      Metric Increase:
          T12545
      29717ecb
    • Sven Tennie's avatar
      Introduce stack snapshotting / cloning (#18741) · 6f7f5990
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      
      Add `StackSnapshot#` primitive type that represents a cloned stack (StgStack).
      The cloning interface consists of two functions, that clone either the treads
      own stack (cloneMyStack) or another threads stack (cloneThreadStack).
      
      The stack snapshot is offline/cold, i.e. it isn't evaluated any further. This is
      useful for analyses as it prevents concurrent modifications.
      
      For technical details, please see Note [Stack Cloning].
      
      Co-authored-by: default avatarBen Gamari <bgamari.foss@gmail.com>
      Co-authored-by: default avatarMatthew Pickering <matthewtpickering@gmail.com>
      6f7f5990
Loading