| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
comments only.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
merge rev. 1.33.8.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
| |
Corrected comment according to code.
|
|
|
|
| |
Move TEXT_BEFORE_HEAP to rts/Storage.h
|
|
|
|
|
| |
- update representation of BCOs
- add setHeapSize for use from within GHC
|
|
|
|
| |
merge recent changes from before-ghci-branch onto the HEAD
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
merge before-ghci -> before-ghci-branch-merged into the ghc
(non-compiler) parts of the tree.
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
Change use of HAVE_WIN32_DLL_SUPPORT to ENABLE_WIN32_DLL_SUPPORT, to stop
things going horribly wrong with static linking on win32.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
More random cleanups.
|
|
|
|
| |
small cleanup; reduce amount of conditionally-compiled stuff
|
|
|
|
|
| |
minor cleanup: use INFO_PTR_TO_STRUCT in get_itbl() and hence pull it
out of the #ifdef TABLES_NEXT_TO_CODE.
|
|
|
|
|
| |
Make vectored returns to Hugs work, and make IS_CODE_PTR etc work
for dynamically loaded objects.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
| |
Removed last vestiges of PrelBase_Bool_closure_tbl (yes\!)
|
|
|
|
| |
Add CLOSURE_TBL() macro for building closure tables.
|
|
|
|
| |
Minor mods to make STG Hugs compile out-of-the-box.
|
|
|
|
| |
dataToTag# support.
|
|
|
|
| |
*_SECTION_END_MARKER_DECLs are now void*
|
|
|
|
| |
Specialise STATIC_LINK() for {FUN,THUNK,IND}_STATIC.
|
|
|
|
| |
HPUX fixes.
|
|
|
|
| |
Define HEAP_ALLOCED macro in non Win32 DLL land too
|
|
|
|
|
| |
On the Win32 DLL side, tidied up the defns of LOOKS_LIKE_STATIC() and
LOOKS_LIKE_STATIC_CLOSURE() a little.
|
|
|
|
|
| |
- misc changes to support DLLs
- StgNat* --> StgWord*
|
|
|
|
| |
Copyright police.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
Move 4.01 onto the main trunk.
|