| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
It's unsupported.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
| |
This reverts commit 991f285e681e8541632502d05d8a46de2d44b7bd.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
| |
This reverts commit ebf97ad146173afd9e094f4975aa33717ed3a11e.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
| |
This reverts commit 5dc74f385f1bbc9248ed950af255b946677c2ff9.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
| |
Spotted by Clang.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Based on a patch from Yuras Shumovich.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
Based on a patch from Stephen Blackheath.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
See comments for details.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
It's no longer used by Data.Unique, so there's no need to have it
in rts any more.
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Part of #7841
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
On Windows, we need to keep the DLL called libffi-6.dll (rather than
libffi.dll) or Windows can't find it.
|
|
|
|
| |
sed on OS X doesn't handle \+
|
| |
|
|
|
|
| |
Based on a patch from Peter Trommler
|
| |
|