summaryrefslogtreecommitdiff
path: root/rts/Linker.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo in commentGabor Greif2013-09-241-1/+1
|
* Fix linker_unload now that we are running constructors in the linker (#8291)Simon Marlow2013-09-231-0/+49
| | | | | | | See also #5435. Now we have to remember the the StablePtrs that get created by the module initializer so that we can free them again in unloadObj().
* Add support for 512-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+3
|
* Add support for 256-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+3
|
* Add warning comment about Mach-O section name hack.Edward Z. Yang2013-09-171-0/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement ctors support for Linux.Edward Z. Yang2013-09-161-6/+21
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Run ctors initializers backwards, see #5435.Edward Z. Yang2013-09-151-5/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* add stg_MUT_VAR_CLEAN_info and stg_MUT_VAR_DIRTY_info to the symbol tableSimon Marlow2013-09-141-0/+2
|
* Implement __mod_init_func for Mach-O. Finishes support for init in #5435.Edward Z. Yang2013-09-131-24/+57
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement .ctor support for PEi386.Edward Z. Yang2013-09-131-5/+50
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement .init/.init_array support for ELF.Edward Z. Yang2013-09-131-0/+59
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Missing printf path format changeSimon Peyton Jones2013-09-131-1/+1
|
* Fix static GHCi build (#8270)Austin Seipp2013-09-131-0/+2
| | | | | | | | | | When Ryan merged in the atomics branch, he made atomic_inc and atomic_dec EXTERN_INLINE functions, meaning their definitions became part of object files in the non-threaded build, instead of being inlined. As a result, this broke the linker for static GHCi, since it couldn't properly resolve the now-externally defined functions. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add missing semicolon in rts/Linker.c (#8271)Jan Stolarek2013-09-121-8/+8
| | | | And remove some trailing whitespaces from that file.
* Windows: load eh_frame as rodata, fixes #8237Edward Z. Yang2013-09-051-0/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Ignore drectve sections, partially fixing #7056Edward Z. Yang2013-09-041-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix printf formats for pathchar on Windows (where it's wchar_t, not char)Simon Marlow2013-09-041-2/+0
|
* Merge branch 'master' into atomicsRyan Newton2013-08-311-35/+89
|\
| * Fix i386/Linux build.Austin Seipp2013-08-241-1/+4
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Fix build for i386/windows.Austin Seipp2013-08-231-2/+7
| | | | | | | | | | | | symbol_extras is only part of ObjectCode on certain platforms. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Strings and comments only: 'to to ' fixesGabor Greif2013-08-221-1/+1
| | | | | | | | I'd still prefer if a native english speaker would check them.
| * Remove DYNAMIC_GHC_PROGRAMS tests in the linkerSimon Marlow2013-08-221-18/+0
| | | | | | | | | | The linker is usable even when GHCi is dynamically linked. These tests make the linker_unload test fail.
| * Really unload object code when it is safe to do so (#8039)Simon Marlow2013-08-221-16/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next major GC after an unloadObj() will do a traversal of the heap to determine whether the object code can be removed from memory or not. We'll keep doing these until it is safe to remove the object code. In my experiments with GHCi, the objects get unloaded immediately, which is a good sign: we're not accidentally holding on to any references anywhere in the GHC data structures. Changes relative to the patch earlier posted on the ticket: - fix two memory leaks discovered with Valgrind, after testing with tests/rts/linker_unload.c
* | Add PrimOp fetchAddIntArray# plus supporting C function atomic_inc_by.Ryan Newton2013-08-211-0/+1
| |
* | Add PrimOp: casIntArray#. Modify casMutVar# for 'ticketed' style.Ryan Newton2013-08-211-0/+1
| |
* | add casArray# primop, similar to casMutVar# but for array elementsRyan Newton2013-08-211-0/+1
|/
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-161-0/+1
|
* Rename atomicReadMVar and friends to readMVar.Edward Z. Yang2013-07-121-3/+3
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement tryAtomicReadMVar#.Edward Z. Yang2013-07-101-0/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement atomicReadMVar, fixing #4001.Edward Z. Yang2013-07-091-0/+2
| | | | | | | | | 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>
* Allow multiple C finalizers to be attached to a Weak#Takano Akio2013-06-151-1/+1
| | | | | | | | | | | | | 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.
* Implement cardinality analysisSimon Peyton Jones2013-06-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused __2Int_encodeDoubleIan Lynagh2013-05-191-1/+0
|
* Move the genSym stuff from rts into compilerIan Lynagh2013-05-171-1/+0
| | | | | It's no longer used by Data.Unique, so there's no need to have it in rts any more.
* Handle sign bit when generating veneer for ARM Thumb branch relocationColin Watson2013-04-271-0/+1
|
* Add stg_sel_n_noupd_info symbols to Linker.cSimon Peyton Jones2013-04-221-6/+22
|
* added ticky counters for heap and stack checksNicolas Frisby2013-04-111-0/+2
|
* ticky enhancementsNicolas Frisby2013-03-291-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * the new StgCmmArgRep module breaks a dependency cycle; I also untabified it, but made no real changes * updated the documentation in the wiki and change the user guide to point there * moved the allocation enters for ticky and CCS to after the heap check * I left LDV where it was, which was before the heap check at least once, since I have no idea what it is * standardized all (active?) ticky alloc totals to bytes * in order to avoid double counting StgCmmLayout.adjustHpBackwards no longer bumps ALLOC_HEAP_ctr * I resurrected the SLOW_CALL counters * the new module StgCmmArgRep breaks cyclic dependency between Layout and Ticky (which the SLOW_CALL counters cause) * renamed them SLOW_CALL_fast_<pattern> and VERY_SLOW_CALL * added ALLOC_RTS_ctr and _tot ticky counters * eg allocation by Storage.c:allocate or a BUILD_PAP in stg_ap_*_info * resurrected ticky counters for ALLOC_THK, ALLOC_PAP, and ALLOC_PRIM * added -ticky and -DTICKY_TICKY in ways.mk for debug ways * added a ticky counter for total LNE entries * new flags for ticky: -ticky-allocd -ticky-dyn-thunk -ticky-LNE * all off by default * -ticky-allocd: tracks allocation *of* closure in addition to allocation *by* that closure * -ticky-dyn-thunk tracks dynamic thunks as if they were functions * -ticky-LNE tracks LNEs as if they were functions * updated the ticky report format, including making the argument categories (more?) accurate again * the printed name for things in the report include the unique of their ticky parent as well as if they are not top-level
* By default, use the dynamic way for programs in the GHC treeIan Lynagh2013-03-151-7/+7
| | | | | In particular, this means that GHCi will use DLLs, rather than loading object files itself.
* Separate StablePtr and StableName tables (#7674)Simon Marlow2013-02-141-2/+6
| | | | To improve performance of StablePtr.
* Added RTS hooks for the timer manager.Andreas Voellmy2013-02-111-0/+2
|
* Always pass vector values on the stack.Geoffrey Mainland2013-02-011-0/+3
| | | | | Vector values are now always passed on the stack. This isn't particularly efficient, but it will have to do for now.
* Patch for #7628: improve error message when mixing 32 and 64 bit images (on ↵Andy Adams-Moran2013-01-291-4/+8
| | | | Mac OS X)
* fix rts/Linker compilation issues on AMD64/Solaris platformSimon Marlow2013-01-231-0/+1
| | | | Submitted by: Karel Gardas <karel.gardas@centrum.cz>
* add enabled_capabilities (#7491)Simon Marlow2012-12-111-0/+1
|
* typoGabor Greif2012-11-231-2/+2
|
* Add a write barrier for TVAR closuresSimon Marlow2012-11-161-0/+3
| | | | | | | | | | This improves GC performance when there are a lot of TVars in the heap. For instance, a TChan with a lot of elements causes a massive GC drag without this patch. There's more to do - several other STM closure types don't have write barriers, so GC performance when there are a lot of threads blocked on STM isn't great. But fixing the problem for TVar is a good start.
* Fix a couple of format stringsIan Lynagh2012-10-261-2/+2
|
* Add a new traceMarker# primop for use in profiling outputDuncan Coutts2012-10-151-0/+1
| | | | | | | | | In time-based profiling visualisations (e.g. heap profiles and ThreadScope) it would be useful to be able to mark particular points in the execution and have those points in time marked in the visualisation. The traceMarker# primop currently emits an event into the eventlog. In principle it could be extended to do something in the heap profiling too.
* Keep the list of DLLs that we dlopenIan Lynagh2012-10-131-2/+50
| | | | | | | Unfortunately, dlsym finds the first symbol loaded, while when we reload a compiled module in GHCi it's the last symbol that we want. Therefore we remember the list of loaded DLLs ourselves and go through them in order.