Finish stable split
authorDavid Feuer <david.feuer@gmail.com>
Wed, 29 Aug 2018 20:34:21 +0000 (16:34 -0400)
committerDavid Feuer <David.Feuer@gmail.com>
Wed, 29 Aug 2018 20:34:22 +0000 (16:34 -0400)
commitf48e276a5ba68d8b6fcb4a558022581fb30f9326
tree8ea324b84d137d59cda566d6a559016d2c7437ea
parent65eec9cfd4410c0e30b0ed06116c15f8ce3de49d
Finish stable split

Long ago, the stable name table and stable pointer tables were one.
Now, they are separate, and have significantly different
implementations. I believe the time has come to finish the split
that began in #7674.

* Divide `rts/Stable` into `rts/StableName` and `rts/StablePtr`.

* Give each table its own mutex.

* Add FFI functions `hs_lock_stable_ptr_table` and
`hs_unlock_stable_ptr_table` and document them.
  These are intended to replace the previously undocumented
`hs_lock_stable_tables` and `hs_lock_stable_tables`,
  which are now documented as deprecated synonyms.

* Make `eqStableName#` use pointer equality instead of unnecessarily
comparing stable name table indices.

Reviewers: simonmar, bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15555

Differential Revision: https://phabricator.haskell.org/D5084
30 files changed:
compiler/codeGen/StgCmmPrim.hs
docs/users_guide/8.8.1-notes.rst
docs/users_guide/ffi-chap.rst
includes/HsFFI.h
includes/Rts.h
includes/rts/StableName.h [moved from includes/rts/Stable.h with 69% similarity]
includes/rts/StablePtr.h [new file with mode: 0644]
includes/stg/MiscClosures.h
rts/Adjustor.c
rts/Globals.c
rts/HsFFI.c
rts/Interpreter.c
rts/Linker.c
rts/RetainerProfile.c
rts/RtsAPI.c
rts/RtsStartup.c
rts/RtsSymbols.c
rts/Schedule.c
rts/StableName.c [moved from rts/Stable.c with 55% similarity]
rts/StableName.h [new file with mode: 0644]
rts/StablePtr.c [new file with mode: 0644]
rts/StablePtr.h [moved from rts/Stable.h with 54% similarity]
rts/StaticPtrTable.c
rts/TopHandler.c
rts/TopHandler.h
rts/posix/Signals.c
rts/rts.cabal.in
rts/sm/Compact.c
rts/sm/GC.c
utils/deriveConstants/Main.hs