| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
|
|
|
| |
drop FILE_SIZE (hasn't been needed by NCG for the past 5 years or so)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Long explanation for small commit:
With the recent reorganization of #includes, things get a little bit
fragile: When gcc with -O is used, glibc's <stdio.h> defines a few
inline functions (see <bits/stdio.h>), and "Stg.h" defines some global
variables which reside in registers. But the latter must happen
*before* any function definition has been seen, otherwise the
generated code could be invalid. Consequently gcc complains like:
In file included from Stg.h:182,
from mkNativeHdr.c:12:
Regs.h:293: global register variable follows a function definition
Regs.h:302: global register variable follows a function definition
The solution is quite simple: Always #include "Stg.h" *before* any
system headers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove most #includes of system headers from Stg.h, and instead
#include any required headers directly in each RTS source file.
The idea is to (a) reduce namespace pollution from system headers that
we don't need, (c) be clearer about dependencies on system things in
the RTS, and (c) improve via-C compilation times (maybe).
In practice though, HsBase.h #includes everything anyway, so the
difference from the point of view of .hc source is minimal. However,
this makes it easier to move to zero-includes if we wanted to (see
discussion on the FFI list; I'm still not sure that's possible but
at least this is a step in the right direction).
|
|
|
|
|
|
|
|
|
| |
merge from the stable branch:
1.70.4.2 fptools/ghc/compiler/nativeGen/StixPrim.lhs
1.5.10.3 fptools/ghc/includes/mkNativeHdr.c
Track recent changes to HpLim assignment in load_thread_state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the sparc native code generator work again after recent
primop hackery.
* Track the change from PrimOp to MachOp at the Stix level.
* Teach the sparc insn selector how to generate 64-bit code.
* Fix various bogons in sparc {Int,Double,Float} <-> {Int,Double,Float}
conversions which only happened to generate correct code by
accident, so far.
* Synthesise BaseReg from &MainCapability.r on archs which do not
have BaseReg in a regiser (eg sparc :)
At the moment {add,sub,mul}Int# are not implemented. To be fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the large block allocation bug (Yay!)
-----------------------------------------
In order to do this, I had to
1. in each heap-check failure branch, return the amount of heap
actually requested, in a known location (I added another slot
in StgRegTable called HpAlloc for this purpose). This is
useful for other reasons - in particular it makes it possible
to get accurate allocation statistics.
2. In the scheduler, if a heap check fails and we wanted more than
BLOCK_SIZE_W words, then allocate a special large block and place
it in the nursery. The nursery now has to be double-linked so
we can insert the new block in the middle.
3. The garbage collector has to be able to deal with multiple objects
in a large block. It turns out that this isn't a problem as long as
the large blocks only occur in the nursery, because we always copy
objects from the nursery during GC. One small change had to be
made: in evacuate(), we may need to follow the link field from the
block descriptor to get to the block descriptor for the head of a
large block.
4. Various other parts of the storage manager had to be modified
to cope with a nursery containing a mixture of block sizes.
Point (3) causes a slight pessimization in the garbage collector. I
don't see a way to avoid this. Point (1) causes some code bloat (a
rough measurement is around 5%), so to offset this I made the
following change which I'd been meaning to do for some time:
- Store the values of some commonly-used absolute addresses
(eg. stg_update_PAP) in the register table. This lets us use
shorter instruction forms for some absolute jumps and saves some
code space.
- The type of Capability is no longer the same as an StgRegTable.
MainRegTable renamed to MainCapability. See Regs.h for details.
Other minor changes:
- remove individual declarations for the heap-check-failure jump
points, and declare them all in StgMiscClosures.h instead. Remove
HeapStackCheck.h.
Updates to the native code generator to follow.
|
|
|
|
| |
Complete the removal of tso->splim (these are the NCG bits).
|
|
|
|
| |
add CurrentTSO, CurrentNursery, bdescr->start and bdescr->free offsets.
|
|
|
|
|
| |
Implement the HP_CHK_GEN macro. As a result, teach mkNativeHdr et al
about R9 and R10.
|
|
Move 4.01 onto the main trunk.
|