summaryrefslogtreecommitdiff
path: root/ghc/includes/ClosureMacros.h
Commit message (Collapse)AuthorAgeFilesLines
* Reorganisation of the source treeSimon Marlow2006-04-071-198/+0
| | | | | | | | | | | | | | | Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.
* [project @ 2005-04-22 09:32:39 by simonmar]simonmar2005-04-221-15/+20
| | | | | | | SMP: the rest of the changes to support safe thunk entry & updates. I thought the compiler changes were independent, but I ended up breaking the HEAD, so I'll have to commit the rest. non-SMP compilation should not be affected.
* [project @ 2005-03-27 13:41:13 by panne]panne2005-03-271-1/+1
| | | | | | | | | | * Some preprocessors don't like the C99/C++ '//' comments after a directive, so use '/* */' instead. For consistency, a lot of '//' in the include files were converted, too. * UnDOSified libraries/base/cbits/runProcess.c. * My favourite sport: Killed $Id$s.
* [project @ 2005-02-10 13:01:52 by simonmar]simonmar2005-02-101-8/+1
| | | | | | | | | | | | | | | | | | | | | | | GC changes: instead of threading old-generation mutable lists through objects in the heap, keep it in a separate flat array. This has some advantages: - the IND_OLDGEN object is now only 2 words, so the minimum size of a THUNK is now 2 words instead of 3. This saves some amount of allocation (about 2% on average according to my measurements), and is more friendly to the cache by squashing objects together more. - keeping the mutable list separate from the IND object will be necessary for our multiprocessor implementation. - removing the mut_link field makes the layout of some objects more uniform, leading to less complexity and special cases. - I also unified the two mutable lists (mut_once_list and mut_list) into a single mutable list, which lead to more simplifications in the GC.
* [project @ 2004-08-13 13:04:50 by simonmar]simonmar2004-08-131-57/+11
| | | | Merge backend-hacking-branch onto HEAD. Yay!
* [project @ 2003-11-12 17:27:00 by sof]sof2003-11-121-3/+3
| | | | | | | | | | | | Tidy up a couple of unportable coding issues: - conditionally use empty structs. - use GNU attributes only if supported. - 'long long' usage - use of 'inline' in declarations and definitions. Upshot of these changes is that MSVC is now capable of compiling the non-.hc portions of the RTS.
* [project @ 2003-06-30 14:17:02 by simonmar]simonmar2003-06-301-1/+8
| | | | comments only.
* [project @ 2003-05-14 09:13:52 by simonmar]simonmar2003-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the way SRTs are represented: Previously, the SRT associated with a function or thunk would be a sub-list of the enclosing top-level function's SRT. But this approach can lead to lots of duplication: if a CAF is referenced in several different thunks, then it may appear several times in the SRT. Let-no-escapes compound the problem, because the occurrence of a let-no-escape-bound variable would expand to all the CAFs referred to by the let-no-escape. The new way is to describe the SRT associated with a function or thunk as a (pointer+offset,bitmap) pair, where the pointer+offset points into some SRT table (the enclosing function's SRT), and the bitmap indicates which entries in this table are "live" for this closure. The bitmap is stored in the 16 bits previously used for the length field, but this rarely overflows. When it does overflow, we store the bitmap externally in a new "SRT descriptor". Now the enclosing SRT can be a set, hence eliminating the duplicates. Also, we now have one SRT per top-level function in a recursive group, where previously we used to have one SRT for the whole group. This helps keep the size of SRTs down. Bottom line: very little difference most of the time. GHC itself got slightly smaller. One bad case of a module in GHC which had a huge SRT has gone away. While I was in the area: - Several parts of the back-end require bitmaps. Functions for creating bitmaps are now centralised in the Bitmap module. - We were trying to be independent of word-size in a couple of places in the back end, but we've now abandoned that strategy so I simplified things a bit.
* [project @ 2002-12-11 15:36:20 by simonmar]simonmar2002-12-111-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge the eval-apply-branch on to the HEAD ------------------------------------------ This is a change to GHC's evaluation model in order to ultimately make GHC more portable and to reduce complexity in some areas. At some point we'll update the commentary to describe the new state of the RTS. Pending that, the highlights of this change are: - No more Su. The Su register is gone, update frames are one word smaller. - Slow-entry points and arg checks are gone. Unknown function calls are handled by automatically-generated RTS entry points (AutoApply.hc, generated by the program in utils/genapply). - The stack layout is stricter: there are no "pending arguments" on the stack any more, the stack is always strictly a sequence of stack frames. This means that there's no need for LOOKS_LIKE_GHC_INFO() or LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know how to find the boundary between the text and data segments (BIG WIN!). - A couple of nasty hacks in the mangler caused by the neet to identify closure ptrs vs. info tables have gone away. - Info tables are a bit more complicated. See InfoTables.h for the details. - As a side effect, GHCi can now deal with polymorphic seq. Some bugs in GHCi which affected primitives and unboxed tuples are now fixed. - Binary sizes are reduced by about 7% on x86. Performance is roughly similar, some programs get faster while some get slower. I've seen GHCi perform worse on some examples, but haven't investigated further yet (GHCi performance *should* be about the same or better in theory). - Internally the code generator is rather better organised. I've moved info-table generation from the NCG into the main codeGen where it is shared with the C back-end; info tables are now emitted as arrays of words in both back-ends. The NCG is one step closer to being able to support profiling. This has all been fairly thoroughly tested, but no doubt I've messed up the commit in some way.
* [project @ 2002-09-25 20:44:23 by wolfgang]wolfgang2002-09-251-2/+2
| | | | merge rev. 1.33.8.1
* [project @ 2001-11-22 14:25:11 by simonmar]simonmar2001-11-221-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retainer Profiling / Lag-drag-void profiling. This is mostly work by Sungwoo Park, who spent a summer internship at MSR Cambridge this year implementing these two types of heap profiling in GHC. Relative to Sungwoo's original work, I've made some improvements to the code: - it's now possible to apply constraints to retainer and LDV profiles in the same way as we do for other types of heap profile (eg. +RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering only closures with cost centres 'foo' and 'bar'). - the heap-profile timer implementation is cleaned up. - heap profiling no longer has to be run in a two-space heap. - general cleanup of the code and application of the SDM C coding style guidelines. Profiling will be a little slower and require more space than before, mainly because closures have an extra header word to support either retainer profiling or LDV profiling (you can't do both at the same time). We've used the new profiling tools on GHC itself, with moderate success. Fixes for some space leaks in GHC to follow...
* [project @ 2001-02-06 11:41:04 by rrt]rrt2001-02-061-2/+2
| | | | Corrected comment according to code.
* [project @ 2001-01-26 14:17:31 by simonpj]simonpj2001-01-261-6/+1
| | | | Move TEXT_BEFORE_HEAP to rts/Storage.h
* [project @ 2000-12-11 12:36:59 by simonmar]simonmar2000-12-111-19/+1
| | | | | - update representation of BCOs - add setHeapSize for use from within GHC
* [project @ 2000-12-04 12:31:19 by simonmar]simonmar2000-12-041-173/+1
| | | | merge recent changes from before-ghci-branch onto the HEAD
* [project @ 2000-11-13 14:40:36 by simonmar]simonmar2000-11-131-7/+7
| | | | | | Change the names of several RTS symbols so they don't potentially clash with user code. All the symbols that may clash now have an "stg_" prefix.
* [project @ 2000-11-07 10:42:55 by simonmar]simonmar2000-11-071-8/+18
| | | | | merge before-ghci -> before-ghci-branch-merged into the ghc (non-compiler) parts of the tree.
* [project @ 2000-10-06 15:38:06 by simonmar]simonmar2000-10-061-5/+5
| | | | | | | | The GC needs to be cleverer about which address ranges are in text/data space if we're dynamically loading modules. (BTW, this linking stuff is mostly ported from code written by Julian Seward for STG Hugs).
* [project @ 2000-08-17 15:19:17 by rrt]rrt2000-08-171-4/+4
| | | | | Changed HAVE_WIN32_DLL_SUPPORT to ENABLE_WIN32_DLL_SUPPORT so that the relevant bits are only used in the dynamic Windows build (as they should be).
* [project @ 2000-08-16 15:29:34 by rrt]rrt2000-08-161-2/+2
| | | | | Change use of HAVE_WIN32_DLL_SUPPORT to ENABLE_WIN32_DLL_SUPPORT, to stop things going horribly wrong with static linking on win32.
* [project @ 2000-08-07 23:37:19 by qrczak]qrczak2000-08-071-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now Char, Char#, StgChar have 31 bits (physically 32). "foo"# is still an array of bytes. CharRep represents 32 bits (on a 64-bit arch too). There is also Int8Rep, used in those places where bytes were originally meant. readCharArray, indexCharOffAddr etc. still use bytes. Storable and {I,M}Array use wide Chars. In future perhaps all sized integers should be primitive types. Then some usages of indexing primops scattered through the code could be changed to then-available Int8 ones, and then Char variants of primops could be made wide (other usages that handle text should use conversion that will be provided later). I/O and _ccall_ arguments assume ISO-8859-1. UTF-8 is internally used for string literals (only). Z-encoding is ready for Unicode identifiers. Ranges of intlike and charlike closures are more easily configurable. I've probably broken nativeGen/MachCode.lhs:chrCode for Alpha but I don't know the Alpha assembler to fix it (what is zapnot?). Generally I'm not sure if I've done the NCG changes right. This commit breaks the binary compatibility (of course). TODO: * is* and to{Lower,Upper} in Char (in progress). * Libraries for text conversion (in design / experiments), to be plugged to I/O and a higher level foreign library. * PackedString. * StringBuffer and accepting source in encodings other than ISO-8859-1.
* [project @ 2000-05-26 10:14:33 by sewardj]sewardj2000-05-261-17/+19
| | | | | | | | | Changes to allow Hugs to be built with mingw32, not cygwin. Also, updates so that DietHEP works properly for mingw32. Most changes are trivial (assert --> ASSERT), etc. For hugs, have deleted queries about the width of a terminal window, and so the printing of dots as progress indicators is gone too. No great loss. Zapped various other out-of-date platform-specific junk in machdep.c.
* [project @ 2000-03-17 14:37:21 by simonmar]simonmar2000-03-171-45/+25
| | | | More random cleanups.
* [project @ 1999-10-27 09:57:48 by simonmar]simonmar1999-10-271-5/+3
| | | | small cleanup; reduce amount of conditionally-compiled stuff
* [project @ 1999-08-03 15:44:21 by simonmar]simonmar1999-08-031-3/+3
| | | | | minor cleanup: use INFO_PTR_TO_STRUCT in get_itbl() and hence pull it out of the #ifdef TABLES_NEXT_TO_CODE.
* [project @ 1999-07-06 16:17:39 by sewardj]sewardj1999-07-061-1/+14
| | | | | Make vectored returns to Hugs work, and make IS_CODE_PTR etc work for dynamically loaded objects.
* [project @ 1999-06-25 09:13:37 by simonmar]simonmar1999-06-251-20/+14
| | | | | | | | | New define: TABLES_NEXT_TO_CODE says whether info tables are assumed to reside just before the code for a function. We used to use USE_MINIINTERPRETER for this function, but it makes sense in certain cases to separate the use of tail-calls from tables-next-to-code. StgMacros: add a couple of missing macros to support update in place.
* [project @ 1999-05-13 17:30:50 by simonm]simonm1999-05-131-9/+13
| | | | | | | | | | | | | Support for "unregisterised" builds. An unregisterised build doesn't use the assembly mangler, doesn't do tail jumping (uses the mini-interpreter), and doesn't use global register variables. Plenty of cleanups and bugfixes in the process. Add way 'u' to GhcLibWays to get unregisterised libs & RTS. [ note: not *quite* working fully yet... there's still a bug or two lurking ]
* [project @ 1999-05-11 16:47:39 by keithw]keithw1999-05-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | (this is number 9 of 9 commits to be applied together) Usage verification changes / ticky-ticky changes: We want to verify that SingleEntry thunks are indeed entered at most once. In order to do this, -ticky / -DTICKY_TICKY turns on eager blackholing. We blackhole with new blackholes: SE_BLACKHOLE and SE_CAF_BLACKHOLE. We will enter one of these if we attempt to enter a SingleEntry thunk twice. Note that CAFs are dealt with in by codeGen, and ordinary thunks by the RTS. We also want to see how many times we enter each Updatable thunk. To this end, we have modified -ticky. When -ticky is on, we update with a permanent indirection, and arrange that when we enter a permanent indirection we count the entry and then convert the indirection to a normal indirection. This gives us a means of counting the number of thunks entered again after the first entry. Obviously this screws up profiling, and so you can't build a ticky and profiling compiler any more. Also a few other changes that didn't make it into the previous 8 commits, but form a part of this set.
* [project @ 1999-05-04 08:50:43 by sof]sof1999-05-041-3/+2
| | | | Removed last vestiges of PrelBase_Bool_closure_tbl (yes\!)
* [project @ 1999-04-27 12:25:23 by simonm]simonm1999-04-271-1/+7
| | | | Add CLOSURE_TBL() macro for building closure tables.
* [project @ 1999-04-27 10:59:29 by sewardj]sewardj1999-04-271-1/+3
| | | | Minor mods to make STG Hugs compile out-of-the-box.
* [project @ 1999-04-23 13:54:12 by simonm]simonm1999-04-231-2/+2
| | | | dataToTag# support.
* [project @ 1999-03-23 08:34:07 by sof]sof1999-03-231-3/+3
| | | | *_SECTION_END_MARKER_DECLs are now void*
* [project @ 1999-03-15 16:53:10 by simonm]simonm1999-03-151-1/+9
| | | | Specialise STATIC_LINK() for {FUN,THUNK,IND}_STATIC.
* [project @ 1999-03-11 11:21:45 by simonm]simonm1999-03-111-3/+4
| | | | HPUX fixes.
* [project @ 1999-03-03 19:27:23 by sof]sof1999-03-031-2/+4
| | | | Define HEAP_ALLOCED macro in non Win32 DLL land too
* [project @ 1999-03-03 18:16:15 by sof]sof1999-03-031-14/+26
| | | | | On the Win32 DLL side, tidied up the defns of LOOKS_LIKE_STATIC() and LOOKS_LIKE_STATIC_CLOSURE() a little.
* [project @ 1999-03-02 19:44:07 by sof]sof1999-03-021-5/+29
| | | | | - misc changes to support DLLs - StgNat* --> StgWord*
* [project @ 1999-02-05 16:02:18 by simonm]simonm1999-02-051-1/+3
| | | | Copyright police.
* [project @ 1999-01-13 17:25:37 by simonm]simonm1999-01-131-5/+3
| | | | | | | | | | | | | | | | | Added a generational garbage collector. The collector is reliable but fairly untuned as yet. It works with an arbitrary number of generations: use +RTS -G<gens> to change the number of generations used (default 2). Stats: +RTS -Sstderr is quite useful, but to really see what's going on compile the RTS with -DDEBUG and use +RTS -D32. ARR_PTRS removed - it wasn't used anywhere. Sanity checking improved: - free blocks are now spammed when sanity checking is turned on - a check for leaking blocks is performed after each GC.
* [project @ 1998-12-02 13:17:09 by simonm]simonm1998-12-021-0/+324
Move 4.01 onto the main trunk.