This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 25 Mar, 2019 1 commit
    • Takenobu Tani's avatar
      Update Wiki URLs to point to GitLab · 3769e3a8
      Takenobu Tani authored
      This moves all URL references to Trac Wiki to their corresponding
      GitLab counterparts.
      
      This substitution is classified as follows:
      
      1. Automated substitution using sed with Ben's mapping rule [1]
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
      
      2. Manual substitution for URLs containing `#` index
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
      
      3. Manual substitution for strings starting with `Commentary`
          Old: Commentary/XxxYyy...
          New: commentary/xxx-yyy...
      
      See also !539
      
      [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
      3769e3a8
  2. 21 Mar, 2019 1 commit
  3. 17 Mar, 2019 1 commit
    • Ben Gamari's avatar
      ghc-heap: Introduce closureSize · cb61371e
      Ben Gamari authored
      This function allows the user to compute the (non-transitive) size of a
      heap object in words. The "closure" in the name is admittedly confusing
      but we are stuck with this nomenclature at this point.
      cb61371e
  4. 15 Mar, 2019 2 commits
    • Peter Trommler's avatar
      PPC NCG: Use liveness information in CmmCall · 83e09d3c
      Peter Trommler authored
      We make liveness information for global registers
      available on `JMP` and `BCTR`, which were the last instructions
      missing. With complete liveness information we do not need to
      reserve global registers in `freeReg` anymore. Moreover we
      assign R9 and R10 to callee saves registers.
      
      Cleanup by removing `Reg_Su`, which was unused, from `freeReg`
      and removing unused register definitions.
      
      The calculation of the number of floating point registers is too
      conservative. Just follow X86 and specify the constants directly.
      
      Overall on PowerPC this results in 0.3 % smaller code size in nofib
      while runtime is slightly better in some tests.
      83e09d3c
    • Ryan Scott's avatar
      Update Trac ticket URLs to point to GitLab · 610ec224
      Ryan Scott authored
      This moves all URL references to Trac tickets to their corresponding
      GitLab counterparts.
      610ec224
  5. 30 Jan, 2019 3 commits
    • Zejun Wu's avatar
      Add a RTS option -xp to load PIC object anywhere in address space · e29b1ee7
      Zejun Wu authored
      Summary:
      This re-applies {D5195} with fixes for i386:
      * Fix unused label warnings, see {D5230} or {D5273}
      * Fix a silly bug introduced by moving `#if`
      
      {P190}
      
      Add a RTS option -xp to load PIC object anywhere in address space. We do
      this by relaxing the requirement of <0x80000000 result of
      `mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
      
      We also need to change calls to `ocInit` and `ocGetNames` to avoid
      dangling pointers when the address of `oc->image` is changed by
      `ocAllocateSymbolExtra`.
      
      Test Plan:
      See {D5195}, also test under i386:
      
      ```
      $ uname -a
      Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
      20:45:30 CEST 2018 i686 GNU/Linux
      $ cd testsuite/tests/th/ && make test
      ...
      ```
      
      will run `./validate` on stacked diff.
      
      Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5289
      e29b1ee7
    • Ben Gamari's avatar
      Revert "Batch merge" · 172a5933
      Ben Gamari authored
      This reverts commit 76c8fd67.
      172a5933
    • Ben Gamari's avatar
      Batch merge · 76c8fd67
      Ben Gamari authored
      76c8fd67
  6. 16 Jan, 2019 3 commits
  7. 12 Jan, 2019 1 commit
  8. 03 Jan, 2019 1 commit
  9. 01 Jan, 2019 1 commit
    • Peter Trommler's avatar
      PPC NCG: Remove Darwin support · 374e4470
      Peter Trommler authored
      Support for Mac OS X on PowerPC has been dropped by Apple years ago. We
      follow suit and remove PowerPC support for Darwin.
      
      Fixes #16106.
      374e4470
  10. 11 Dec, 2018 1 commit
  11. 08 Dec, 2018 1 commit
    • Zejun Wu's avatar
      Remove redundant include of Rts.h in EventLogWriter.h · a24ab444
      Zejun Wu authored
      `EventLogWriter.h` doesn't use anything from `Rts.h`, the include is
      redundant. This include is ignored when we include
      
      ```
      Rts.h -> RtsAPI.h -> rts/EventLogWriter.h -> Rts.h
      ```
      
      but can can cause problem when we include `RtsApi.h` directly with
      errors like
      
      ```
      In file included from /usr/lib/ghc-8.6.2/include/RtsAPI.h:20:
      In file included from
      /usr/lib/ghc-8.6.2/include/rts/EventLogWriter.h:14:
      In file included from /usr/lib/ghc-8.6.2/include/Rts.h:185:
      /usr/lib/ghc-8.6.2/include/rts/storage/GC.h:187:29: error: unknown type
      name 'Capability'
      StgPtr  allocate          ( Capability *cap, W_ n );
      ```
      
      Test Plan: ./validate
      
      Reviewers: simonmar, bgamari, afarmer, erikd, alexbiehl
      
      Reviewed By: bgamari, alexbiehl
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5395
      a24ab444
  12. 16 Nov, 2018 1 commit
  13. 02 Nov, 2018 3 commits
    • Michal Terepeta's avatar
      Add Int8# and Word8# · 2c959a18
      Michal Terepeta authored
      This is the first step of implementing:
      https://github.com/ghc-proposals/ghc-proposals/pull/74
      
      The main highlights/changes:
      
          primops.txt.pp gets two new sections for two new primitive types for
          signed and unsigned 8-bit integers (Int8# and Word8 respectively) along
          with basic arithmetic and comparison operations. PrimRep/RuntimeRep get
          two new constructors for them. All of the primops translate into the
          existing MachOPs.
      
          For CmmCalls the codegen will now zero-extend the values at call
          site (so that they can be moved to the right register) and then truncate
          them back their original width.
      
          x86 native codegen needed some updates, since it wasn't able to deal
          with the new widths, but all the changes are quite localized. LLVM
          backend seems to just work.
      
      This is the second attempt at merging this, after the first attempt in
      D4475 had to be backed out due to regressions on i386.
      
      Bumps binary submodule.
      Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>
      
      Test Plan: ./validate (on both x86-{32,64})
      
      Reviewers: bgamari, hvr, goldfire, simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5258
      2c959a18
    • Ben Gamari's avatar
      rts: Add FALLTHROUGH macro · 6bb8aaa3
      Ben Gamari authored
      Instead of using the GCC `/* fallthrough */` syntax we now use the
      `__attribute__((fallthrough))`, which Phyx says should be more portable
      than the former.
      
      Also adds a missing fallthrough annotation in the MachO linker,
      fixing #14613.
      
      Reviewers: erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14613
      
      Differential Revision: https://phabricator.haskell.org/D5292
      6bb8aaa3
    • Ben Gamari's avatar
      rts: Allow output filename of eventlog to be given by command-line · 5f81952e
      Ben Gamari authored
      This introduces the `+RTS -ol` flag, which allows user to specify the
      destination file for eventlog output.
      
      Test Plan: Validate with included test
      
      Reviewers: simonmar, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5293
      5f81952e
  14. 31 Oct, 2018 1 commit
  15. 28 Oct, 2018 1 commit
  16. 15 Oct, 2018 1 commit
    • Zejun Wu's avatar
      Add a RTS option -xp to load PIC object anywhere in address space · 104599f3
      Zejun Wu authored
      Add a RTS option -xp to load PIC object anywhere in address space. We do
      this by relaxing the requirement of <0x80000000 result of
      `mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
      
      We also need to change calls to `ocInit` and `ocGetNames` to avoid
      dangling pointers when the address of `oc->image` is changed by
      `ocAllocateSymbolExtra`.
      
      Test Plan:
      ```
      $ uname -a
      Linux localhost 4.18.8-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 15 20:34:48
      UTC 2018 x86_64 GNU/Linux
      $ cat mk/build.mk
      DYNAMIC_GHC_PROGRAMS = NO
      DYNAMIC_BY_DEFAULT = NO
      
      GhcRTSWays += thr_debug
      EXTRA_HC_OPTS += -debug
      WAY_p_HC_OPTS += -fPIC -fexternal-dynamic-refs
      $ inplace/bin/ghc-stage2 --interactive -prof +RTS -xp
      GHCi, version 8.7.20180928: http://www.haskell.org/ghc/  :? for help
      ghc-stage2: R_X86_64_32 relocation out of range:
      ghczmprim_GHCziTypes_ZMZN_closure = 7f690bffab59
      Recompile
      /data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim
      -0.5.3.o with -fPIC -fexternal-dynamic-refs.
      ghc-stage2: unable to load package `ghc-prim-0.5.3'
      $ strace -f -e open,mmap inplace/bin/ghc-stage2 --interactive -prof
      -fexternal-interpreter  -opti+RTS -opti-xp
      ...
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas
      e-4.12.0.0_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84842000
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas
      e-4.12.0.0_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84676000
      ...
      Prelude> System.Posix.Process.getProcessID
      ...
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni
      x-2.7.2.2_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d60000
      [pid 1355283]
      open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni
      x-2.7.2.2_p.a", O_RDONLY) = 14
      [pid 1355283] mmap(NULL, 57344, PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d52000
      ...
      ```
      
      ```
      $ uname -a
      Darwin watashis-iMac.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug
      22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
      $ mv
      /Users/watashi/gao/ghc/libraries/integer-gmp/dist-install/build/HSintege
      r-gmp-1.0.2.0.o{,._DISABLE_GHC_ISSUE_15105}
      $ inplace/bin/ghc-stage2 --interactive  +RTS -xp
      GHCi, version 8.7.20181003: http://www.haskell.org/ghc/  :? for help
      Prelude> System.Posix.Process.getProcessID
      42791
      Prelude> Data.Set.fromList [1 .. 10]
      fromList [1,2,3,4,5,6,7,8,9,10]
      Prelude>
      Leaving GHCi.
      $ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter
      GHCi, version 8.7.20181003: http://www.haskell.org/ghc/  :? for help
      Prelude> System.Posix.Process.getProcessID
      42806
      Prelude> Data.Set.fromList [1 .. 10]
      fromList [1,2,3,4,5,6,7,8,9,10]
      Prelude>
      Leaving GHCi.
      ```
      
      Also test with something that used to hit the 2Gb limit and it loads
      and runs without problem.
      
      Reviewers: simonmar, bgamari, angerman, Phyx, hvr, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5195
      104599f3
  17. 01 Oct, 2018 1 commit
  18. 24 Sep, 2018 1 commit
  19. 21 Sep, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix slop zeroing for AP_STACK eager blackholes in debug build · 66c17293
      Ömer Sinan Ağacan authored
      As #15571 reports, eager blackholing breaks sanity checks as we can't
      zero the payload when eagerly blackholing (because we'll be using the
      payload after blackholing), but by the time we blackhole a previously
      eagerly blackholed object (in `threadPaused()`) we don't have the
      correct size information for the object (because the object's type
      becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero
      the slop.
      
      This problem can be solved for AP_STACK eager blackholing (which unlike
      eager blackholing in general, is not optional) by zeroing the payload
      after entering the stack. This patch implements this idea.
      
      Fixes #15571.
      
      Test Plan:
      Previously concprog001 when compiled and run with sanity checks
      
          ghc-stage2 Mult.hs -debug -rtsopts
          ./Mult +RTS -DS
      
      was failing with
      
          Mult: internal error: checkClosure: stack frame
              (GHC version 8.7.20180821 for x86_64_unknown_linux)
              Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      thic patch fixes this panic. The test still panics, but it runs for a while
      before panicking (instead of directly panicking as before), and the new problem
      seems unrelated:
      
          Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296
              (GHC version 8.7.20180919 for x86_64_unknown_linux)
              Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      The new problem will be fixed in another diff.
      
      I also tried slow validate (which requires D5164): this does not introduce any
      new failures.
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15571
      
      Differential Revision: https://phabricator.haskell.org/D5165
      66c17293
  20. 29 Aug, 2018 1 commit
    • David Feuer's avatar
      Finish stable split · f48e276a
      David Feuer authored
      Long ago, the stable name table and stable pointer tables were one.
      Now, they are separate, and have significantly different
      implementations. I believe the time has come to finish the split
      that began in #7674.
      
      * Divide `rts/Stable` into `rts/StableName` and `rts/StablePtr`.
      
      * Give each table its own mutex.
      
      * Add FFI functions `hs_lock_stable_ptr_table` and
      `hs_unlock_stable_ptr_table` and document them.
        These are intended to replace the previously undocumented
      `hs_lock_stable_tables` and `hs_lock_stable_tables`,
        which are now documented as deprecated synonyms.
      
      * Make `eqStableName#` use pointer equality instead of unnecessarily
      comparing stable name table indices.
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15555
      
      Differential Revision: https://phabricator.haskell.org/D5084
      f48e276a
  21. 21 Aug, 2018 1 commit
  22. 27 Jul, 2018 1 commit
  23. 15 Jul, 2018 1 commit
  24. 27 Jun, 2018 1 commit
  25. 17 Jun, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Use __FILE__ for Cmm assertion locations, fix #8619 · 008ea12d
      Ömer Sinan Ağacan authored
      It seems like we currently support string literals in Cmm, so we can use
      __LINE__ CPP macro in assertion macros. This improves error messages
      that previously looked like
      
          ASSERTION FAILED: file (null), line 1302
      
      (null) part now shows the actual file name.
      
      Also inline some single-use string literals in PrimOps.cmm.
      
      Reviewers: bgamari, simonmar, erikd
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4862
      008ea12d
  26. 05 Jun, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Rename some mutable closure types for consistency · 4075656e
      Ömer Sinan Ağacan authored
      SMALL_MUT_ARR_PTRS_FROZEN0 -> SMALL_MUT_ARR_PTRS_FROZEN_DIRTY
      SMALL_MUT_ARR_PTRS_FROZEN  -> SMALL_MUT_ARR_PTRS_FROZEN_CLEAN
      MUT_ARR_PTRS_FROZEN0       -> MUT_ARR_PTRS_FROZEN_DIRTY
      MUT_ARR_PTRS_FROZEN        -> MUT_ARR_PTRS_FROZEN_CLEAN
      
      Naming is now consistent with other CLEAR/DIRTY objects (MVAR, MUT_VAR,
      MUT_ARR_PTRS).
      
      (alternatively we could rename MVAR_DIRTY/MVAR_CLEAN etc. to MVAR0/MVAR)
      
      Removed a few comments in Scav.c about FROZEN0 being on the mut_list
      because it's now clear from the closure type.
      
      Reviewers: bgamari, simonmar, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4784
      4075656e
  27. 02 Jun, 2018 1 commit
  28. 28 May, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Update GHC.Stats docs · a5446c45
      Ömer Sinan Ağacan authored
      Make it clear that max_live_bytes is updated after a major GC whereas
      live_bytes is updated after all GCs (including minor collections) and
      considers data in uncollected generations as live.
      
      Reviewers: bgamari, simonmar, hvr
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4734
      a5446c45
  29. 23 May, 2018 1 commit
    • Ben Gamari's avatar
      Disable the SRT offset optimisation on MachO platforms · bf10456e
      Ben Gamari authored
      Unfortunately, this optimisation is infeasible on MachO platforms (e.g.
      Darwin) due to an object format limitation. Specifically, linking fails
      with errors of the form:
      
           error: unsupported relocation with subtraction expression, symbol
           '_integerzmgmp_GHCziIntegerziType_quotInteger_closure' can not be
           undefined in a subtraction expression
      
      Apparently MachO does not permit relocations' subtraction expressions to
      refer to undefined symbols. As far as I can tell this means that it is
      essentially impossible to express an offset between symbols living in
      different compilation units. This means that we lively can't use this
      optimisation on MachO platforms.
      
      Test Plan: Validate on Darwin
      
      Reviewers: simonmar, erikd
      
      Subscribers: rwbarton, thomie, carter, angerman
      
      GHC Trac Issues: #15169
      
      Differential Revision: https://phabricator.haskell.org/D4715
      bf10456e
  30. 20 May, 2018 1 commit
    • patrickdoc's avatar
      Add HeapView functionality · ec22f7dd
      patrickdoc authored
      This pulls parts of Joachim Breitner's ghc-heap-view library inside GHC.
      The bits added are the C hooks into the RTS and a basic Haskell wrapper
      to these C hooks. The main reason for these to be added to GHC proper
      is that the code needs to be kept in sync with the closure types
      defined by the RTS. It is expected that the version of HeapView shipped
      with GHC will always work with that version of GHC and that extra
      functionality can be layered on top with a library like ghc-heap-view
      distributed via Hackage.
      
      Test Plan: validate
      
      Reviewers: simonmar, hvr, nomeata, austin, Phyx, bgamari, erikd
      
      Reviewed By: bgamari
      
      Subscribers: carter, patrickdoc, tmcgilchrist, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3055
      ec22f7dd
  31. 17 May, 2018 1 commit
  32. 16 May, 2018 2 commits
    • Ben Gamari's avatar
      InfoTables: Fix #if uses introduced by D4634 · 3310f7f1
      Ben Gamari authored
      3310f7f1
    • Simon Marlow's avatar
      Merge FUN_STATIC closure with its SRT · 838b6903
      Simon Marlow authored
      Summary:
      The idea here is to save a little code size and some work in the GC,
      by collapsing FUN_STATIC closures and their SRTs.
      
      This is (4) in a series; see D4632 for more details.
      
      There's a tradeoff here: more complexity in the compiler in exchange
      for a modest code size reduction (probably around 0.5%).
      
      Results:
      * GHC binary itself (statically linked) is 1% smaller
      * -0.2% binary sizes in nofib (-0.5% module sizes)
      
      Full nofib results comparing D4634 with this: P177 (ignore runtimes,
      these aren't stable on my laptop)
      
      Test Plan: validate, nofib
      
      Reviewers: bgamari, niteria, simonpj, erikd
      
      Subscribers: thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4637
      838b6903