summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* ghc-prim: Don't allocate a thunk for each unpacked UTF-8 characterBen Gamari2017-07-211-12/+12
| | | | | | | While debugging #14005 I noticed that unpackCStringUtf8# was allocating a thunk for each Unicode character that it unpacked. This seems hardly worthwhile given that the thunk's closure will be at least three words, whereas the Char itself will be only two and requires only a bit of bit twiddling to construct.
* Debugging ghc-pkgBen Gamari2017-07-211-1/+1
|
* Add pretty-printer dependencyBen Gamari2017-07-201-0/+0
|
* Add text dependencyBen Gamari2017-07-201-0/+0
|
* base: Improve docs to clarify when finalizers may not be runAndrew Martin2017-07-191-0/+26
|
* Add Haddocks for Eq (STRef a) and Eq (IORef a)Adam Sandberg Eriksson2017-07-192-7/+7
| | | | | | | | | | Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3750
* Typeable: Always use UTF-8 string unpacking primitiveBen Gamari2017-07-181-6/+6
| | | | | | | | Reviewers: austin, hvr Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3734
* Typos in comments and explanation for unusused importsGabor Greif2017-07-181-5/+5
|
* [iserv] Fixing the word size for RemotePtr and toWordArrayBen Gamari2017-07-125-51/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we load non absolute pathed .so's this usually implies that we expect the system to have them in place already, and hence we should not need to ship them. Without the absolute path to the library, we are also unable to open and send said library. Thus we'll do library shipping only for libraries with absolute paths. When dealing with a host and target of different word size (say host hast 64bit, target has 32bit), we need to fix the RemotePtr size and the toWordArray function, as they are part of the iserv ResolvedBCO binary protocol. This needs to be word size independent. The choice for RemotePtr to 64bit was made to ensure we can store 64bit pointers when targeting 64bit. The choice for 32bit word arrays was made wrt. encoding/decoding on the potentially slower device. The efficient serialization code has been graciously provided by @bgamari. Reviewers: bgamari, simonmar, austin, hvr Reviewed By: bgamari Subscribers: Ericson2314, rwbarton, thomie, ryantrinkle Differential Revision: https://phabricator.haskell.org/D3443
* Remove redundant import; fix noteDavid Feuer2017-07-112-6/+3
| | | | | | | | | | | | | | | * Remove the redundant import of `Data.Maybe` from `GHC.Foreign`. * Fix the note in `GHC.Stack.Types` to give a correct explanation of the problematic cycle. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3722
* Fix minor typoIsmail2017-07-111-1/+1
|
* Add Template Haskell support for overloaded labelsMatthew Pickering2017-07-111-0/+6
| | | | | | | | | | Reviewers: RyanGlScott, austin, goldfire, bgamari Reviewed By: RyanGlScott, goldfire, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3715
* Parenthesize infix type names in data declarations in TH printerEugene Akentyev2017-07-111-3/+4
| | | | | | | | | | | | Previously datatype names were not paraenthesized (#13887). Reviewers: austin, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3717
* Optimize TimerManageralexbiehl2017-07-112-425/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After discussion with Kazu Yamamoto we decided to try two things: - replace current finger tree based priority queue through a radix tree based one (code is based on IntPSQ from the psqueues package) - after editing the timer queue: don't wake up the timer manager if the next scheduled time didn't change Benchmark results (number of TimerManager-Operations measured over 20 seconds, 5 runs each, higher is better) ``` -- baseline (timermanager action commented out) 28817088 28754681 27230541 27267441 28828815 -- ghc-8.3 with wake opt and new timer queue 18085502 17892831 18005256 18791301 17912456 -- ghc-8.3 with old timer queue 6982155 7003572 6834625 6979634 6664339 ``` Here is the benchmark code: ``` {-# LANGUAGE BangPatterns #-} module Main where import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.State.Strict import Data.Foldable import GHC.Event import System.Random import Control.Concurrent import Control.Exception import Data.IORef main :: IO () main = do let seed = 12345 :: Int nthreads = 1 :: Int benchTime = 20 :: Int -- in seconds timerManager <- getSystemTimerManager :: IO TimerManager let {- worker loop depending on the random generator it either * registers a new timeout * updates existing timeout * or cancels an existing timeout Additionally it keeps track of a counter tracking how often a timermanager was being modified. -} loop :: IORef Int -> [TimeoutKey] -> StdGen -> IO a loop !i !timeouts !rng = do let (rand0, rng') = next rng (rand1, rng'') = next rng' case rand0 `mod` 3 of 0 -> do timeout <- registerTimeout timerManager (rand1) (return ()) modifyIORef' i (+1) loop i (timeout:timeouts) rng'' 1 | (timeout:_) <- timeouts -> do updateTimeout timerManager timeout (rand1) modifyIORef' i (+1) loop i timeouts rng'' | otherwise -> loop i timeouts rng' 2 | (timeout:timeouts') <- timeouts -> do unregisterTimeout timerManager timeout modifyIORef' i (+1) loop i timeouts' rng' | otherwise -> loop i timeouts rng' _ -> loop i timeouts rng' let -- run a computation which can produce new -- random generators on demand withRng m = evalStateT m (mkStdGen seed) -- split a new random generator newRng = do (rng1, rng2) <- split <$> get put rng1 return rng2 counters <- withRng $ do replicateM nthreads $ do rng <- newRng ref <- liftIO (newIORef 0) liftIO $ forkIO (loop ref [] rng) return ref threadDelay (1000000 * benchTime) for_ counters $ \ref -> do n <- readIORef ref putStrLn (show n) ``` Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: Phyx, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3707
* Add Template Haskell support for overloaded labelsMatthew Pickering2017-07-114-1/+8
| | | | | | | | | | Reviewers: RyanGlScott, austin, goldfire, bgamari Reviewed By: RyanGlScott, goldfire, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3715
* ByteCodeGen: use depth instead of offsets in BCEnvMichal Terepeta2017-07-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on unfinished work in D38 started by Simon Marlow and is the first step for fixing #13825. (next step use byte-indexing for stack) The change boils down to adjusting everything in BCEnv by +1, which simplifies the code a bit. I've also looked into a weird stack adjustement that we did in `getIdValFromApStack` and moved it to `ByteCodeGen` to just keep everything in one place. I've left a comment about this. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: austin, hvr, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: simonmar, rwbarton, thomie GHC Trac Issues: #13825 Differential Revision: https://phabricator.haskell.org/D3708
* Fix Work Balance computation in RTS statsDouglas Wilson2017-07-111-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | An additional stat is tracked per gc: par_balanced_copied This is the the number of bytes copied by each gc thread under the balanced lmit, which is simply (copied_bytes / num_gc_threads). The stat is added to all the appropriate GC structures, so is visible in the eventlog and in GHC.Stats. A note is added explaining how work balance is computed. Remove some end of line whitespace Test Plan: ./validate experiment with the program attached to the ticket examine code changes carefully Reviewers: simonmar, austin, hvr, bgamari, erikd Reviewed By: simonmar Subscribers: Phyx, rwbarton, thomie GHC Trac Issues: #13830 Differential Revision: https://phabricator.haskell.org/D3658
* Bump array submodule to v0.5.2.0Ben Gamari2017-07-031-0/+0
|
* Fix paper link in MVar docs [ci skip]Ömer Sinan Ağacan2017-07-021-1/+1
|
* Typos in comments and manual [ci skip]Gabor Greif2017-06-281-1/+1
|
* base/inputReady: Whitespace cleanupBen Gamari2017-06-271-84/+84
|
* Hoopl: remove dependency on Hoopl packageMichal Terepeta2017-06-231-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This copies the subset of Hoopl's functionality needed by GHC to `cmm/Hoopl` and removes the dependency on the Hoopl package. The main motivation for this change is the confusing/noisy interface between GHC and Hoopl: - Hoopl has `Label` which is GHC's `BlockId` but different than GHC's `CLabel` - Hoopl has `Unique` which is different than GHC's `Unique` - Hoopl has `Unique{Map,Set}` which are different than GHC's `Uniq{FM,Set}` - GHC has its own specialized copy of `Dataflow`, so `cmm/Hoopl` is needed just to filter the exposed functions (filter out some of the Hoopl's and add the GHC ones) With this change, we'll be able to simplify this significantly. It'll also be much easier to do invasive changes (Hoopl is a public package on Hackage with users that depend on the current behavior) This should introduce no changes in functionality - it merely copies the relevant code. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: austin, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: simonpj, kavon, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3616
* Fix pretty-printing of zero-argument lambda expressionsRyan Scott2017-06-231-0/+1
| | | | | | | | | | | | | | | | | | Using Template Haskell, one can construct lambda expressions with no arguments. The pretty-printer isn't aware of this fact, however. This changes that. Test Plan: make test TEST=T13856 Reviewers: bgamari, austin, goldfire Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13856 Differential Revision: https://phabricator.haskell.org/D3664
* Add fixity declaration for Data.List.NonEmpty.!!Ryan Scott2017-06-232-0/+2
| | | | | | | | | | | | | | | We have `infixl 9 !!` for `Data.List.!!`, but not for `Data.List.NonEmpty.!!`. We ought to. Test Plan: Read it Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3666
* Fix typo5outh2017-06-221-1/+1
|
* base: Export Fingerprint accessors from Type.Reflection.UnsafeBen Gamari2017-06-211-2/+2
| | | | | | | | | | Reviewers: dfeuer, austin, hvr Reviewed By: dfeuer Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3660
* Don't expose fingerprints from Type.ReflectionDavid Feuer2017-06-191-3/+0
| | | | | | | | | | | | | | | | The `Fingerprint` type is not exported from any "public" module. It therefore seems quite strange that `Type.Reflection` exports functions for extracting fingerprints. Remove those exports. If fingerprints are eventually considered public, this can be reconsidered. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3643
* Add fixity declaration for :~~:Ryan Scott2017-06-191-1/+1
| | | | | | | | | | | | | We have one for `(:~:)`, but not for `(:~~:)`! Let's fix this oversight. Reviewers: bgamari, austin, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3657
* Typofix in Data.Type.Equality commentsRyan Scott2017-06-181-1/+1
|
* base: Validate input in setNumCapabilitiesBen Gamari2017-06-161-1/+3
| | | | | | | | | | | | Test Plan: validate Reviewers: austin, hvr, erikd, simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #13832 Differential Revision: https://phabricator.haskell.org/D3652
* Fix Haddock markupGabor Greif2017-06-141-1/+1
|
* GHC.Stats cleanupRyan Scott2017-06-021-4/+4
| | | | | | | | | | | | | | | | | This does two things: * The `RtsTime` type wasn't exported, but it is used as the type of several record fields. Let's export it and give it some documentation. * Neither `RTSStats` nor `GCDetails` have `Read` or `Show` instances, but `GCStats` does! Let's fix this discrepancy. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3625
* template-haskell: Properly escape StrTyLit docEric Mertens2017-05-271-1/+1
|
* base: Fix a few TODOs in Typeable.InternalBen Gamari2017-05-231-6/+4
| | | | | | | | | | | | | | Test Plan: Validate Reviewers: austin, hvr, dfeuer Reviewed By: dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #13746 Differential Revision: https://phabricator.haskell.org/D3605
* base: Explicitly mark Data.Either.{left,right} as INLINABLEBen Gamari2017-05-201-0/+2
| | | | | | | | | | | | | | Test Plan: read it Reviewers: dfeuer, austin, hvr, nomeata Reviewed By: dfeuer, nomeata Subscribers: nomeata, rwbarton, thomie GHC Trac Issues: #13689 Differential Revision: https://phabricator.haskell.org/D3576
* CNF: Silence pointer fix-up message unless gc debugging is enabledBen Gamari2017-05-201-1/+0
|
* Fix Haddock markupAlexey Vagarenko2017-05-191-1/+1
|
* Insert missing newlineFrederik Hanghøj Iversen2017-05-181-1/+1
|
* Update unix submoduleBen Gamari2017-05-141-0/+0
|
* Update autoconf scripts from correct sourceBen Gamari2017-05-114-142/+218
|
* Update autoconf scriptsBen Gamari2017-05-114-214/+138
|
* bump config.{guess,sub}Moritz Angermann2017-05-114-186/+362
| | | | | | | | | | | | | | | | | | | There is no new autoconf release, and it seems like there will unlikely be one <http://lists.gnu.org/archive/html/autoconf/2016-07/msg00017.html>. This will allow us to support <arch>-apple-ios properly. These have been taken from - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3558
* Bump Cabal submodule to the 2.0.0.0 tagBen Gamari2017-05-071-0/+0
|
* base: Fix documentation for forkIOWithUnmaskBen Gamari2017-05-071-1/+1
| | | | | forkIOUnmasked has been deprecated for several years now. Update reference to it. See #4858 and #5546.
* hpc: Output a legend at the top of output filesSantiago Munin2017-05-041-0/+0
| | | | | | | | | | | | Updates hpc submodule. Reviewers: austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #11799 Differential Revision: https://phabricator.haskell.org/D3465
* Fix comment for compact regionTakenobu Tani2017-05-042-3/+3
| | | | | | | | | | | | | | | | | | | There were old module names: * Data.Compact -> GHC.Compact * Data.Compact.Internal -> GHC.Compact This commit is for ghc-8.2 branch. Test Plan: build Reviewers: austin, bgamari, hvr, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3522
* Comments only, about Typeable/TypeRep/KindRepSimon Peyton Jones2017-05-041-1/+1
|
* Improve fixIODavid Feuer2017-05-031-7/+13
| | | | | | | | | | | | | | Use `unsafeDupableInterleaveIO` to avoid `noDuplicate` calls. Switch from `takeMVar` to `readMVar` as multiple entry with `takeMVar` would lock things up. Reviewers: austin, hvr, bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3494
* Bump array submoduleBen Gamari2017-05-011-0/+0
|
* Prefer #if defined to #ifdefBen Gamari2017-04-2834-155/+155
| | | | Our new CPP linter enforces this.