Skip to content
Snippets Groups Projects
  1. Aug 08, 2022
  2. Jan 26, 2022
    • sheaf's avatar
      Levity-polymorphic arrays and mutable variables · e471a680
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This patch makes the following types levity-polymorphic in their
      last argument:
      
        - Array# a, SmallArray# a, Weak# b, StablePtr# a, StableName# a
      
        - MutableArray# s a, SmallMutableArray# s a,
          MutVar# s a, TVar# s a, MVar# s a, IOPort# s a
      
      The corresponding primops are also made levity-polymorphic, e.g.
      `newArray#`, `readArray#`, `writeMutVar#`, `writeIOPort#`, etc.
      
      Additionally, exception handling functions such as `catch#`, `raise#`,
      `maskAsyncExceptions#`,... are made levity/representation-polymorphic.
      
      Now that Array# and MutableArray# also work with unlifted types,
      we can simply re-define ArrayArray# and MutableArrayArray# in terms
      of them. This means that ArrayArray# and MutableArrayArray# are no
      longer primitive types, but simply unlifted newtypes around Array# and
      MutableArrayArray#.
      
      This completes the implementation of the Pointer Rep proposal
        https://github.com/ghc-proposals/ghc-proposals/pull/203
      
      Fixes #20911
      
      -------------------------
      Metric Increase:
          T12545
      -------------------------
      
      -------------------------
      Metric Decrease:
          T12545
      -------------------------
      e471a680
  3. Dec 22, 2021
    • Matthew Pickering's avatar
      testsuite: Remove reqlib modifier · 3ed90911
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The reqlib modifer was supposed to indicate that a test needed a certain
      library in order to work. If the library happened to be installed then
      the test would run as normal.
      
      However, CI has never run these tests as the packages have not been
      installed and we don't want out tests to depend on things which might
      get externally broken by updating the compiler.
      
      The new strategy is to run these tests in head.hackage, where the tests
      have been cabalised as well as possible. Some tests couldn't be
      transferred into the normal style testsuite but it's better than never
      running any of the reqlib tests. head.hackage!169
      
      A few submodules also had reqlib tests and have been updated to remove
      it.
      
      Closes #16264 #20032 #17764 #16561
      3ed90911
  4. Mar 03, 2021
    • Sylvain Henry's avatar
      Fix array and cleanup conversion primops (#19026) · d8dc0f96
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      The first change makes the array ones use the proper fixed-size types,
      which also means that just like before, they can be used without
      explicit conversions with the boxed sized types. (Before, it was Int# /
      Word# on both sides, now it is fixed sized on both sides).
      
      For the second change, don't use "extend" or "narrow" in some of the
      user-facing primops names for conversions.
      
        - Names like `narrowInt32#` are misleading when `Int` is 32-bits.
      
        - Names like `extendInt64#` are flat-out wrong when `Int is
          32-bits.
      
        - `narrow{Int,Word}<N>#` however map a type to itself, and so don't
          suffer from this problem. They are left as-is.
      
      These changes are batched together because Alex happend to use the array
      ops. We can only use released versions of Alex at this time, sadly, and
      I don't want to have to have a release thatwon't work for the final GHC
      9.2. So by combining these we get all the changes for Alex done at once.
      
      Bump hackage state in a few places, and also make that workflow slightly
      easier for the future.
      
      Bump minimum Alex version
      
      Bump Cabal, array, bytestring, containers, text, and binary submodules
      d8dc0f96
  5. Nov 26, 2020
    • Moritz Angermann's avatar
      [Sized Cmm] properly retain sizes. · be5d74ca
      Moritz Angermann authored and Marge Bot's avatar Marge Bot committed
      
      This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int#  with
      Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us
      with properly sized primitives in the codegenerator instead of pretending
      they are all full machine words.
      
      This came up when implementing darwinpcs for arm64.  The darwinpcs reqires
      us to pack function argugments in excess of registers on the stack.  While
      most procedure call standards (pcs) assume arguments are just passed in
      8 byte slots; and thus the caller does not know the exact signature to make
      the call, darwinpcs requires us to adhere to the prototype, and thus have
      the correct sizes.  If we specify CInt in the FFI call, it should correspond
      to the C int, and not just be Word sized, when it's only half the size.
      
      This does change the expected output of T16402 but the new result is no
      less correct as it eliminates the narrowing (instead of the `and` as was
      previously done).
      
      Bumps the array, bytestring, text, and binary submodules.
      
      Co-Authored-By: default avatarBen Gamari <ben@well-typed.com>
      
      Metric Increase:
          T13701
          T14697
      be5d74ca
  6. Jan 04, 2020
  7. Jun 20, 2016
  8. Feb 25, 2016
  9. Dec 23, 2015
    • Eric Seidel's avatar
      Allow CallStacks to be frozen · 380b25ea
      Eric Seidel authored
      This introduces "freezing," an operation which prevents further
      locations from being appended to a CallStack.  Library authors may want
      to prevent CallStacks from exposing implementation details, as a matter
      of hygiene. For example, in
      
      ```
      head [] = error "head: empty list"
      
      ghci> head []
      *** Exception: head: empty list
      CallStack (from implicit params):
        error, called at ...
      ```
      
      including the call-site of `error` in `head` is not strictly necessary
      as the error message already specifies clearly where the error came
      from.
      
      So we add a function `freezeCallStack` that wraps an existing CallStack,
      preventing further call-sites from being pushed onto it. In other words,
      
      ```
      pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack
      ```
      
      Now we can define `head` to not produce a CallStack at all
      
      ```
      head [] =
        let ?callStack = freezeCallStack emptyCallStack
        in error "head: empty list"
      
      ghci> head []
      *** Exception: head: empty list
      CallStack (from implicit params):
        error, called at ...
      ```
      
      ---
      
      1. We add the `freezeCallStack` and `emptyCallStack` and update the
         definition of `CallStack` to support this functionality.
      
      2. We add `errorWithoutStackTrace`, a variant of `error` that does not
         produce a stack trace, using this feature. I think this is a sensible
         wrapper function to provide in case users want it.
      
      3. We replace uses of `error` in base with `errorWithoutStackTrace`. The
         rationale is that base does not export any functions that use CallStacks
         (except for `error` and `undefined`) so there's no way for the stack
         traces (from Implicit CallStacks) to include user-defined functions.
         They'll only contain the call to `error` itself. As base already has a
         good habit of providing useful error messages that name the triggering
         function, the stack trace really just adds noise to the error. (I don't
         have a strong opinion on whether we should include this third commit,
         but the change was very mechanical so I thought I'd include it anyway in
         case there's interest)
      
      4. Updates tests in `array` and `stm` submodules
      
      Test Plan: ./validate, new test is T11049
      
      Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D1628
      
      GHC Trac Issues: #11049
      380b25ea
  10. Nov 13, 2015
    • Simon Marlow's avatar
      Make 'error' include the CCS call stack when profiled · 8988be85
      Simon Marlow authored
      Summary:
      The idea here is that this gives a more detailed stack trace in two
      cases:
      
      1. With `-prof` and `-fprof-auto`
      2. In GHCi (see #11047)
      
      Example, with an error inserted in nofib/shootout/binary-trees:
      
      ```
      $ ./Main 3
      Main: z
      CallStack (from ImplicitParams):
        error, called at Main.hs:67:29 in main:Main
      CallStack (from -prof):
        Main.check' (Main.hs:(67,1)-(68,82))
        Main.check (Main.hs:63:1-21)
        Main.stretch (Main.hs:32:35-57)
        Main.main.c (Main.hs:32:9-57)
        Main.main (Main.hs:(27,1)-(43,42))
        Main.CAF (<entire-module>)
      ```
      
      This doesn't quite obsolete +RTS -xc, which also attempts to display
      more information in the case when the error is in a CAF, but I'm
      exploring other solutions to that.
      
      Includes submodule updates.
      
      Test Plan: validate
      
      Reviewers: simonpj, ezyang, gridaphobe, bgamari, hvr, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1426
      8988be85
  11. Sep 22, 2015
  12. Jul 05, 2015
  13. Oct 21, 2014
  14. Feb 14, 2013
  15. Feb 11, 2013
  16. Dec 07, 2011
  17. Jul 20, 2011
Loading