summaryrefslogtreecommitdiff
path: root/compiler/utils/FastString.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Delete all /* ! __GLASGOW_HASKELL__ */ codeThomas Miedema2014-09-231-8/+0
| | | | | | | | | | | | | | | | | Summary: ``` git grep -l '\(#ifdef \|#if defined\)(\?__GLASGOW_HASKELL__)\?' ``` Test Plan: validate Reviewers: rwbarton, hvr, austin Reviewed By: rwbarton, hvr, austin Subscribers: rwbarton, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D218
* Return nBytes instead of nextAddr from utf8DecodeCharThomas Miedema2014-09-161-2/+1
| | | | | | | | | | | | | | | | | | | | | Summary: While researching D176, I came across the following simplification opportunity: Not all functions that call utf8DecodeChar actually need the address of the next char. And some need the 'number of bytes' read. So returning nBytes instead of nextAddr should save a few addition and subtraction operations, and makes the code a bit simpler. Test Plan: it validates Reviewers: simonmar, ezyang, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D179
* Make mkFastStringByteString pure and fix up usesDuncan Coutts2014-08-291-7/+8
| | | | It's morally pure, and we'll need it in a pure context.
* Give the Unique generated by strings a tag '$', fixes #9413.Edward Z. Yang2014-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we allocated uniques for strings starting at zero, which means the tag bits in the unique are zero, which means that printing a Unique for a string will start with a null byte. This is bad. So instead, start our numbering with the tag byte as '$' (as in $tring). This is hard coded so we don't have to worry about the optimizer reducing the expression. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: hvr, simonmar, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D123 GHC Trac Issues: #9413
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix Haddock formattingMateusz Kowalczyk2014-02-241-11/+13
|
* Placate clang (#8444, #8445)Austin Seipp2013-10-251-2/+2
| | | | | | | | Once again the whitespace rules (and the rules concerning expansion of tokens) have bitten us. Authored-by: Authored-by: Luke Iannini <lukexi@me.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Restore old names of comparison primopsJan Stolarek2013-09-181-4/+4
| | | | | | | | | | | | In 6579a6c we removed existing comparison primops and introduced new ones returning Int# instead of Bool. This commit (and associated commits in array, base, dph, ghc-prim, integer-gmp, integer-simple, primitive, testsuite and template-haskell) restores old names of primops. This allows us to keep our API cleaner at the price of not having backwards compatibility. This patch also temporalily disables fix for #8317 (optimization of tagToEnum# at Core level). We need to fix #8326 first, otherwise our primops code will be very slow.
* Trailing whitespacesJan Stolarek2013-09-181-3/+3
|
* FastString: make the string table thread-safePatrick Palka2013-08-261-86/+102
| | | | | While we're at it, consolidate duplicate code into a helper function and strictify a few arguments.
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-161-7/+60
|
* This reverts commit 163de25813d12764aa5ded1666af7c06fee0d67e and commit ↵Nicolas Frisby2013-07-161-25/+2
| | | | 279ac9f66a83203448b279ea478b2cc1dafbd35d.
* copy the plugin's FastStringTable changes back into the host compilerNicolas Frisby2013-07-041-2/+12
|
* include FastString.string_table in CoreMonad.reinitializeGlobalsNicolas Frisby2013-07-031-1/+14
|
* Remove some __HADDOCK__ CPPIan Lynagh2013-04-091-2/+0
| | | | I think these are all redundant, now that haddock uses the GHC API
* Rename remaining FastBytes usages to ByteStringIan Lynagh2012-12-141-17/+14
|
* Remove the trivial mkFastStringFastBytes wrapperIan Lynagh2012-12-141-5/+2
|
* Use ByteString rather than FastBytes in BinaryIan Lynagh2012-12-141-19/+1
|
* Remove a couple more FastBytes functionsIan Lynagh2012-12-141-7/+4
|
* Use BS.pack instead of mkFastBytesByteListIan Lynagh2012-12-141-10/+0
|
* Inline some FastBytes/ByteString wrappersIan Lynagh2012-12-141-16/+3
| | | | Working towards removing FastBytes
* Make FastBytes a synonym for ByteStringIan Lynagh2012-12-131-88/+70
| | | | | | | | | | | A step on the way to getting rid of FastBytes slow nofib Compile times look like: -1 s.d. -2.4% +1 s.d. +3.4% Average +0.4% but looking at the times for the longer-running compilations I think the change is just noise.
* Use ByteString rather than FastBytes inside FastZStringIan Lynagh2012-12-121-10/+12
| | | | | | | Slow nofib Compile Times difference looks like just noise: -1 s.d. -2.9% +1 s.d. +2.9% Average -0.1%
* GHC 7.4 is now required for building HEADIan Lynagh2012-07-201-4/+0
|
* Small refactoring for FastZStringsIan Lynagh2012-07-151-2/+23
|
* Define FastString on top of FastBytesIan Lynagh2012-07-151-16/+15
| | | | | | Although we currently break the abstraction a lot in the FastString operations, this is a step towards ultimately being able to replace FastBytes with ByteString.
* Rename a variable to avoid name conflicts in haddockIan Lynagh2012-07-151-1/+1
|
* Small refactoringIan Lynagh2012-07-151-4/+1
|
* Add a separate FastZString typeIan Lynagh2012-07-151-119/+49
| | | | | | | | | FastStrings are now always UTF8-encoded. There's no StringTable for FastZString, but I don't think one is needed. We only ever make a FastZString by running zEncodeFS on a FastString, and the FastStrings are shared via the FastString StringTable, so we get the same FastZString from the IORef.
* Redefine appendFS in terms of appendFBIan Lynagh2012-07-141-12/+4
| | | | | | I think the old definition had a bug, although it probably never actually bit us: It used lengthFS to work out how large the arguments where, but lengthFS returns the number of characters, not bytes.
* HsStringPrim now contains FastBytes, not FastStringIan Lynagh2012-07-141-1/+19
|
* Implement FastBytes, and use it for MachStrIan Lynagh2012-07-141-4/+71
| | | | | | | | | | | | | This is a first step on the way to refactoring the FastString type. FastBytes currently has no unique, mainly because there isn't currently a nice way to produce them in Binary. Also, we don't currently do the "Dictionary" thing with FastBytes in Binary. I'm not sure whether this is important. We can change both decisions later, but in the meantime this gets the refactoring underway.
* Remove a redundant importIan Lynagh2012-06-161-1/+0
|
* Remove a workaround for building with GHC 6.9Ian Lynagh2012-06-161-4/+0
|
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-0/+1
|
* SafeHaskell: Make base GHC.* modules untrustedDavid Terei2011-06-171-3/+2
|
* SafeHaskell: Fix imports of base when base unsafeDavid Terei2011-06-171-1/+2
|
* SafeHaskell: Fix validation errors when Safe base used.David Terei2011-06-171-0/+5
|
* SafeHaskell: Even more fixing to work with safe baseDavid Terei2011-06-171-1/+1
|
* SafeHaskell: Update to work with safe baseDavid Terei2011-06-171-1/+1
|
* Remove code that is dead now that we need >= 6.12 to buildIan Lynagh2010-12-151-4/+0
|
* Add LANGUAGE BangPatterns to modules that use themsimonpj@microsoft.com2010-11-121-0/+1
|
* avoid Foreign.unsafePerformIORoss Paterson2010-09-091-1/+1
|
* Add Data and Typeable instances to HsSynDavid Waern2010-03-301-1/+9
| | | | | The instances (and deriving declarations) have been taken from the ghc-syb package.
* a faster appendFSich@christoph-bauer.net2010-02-271-1/+12
|
* Rolling back: Make FastString thread-safe.Simon Marlow2009-12-311-45/+84
| | | | | | | | | | This patch was the cause of the compile-time performance regression in #3796. My guess is that it is due to the use of unsafePerformIO which traverses the stack up to the first update frame, and perhaps we have a deep stack when reading the dictionary from a .hi file. In any case, since we're not relying on thread safety for FastStrings, I think the safest thing to do is back this out until we can investigate further.
* Make FastString thread-safe.Thomas Schilling2009-08-241-84/+45
| | | | | | | | | This is needed both for per-session parallelism and for allowing multiple concurrent sessions in the same process. With the help of atomicModifyIORef and unsafePerformIO it is also quite fast--an MVar would most likely be slower. On a full compilation of Cabal's head branch it was about 1-2 percent slower, but then overall compilation times varied by about 4 percent, so I think it's worth it.
* Changes for the new IO library, mainly base-package modules moving aroundSimon Marlow2009-05-291-1/+6
|
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-241-3/+3
| | | | | For now we only get a warning, rather than an error, because the alex and happy templates don't follow the new rules yet.
* Document FastString and rename strLength to lengthLSMax Bolingbroke2008-07-311-29/+35
|