summaryrefslogtreecommitdiff
path: root/rts
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in readMVar implementation: keep clean MVars clean.Edward Z. Yang2013-07-171-2/+2
| | | | | | | | | | The readMVar implementation had only partially implemented a micro-optimization which allows us to avoid adding an MVar to the mutable list if the MVar was not changed. However, this was not applied to the release method on the fast path, resulting in dirty MVars which were not added to the mutable list. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-162-2/+15
|
* Rename atomicReadMVar and friends to readMVar.Edward Z. Yang2013-07-123-18/+18
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement tryAtomicReadMVar#.Edward Z. Yang2013-07-102-0/+17
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Don't call dirty_MVAR on atomicReadMVar unless we change the MVar.Edward Z. Yang2013-07-101-4/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add LOCK_CLOSURE macro for use in C--, which inlines the capability check.Edward Z. Yang2013-07-101-48/+8
| | | | | | | | This patch also tweaks lockClosure to be INLINE_HEADER, so C-- clients don't accidentally use them and updates some other code which locks closures to do the capability check. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement atomicReadMVar, fixing #4001.Edward Z. Yang2013-07-0912-6/+122
| | | | | | | | | We add the invariant to the MVar blocked threads queue that threads blocked on an atomic read are always at the front of the queue. This invariant is easy to maintain, since takers are only ever added to the end of the queue. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix segfault with STM; fixes #8035. Patch from errge.Ian Lynagh2013-07-071-1/+13
|
* Fix build on Win64Ian Lynagh2013-07-021-11/+7
| | | | | | gcc thought that fourthFloating could be used without being defined. In actual fact it couldn't, but I've refactored the code so that it can now see this.
* Fix #7970, #2161, unfix #551Simon Marlow2013-07-021-48/+52
| | | | | | | | | | | Establish the reachability of threads before weak pointers. Hence a deadlocked thread can keep a weak pointer alive and prevent it from being finalized early. However, an reference from the finalizer of a weak pointer will no longer prevent a thread from being considered deadlocked (#551). To keep the thread alive in that situation you need to use a StablePtr. See comments on #7970 and in the code for more details.
* Fix dynlib paths in the RTS too; part of #7833Ian Lynagh2013-06-221-0/+1
|
* Ensure gc_type is StgWord8.Austin Seipp2013-06-211-1/+1
| | | | | | | Again, the range of gc_type is actually 1-3, which is technically outside the range of rtsBool. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Ensure gc_thread->wakeup is of type StgWord8.Austin Seipp2013-06-211-1/+1
| | | | | | | | | | rtsBool is defined to only have two inhabitants, which are true (1) and false (0) But the wakeup flag is set to 4 possible values, outside the range of rtsBool. This leads Clang to warn about tautological comparisons. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Don't use -finline-limit with Clang.Austin Seipp2013-06-211-0/+2
| | | | | | It's unsupported. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Initialize ptr to NULL to silence Clang warning.Austin Seipp2013-06-201-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix rts/package.conf.in ld-options for Clang.Austin Seipp2013-06-201-78/+78
| | | | | | | | | Now with less Mac-breakage. With this change, I can get a working stage1/stage2 compiler using Clang 3.4svn, which can be used to link working executables! Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Re-untabify rts/packages.conf.inAustin Seipp2013-06-191-25/+25
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Fix rts/packages.conf.in ld-options for clang."Austin Seipp2013-06-191-78/+78
| | | | | | This reverts commit 991f285e681e8541632502d05d8a46de2d44b7bd. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Untabify rts/packages.conf.in"Austin Seipp2013-06-191-25/+25
| | | | | | This reverts commit ebf97ad146173afd9e094f4975aa33717ed3a11e. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Actually fix rts/packages.conf.in ld-options."Austin Seipp2013-06-191-78/+78
| | | | | | This reverts commit 5dc74f385f1bbc9248ed950af255b946677c2ff9. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix typo in header guard.Austin Seipp2013-06-191-1/+1
| | | | | | Spotted by Clang. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Actually fix rts/packages.conf.in ld-options.Austin Seipp2013-06-181-78/+78
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Untabify rts/packages.conf.inAustin Seipp2013-06-181-25/+25
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix rts/packages.conf.in ld-options for clang.Austin Seipp2013-06-181-78/+78
| | | | | | | | Technically, '-u' is an ld option, not a compiler option, and clang considers this argument unused. Hence, we must explicitly forward this to the linker. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Optimise lockClosure when n_capabilities == 1; fixes #693Ian Lynagh2013-06-151-4/+24
| | | | Based on a patch from Yuras Shumovich.
* Whitespace and braces onlyIan Lynagh2013-06-151-4/+5
|
* Add braces for clarityIan Lynagh2013-06-151-1/+2
|
* Maintain per-generation lists of weak pointers (#7847)Takano Akio2013-06-159-109/+157
|
* Check for a weak pointer being dead before we do any allocation for itIan Lynagh2013-06-151-8/+8
|
* Allow multiple C finalizers to be attached to a Weak#Takano Akio2013-06-157-88/+84
| | | | | | | | | | | | | The commit replaces mkWeakForeignEnv# with addCFinalizerToWeak#. This new primop mutates an existing Weak# object and adds a new C finalizer to it. This change removes an invariant in MarkWeak.c, namely that the relative order of Weak# objects in the list needs to be preserved across GC. This makes it easier to split the list into per-generation structures. The patch also removes a race condition between two threads calling finalizeWeak# on the same WEAK object at that same time.
* Optimization for takeMVar/putMVar when MVar left empty; fixes #7923Ian Lynagh2013-06-151-20/+29
| | | | | | | | We only need to apply the write barrier to an MVar when it acquires a reference to live data; when the MVar is left empty in the case of a takeMVar/putMVar, we can save a memory reference. Patch from Edward Z. Yang.
* Cleaning fixes, and other build system tweaks; part of #7941Ian Lynagh2013-06-141-6/+6
|
* Fix a commentIan Lynagh2013-06-091-3/+1
|
* Whitespace onlyIan Lynagh2013-06-091-124/+124
|
* use libffi for iOS adjustors; fixes #7718Ian Lynagh2013-06-081-4/+54
| | | | Based on a patch from Stephen Blackheath.
* Implement cardinality analysisSimon Peyton Jones2013-06-062-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This major patch implements the cardinality analysis described in our paper "Higher order cardinality analysis". It is joint work with Ilya Sergey and Dimitrios Vytiniotis. The basic is augment the absence-analysis part of the demand analyser so that it can tell when something is used never at most once some other way The "at most once" information is used a) to enable transformations, and in particular to identify one-shot lambdas b) to allow updates on thunks to be omitted. There are two new flags, mainly there so you can do performance comparisons: -fkill-absence stops GHC doing absence analysis at all -fkill-one-shot stops GHC spotting one-shot lambdas and single-entry thunks The big changes are: * The Demand type is substantially refactored. In particular the UseDmd is factored as follows data UseDmd = UCall Count UseDmd | UProd [MaybeUsed] | UHead | Used data MaybeUsed = Abs | Use Count UseDmd data Count = One | Many Notice that UCall recurses straight to UseDmd, whereas UProd goes via MaybeUsed. The "Count" embodies the "at most once" or "many" idea. * The demand analyser itself was refactored a lot * The previously ad-hoc stuff in the occurrence analyser for foldr and build goes away entirely. Before if we had build (\cn -> ...x... ) then the "\cn" was hackily made one-shot (by spotting 'build' as special. That's essential to allow x to be inlined. Now the occurrence analyser propagates info gotten from 'build's stricness signature (so build isn't special); and that strictness sig is in turn derived entirely automatically. Much nicer! * The ticky stuff is improved to count single-entry thunks separately. One shortcoming is that there is no DEBUG way to spot if an allegedly-single-entry thunk is acually entered more than once. It would not be hard to generate a bit of code to check for this, and it would be reassuring. But it's fiddly and I have not done it. Despite all this fuss, the performance numbers are rather under-whelming. See the paper for more discussion. nucleic2 -0.8% -10.9% 0.10 0.10 +0.0% sphere -0.7% -1.5% 0.08 0.08 +0.0% -------------------------------------------------------------------------------- Min -4.7% -10.9% -9.3% -9.3% -50.0% Max -0.4% +0.5% +2.2% +2.3% +7.4% Geometric Mean -0.8% -0.2% -1.3% -1.3% -1.8% I don't quite know how much credence to place in the runtime changes, but movement seems generally in the right direction.
* Fix crash with large objects (#7919)Simon Marlow2013-05-241-14/+44
| | | | See comments for details.
* Fix a problem caused by very large objects (#7919)Simon Marlow2013-05-211-5/+12
| | | | | | As far as I can tell the bug should be harmless, apart from the failing assertion. Since the ticket reported crashes, there might be problems elsewhere that aren't triggered by this test case.
* Expose __word_encode{Float,Double}; fixes integer-simple buildIan Lynagh2013-05-191-3/+1
|
* Remove unused __2Int_encodeDoubleIan Lynagh2013-05-193-25/+0
|
* Move the genSym stuff from rts into compilerIan Lynagh2013-05-172-21/+0
| | | | | It's no longer used by Data.Unique, so there's no need to have it in rts any more.
* Kill dead code.Austin Seipp2013-05-125-993/+114
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Make sure the RTS is built, even when no programs are being built with stage1Ian Lynagh2013-05-101-1/+1
| | | | Part of #7841
* rts_checkSchedStatus: exit the thread, not the process, when InterruptedSimon Marlow2013-05-101-1/+10
| | | | | | | | | This means that when the process is shutting down, if we have calls to foreign exports in progress, they get forcibly terminated as before, but now they only shut down the calling thread rather than the whole process (with -threaded). This came up in a discussion started by Akio Takano on ghc-users.
* Generate dependencies for .cmm files properlyIan Lynagh2013-05-091-3/+6
|
* Fix the name of libffiIan Lynagh2013-05-091-12/+13
| | | | | On Windows, we need to keep the DLL called libffi-6.dll (rather than libffi.dll) or Windows can't find it.
* Fix build on OS XIan Lynagh2013-04-301-2/+4
| | | | sed on OS X doesn't handle \+
* Fix buildIan Lynagh2013-04-281-2/+2
|
* Add -L flags to libs.depend (fixes #7465)Ian Lynagh2013-04-281-1/+3
| | | | Based on a patch from Peter Trommler
* Tidy up some build system codeIan Lynagh2013-04-281-2/+2
|