summaryrefslogtreecommitdiff
path: root/rts/Linker.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* When dynamic-by-default, don't use the GHCi linkerIan Lynagh2012-10-131-0/+18
| | | | We instead link objects into a temporary DLL and dlopen that
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-289/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change here is that the Cmm parser now allows high-level cmm code with argument-passing and function calls. For example: foo ( gcptr a, bits32 b ) { if (b > 0) { // we can make tail calls passing arguments: jump stg_ap_0_fast(a); } return (x,y); } More details on the new cmm syntax are in Note [Syntax of .cmm files] in CmmParse.y. The old syntax is still more-or-less supported for those occasional code fragments that really need to explicitly manipulate the stack. However there are a couple of differences: it is now obligatory to give a list of live GlobalRegs on every jump, e.g. jump %ENTRY_CODE(Sp(0)) [R1]; Again, more details in Note [Syntax of .cmm files]. I have rewritten most of the .cmm files in the RTS into the new syntax, except for AutoApply.cmm which is generated by the genapply program: this file could be generated in the new syntax instead and would probably be better off for it, but I ran out of enthusiasm. Some other changes in this batch: - The PrimOp calling convention is gone, primops now use the ordinary NativeNodeCall convention. This means that primops and "foreign import prim" code must be written in high-level cmm, but they can now take more than 10 arguments. - CmmSink now does constant-folding (should fix #7219) - .cmm files now go through the cmmPipeline, and as a result we generate better code in many cases. All the object files generated for the RTS .cmm files are now smaller. Performance should be better too, but I haven't measured it yet. - RET_DYN frames are removed from the RTS, lots of code goes away - we now have some more canned GC points to cover unboxed-tuples with 2-4 pointers, which will reduce code size a little.
* More OS X build fixesIan Lynagh2012-09-141-2/+2
|
* Deprecate lnat, and use StgWord insteadSimon Marlow2012-09-071-4/+4
| | | | | | | | | | | | lnat was originally "long unsigned int" but we were using it when we wanted a 64-bit type on a 64-bit machine. This broke on Windows x64, where long == int == 32 bits. Using types of unspecified size is bad, but what we really wanted was a type with N bits on an N-bit machine. StgWord is exactly that. lnat was mentioned in some APIs that clients might be using (e.g. StackOverflowHook()), so we leave it defined but with a comment to say that it's deprecated.
* OS X: use mmap() instead of malloc for allocating the bss (#7040)Simon Marlow2012-08-211-0/+5
|
* add X86_64_GOTTPOFF relocation for errnoSimon Marlow2012-08-211-0/+25
| | | | Submitted by: Markus Pfeiffer <markus.pfeiffer@morphism.de> on cvs-ghc
* Export startProfTimer and stopProfTimer symbols.Paolo Capriotti2012-08-201-2/+3
| | | | This fixes unresolved symbols error when dynamically linking base.
* Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-08-131-4/+33
|\
| * Fix GHCi segfault during startup on linux-powerpc (#2972).Erik de Castro Lopo2012-08-131-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slightly modified version of a patch from Ben Collins <bcollins@ubuntu.com> who did the final debugging that showed the segfault was being caused the memory protection mechanism. Due to the requirement of "jump islands" to handle 24 bit relative jump offsets, GHCi on PowerPC did not use mmap to load object files like the other architectures. Instead, it allocated memory using malloc and fread to load the object code. However there is a quirk in the GNU libc malloc implementation. For memory regions over certain size (dynamic and configurable), malloc will use mmap to obtain the required memory instead of sbrk and malloc's call to mmap sets the memory readable and writable, but not executable. That means when GHCi loads code into a memory region that was mmapped instead of malloc-ed and tries to execute it we get a segfault. This solution drops the malloc/fread object loading in favour of using mmap and then puts the jump island for each object code module at the end of the mmaped region for that object. This patch may also be a solution on other ELF based powerpc systems but does not work on darwin-powerpc.
* | Follow RTS symbol changes in Linker.cIan Lynagh2012-08-101-0/+2
|/
* Fix compile on linux-powerpc64. (#7084).Erik de Castro Lopo2012-07-311-0/+2
|