[Git][ghc/ghc][wip/unloading] 4 commits: Fix and enable object unloading in GHCi
Ben Gamari
gitlab at gitlab.haskell.org
Thu Oct 29 01:11:05 UTC 2020
Ben Gamari pushed to branch wip/unloading at Glasgow Haskell Compiler / GHC
Commits:
0d422cd5 by Ömer Sinan Ağacan at 2020-10-22T17:15:19+00:00
Fix and enable object unloading in GHCi
Fixes #16525
See Note [Object unloading] in CheckUnload.c for details.
NoFib results:
--------------------------------------------------------------------------------
Program Size Allocs Instrs Reads Writes
--------------------------------------------------------------------------------
CS -0.2% 0.0% +0.0% +0.0% +0.0%
CSD -0.2% 0.0% +0.0% +0.0% +0.0%
FS -0.2% 0.0% +0.0% +0.0% -0.0%
S -0.2% 0.0% +1.0% +1.1% +0.0%
VS -0.2% 0.0% +0.0% +0.0% -0.0%
VSD -0.1% 0.0% +0.0% +0.0% +0.0%
VSM -0.1% 0.0% +0.0% +0.0% -0.0%
anna -0.1% 0.0% +0.0% +0.0% +0.0%
ansi -0.1% 0.0% +0.0% +0.0% 0.0%
atom -0.1% 0.0% +0.0% +0.0% 0.0%
awards -0.1% 0.0% +0.0% +0.0% 0.0%
banner -0.1% 0.0% +0.0% +0.0% +0.0%
bernouilli -0.1% 0.0% +0.0% +0.0% +0.0%
binary-trees -0.1% 0.0% +0.0% +0.0% -0.0%
boyer -0.1% 0.0% +0.1% +0.1% 0.0%
boyer2 -0.1% 0.0% +0.0% +0.1% 0.0%
bspt -0.1% 0.0% +0.0% +0.0% 0.0%
cacheprof -0.1% 0.0% +0.0% +0.0% -0.0%
calendar -0.1% 0.0% +0.0% +0.0% 0.0%
cichelli -0.1% 0.0% +0.1% +0.2% +0.0%
circsim -0.1% 0.0% +0.0% +0.0% +0.0%
clausify -0.1% 0.0% +0.0% +0.0% +0.0%
comp_lab_zift -0.1% 0.0% +0.0% +0.0% -0.0%
compress -0.1% 0.0% +0.0% +0.0% +0.0%
compress2 -0.1% 0.0% +0.0% +0.0% 0.0%
constraints -0.1% 0.0% +0.0% +0.0% +0.0%
cryptarithm1 -0.1% 0.0% +0.0% +0.0% 0.0%
cryptarithm2 -0.1% 0.0% +0.0% +0.0% +0.0%
cse -0.1% 0.0% +0.0% +0.0% 0.0%
digits-of-e1 -0.1% 0.0% +0.0% +0.0% +0.0%
digits-of-e2 -0.1% 0.0% +0.0% +0.0% -0.0%
dom-lt -0.1% 0.0% +0.0% +0.0% -0.0%
eliza -0.1% 0.0% +0.0% +0.0% +0.0%
event -0.1% 0.0% +0.0% +0.1% 0.0%
exact-reals -0.1% 0.0% +0.0% +0.0% -0.0%
exp3_8 -0.1% 0.0% +0.0% +0.0% 0.0%
expert -0.1% 0.0% +0.0% +0.0% +0.0%
fannkuch-redux -0.1% 0.0% +0.0% +0.0% 0.0%
fasta -0.1% 0.0% +0.0% +0.0% -0.0%
fem -0.1% 0.0% +0.0% +0.0% 0.0%
fft -0.1% 0.0% +0.0% +0.0% -0.0%
fft2 -0.1% 0.0% +0.0% +0.0% 0.0%
fibheaps -0.1% 0.0% +0.0% +0.0% -0.0%
fish -0.1% 0.0% +0.0% +0.0% -0.0%
fluid -0.1% 0.0% +0.1% +0.1% -0.0%
fulsom -0.1% 0.0% +0.0% +0.0% 0.0%
gamteb -0.1% 0.0% +0.0% +0.0% 0.0%
gcd -0.1% 0.0% +0.0% +0.0% +0.0%
gen_regexps -0.2% 0.0% +0.0% +0.0% -0.0%
genfft -0.1% 0.0% +0.0% +0.0% -0.0%
gg -0.1% 0.0% +0.1% +0.1% 0.0%
grep -0.1% 0.0% +0.0% +0.0% 0.0%
hidden -0.1% 0.0% +0.0% +0.0% +0.0%
hpg -0.1% 0.0% +0.0% +0.0% +0.0%
ida -0.1% 0.0% +0.0% +0.0% -0.0%
infer -0.1% 0.0% +0.0% +0.0% +0.0%
integer -0.1% 0.0% +0.0% +0.0% 0.0%
integrate -0.1% 0.0% +0.0% +0.0% 0.0%
k-nucleotide -0.1% 0.0% +0.0% +0.0% -0.0%
kahan -0.1% 0.0% +0.0% +0.0% +0.0%
knights -0.1% 0.0% +0.0% +0.0% 0.0%
lambda -0.1% 0.0% +0.0% +0.0% +0.0%
last-piece -0.1% 0.0% +0.0% +0.0% -0.0%
lcss -0.1% 0.0% +0.0% +0.0% 0.0%
life -0.1% 0.0% +0.0% +0.0% -0.0%
lift -0.1% 0.0% +0.0% +0.0% +0.0%
linear -0.1% 0.0% +0.0% +0.0% +0.0%
listcompr -0.1% 0.0% +0.0% +0.0% -0.0%
listcopy -0.1% 0.0% +0.0% +0.0% -0.0%
maillist -0.1% 0.0% +0.0% +0.0% +0.0%
mandel -0.1% 0.0% +0.0% +0.0% -0.0%
mandel2 -0.1% 0.0% +0.0% +0.0% -0.0%
mate -0.1% 0.0% +0.0% +0.0% -0.0%
minimax -0.1% 0.0% +0.0% +0.0% -0.0%
mkhprog -0.1% 0.0% +0.0% +0.0% +0.0%
multiplier -0.1% 0.0% +0.0% +0.0% +0.0%
n-body -0.1% 0.0% +0.0% +0.0% 0.0%
nucleic2 -0.1% 0.0% +0.0% +0.0% -0.0%
para -0.1% 0.0% +0.0% +0.0% 0.0%
paraffins -0.1% 0.0% +0.0% +0.0% 0.0%
parser -0.1% 0.0% +0.0% +0.0% +0.0%
parstof -0.1% 0.0% +0.2% +0.2% -0.0%
pic -0.1% 0.0% +0.1% +0.1% +0.0%
pidigits -0.1% 0.0% +0.0% +0.0% -0.0%
power -0.1% 0.0% +0.0% +0.0% +0.0%
pretty -0.1% 0.0% +0.5% +0.6% -0.0%
primes -0.1% 0.0% +0.0% +0.0% 0.0%
primetest -0.1% 0.0% +0.0% +0.0% +0.0%
prolog -0.1% 0.0% +0.0% +0.0% +0.0%
puzzle -0.1% 0.0% +0.0% +0.0% -0.0%
queens -0.1% 0.0% +0.0% +0.0% 0.0%
reptile -0.1% 0.0% +0.0% +0.0% +0.0%
reverse-complem -0.2% 0.0% +0.0% +0.0% 0.0%
rewrite -0.1% 0.0% +0.0% +0.0% 0.0%
rfib -0.1% 0.0% +0.0% +0.0% -0.0%
rsa -0.1% 0.0% +0.0% +0.0% +0.0%
scc -0.2% 0.0% +0.5% +0.7% +0.0%
sched -0.1% 0.0% +0.0% +0.0% -0.0%
scs -0.1% 0.0% +0.0% +0.0% +0.0%
simple -0.1% 0.0% +0.3% +0.4% 0.0%
solid -0.1% 0.0% +0.0% +0.0% 0.0%
sorting -0.1% 0.0% +0.0% +0.0% -0.0%
spectral-norm -0.1% 0.0% +0.0% +0.0% -0.0%
sphere -0.1% 0.0% +0.0% +0.0% 0.0%
symalg -0.1% 0.0% +0.0% +0.0% +0.0%
tak -0.1% 0.0% +0.0% +0.0% +0.0%
transform -0.1% 0.0% +0.0% +0.0% +0.0%
treejoin -0.1% 0.0% +0.1% +0.1% 0.0%
typecheck -0.1% 0.0% +0.0% +0.0% 0.0%
veritas -0.1% 0.0% +0.0% +0.0% +0.0%
wang -0.1% 0.0% +0.0% +0.0% +0.0%
wave4main -0.1% 0.0% +0.0% +0.0% -0.0%
wheel-sieve1 -0.1% 0.0% +0.0% +0.0% +0.0%
wheel-sieve2 -0.1% 0.0% +0.0% +0.0% -0.0%
x2n1 -0.1% 0.0% +0.0% +0.0% +0.0%
--------------------------------------------------------------------------------
Min -0.2% 0.0% +0.0% +0.0% -0.0%
Max -0.1% 0.0% +1.0% +1.1% +0.0%
Geometric Mean -0.1% -0.0% +0.0% +0.0% -0.0%
- - - - -
35547f8e by Ray Shih at 2020-10-22T17:15:19+00:00
Add loadNativeObj and unloadNativeObj
(This change is originally written by niteria)
This adds two functions:
* `loadNativeObj`
* `unloadNativeObj`
and implements them for Linux.
They are useful if you want to load a shared object with Haskell code
using the system linker and have GHC call dlclose() after the
code is no longer referenced from the heap.
Using the system linker allows you to load the shared object
above outside the low-mem region. It also loads the DWARF sections
in a way that `perf` understands.
`dl_iterate_phdr` is what makes this implementation Linux specific.
- - - - -
852129d3 by GHC GitLab CI at 2020-10-22T17:21:23+00:00
rts: Introduce highMemDynamic
- - - - -
6f5e9883 by GHC GitLab CI at 2020-10-22T17:21:40+00:00
Introduce test for dynamic library unloading
This uses the highMemDynamic flag introduced earlier to verify that
dynamic objects are properly unloaded.
- - - - -
30 changed files:
- compiler/GHC/Runtime/Linker.hs
- includes/rts/Linker.h
- includes/rts/storage/GC.h
- rts/CheckUnload.c
- rts/CheckUnload.h
- rts/Hash.c
- rts/Hash.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/RtsStartup.c
- rts/linker/Elf.c
- rts/linker/LoadArchive.c
- rts/linker/MachO.c
- rts/linker/PEi386.c
- rts/linker/elf_got.c
- rts/sm/Evac.c
- rts/sm/GC.c
- rts/sm/Storage.c
- testsuite/tests/ghci/T16525a/T16525a.script
- testsuite/tests/ghci/T16525a/T16525a.stdout
- testsuite/tests/ghci/T16525a/all.T
- + testsuite/tests/ghci/T16525b/A.hs
- + testsuite/tests/ghci/T16525b/B.hs
- + testsuite/tests/ghci/T16525b/T16525b.script
- + testsuite/tests/ghci/T16525b/T16525b.stdout
- + testsuite/tests/ghci/T16525b/all.T
- testsuite/tests/rts/linker/Makefile
- testsuite/tests/rts/linker/all.T
- testsuite/tests/rts/linker/linker_error.c
- + testsuite/tests/rts/linker/linker_unload_native.c
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1549b05fce98ed3aeac459bdbdb150b67ccfbb4c...6f5e9883ed189a7c4890dcf7a9661d810e1b0867
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1549b05fce98ed3aeac459bdbdb150b67ccfbb4c...6f5e9883ed189a7c4890dcf7a9661d810e1b0867
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201028/c64c2623/attachment-0001.html>
More information about the ghc-commits
mailing list