[GHC] #8199: Get rid of HEAP_ALLOCED
GHC
ghc-devs at haskell.org
Fri Aug 30 02:51:39 UTC 2013
#8199: Get rid of HEAP_ALLOCED
----------------------------------------------+----------------------------
Reporter: ezyang | Owner: ezyang
Type: feature request | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.7
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Project (more than a week) | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
----------------------------------------------+----------------------------
This bug is to track progress of removing HEAP_ALLOCED from GHC, promising
faster GC, as long as we can keep the cost of indirections down.
The relevant wiki article:
http://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/HeapAlloced ;
we are implementing method 2. The attached patchset is *almost* able to
support GHC itself; a ghc-stage2 built this way can compile most files,
but is much slower in some cases, and probably has some correctness bugs.
Improvements possible:
* Don't pay for a double indirection when -fPIC is turned on. Probably
the easiest way to do this is to *not* bake in the indirections into
compiled code when it is -fPIC'd, and instead scribble over the GOT.
However, I don't know how to go backwards from a symbol to a GOT entry, so
we might need some heinous assembly hacks to get this working.
* Closure tables should have their indirections short-circuited by the
initialization code.
* We are paying an indirection when a GC occurs when the closure is not in
R1. According to the wiki page, technically this is not needed, but I
don't know how to eliminate references to the closure itself from
stg_gc_fun.
* Properly handle the Windows DLL case (e.g. SRTs); this should be simpler
now that everything is an indirection.
* Bikeshed hs_main API changes (because closures are not valid prior to
RTS initialization, so you have to pass in an indirection instead)
* Improve static indirection and stable pointer registration, avoiding
binary bloat from `__attribute(constructor)__` stubs.
* Need to implement a new megablock tracking structure so we can
free/check for lost blocks
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8199>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list