[Git][ghc/ghc][master] Add native delimited continuations to the RTS

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Sep 12 11:07:14 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
04062510 by Alexis King at 2022-09-11T11:30:32+02:00
Add native delimited continuations to the RTS

This patch implements GHC proposal 313, "Delimited continuation
primops", by adding native support for delimited continuations to the
GHC RTS.

All things considered, the patch is relatively small. It almost
exclusively consists of changes to the RTS; the compiler itself is
essentially unaffected. The primops come with fairly extensive Haddock
documentation, and an overview of the implementation strategy is given
in the Notes in rts/Continuation.c.

This first stab at the implementation prioritizes simplicity over
performance. Most notably, every continuation is always stored as a
single, contiguous chunk of stack. If one of these chunks is
particularly large, it can result in poor performance, as the current
implementation does not attempt to cleverly squeeze a subset of the
stack frames into the existing stack: it must fit all at once. If this
proves to be a performance issue in practice, a cleverer strategy would
be a worthwhile target for future improvements.

- - - - -


30 changed files:

- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types/Prim.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/StgToCmm/Prim.hs
- docs/users_guide/9.6.1-notes.rst
- libraries/base/Control/Exception/Base.hs
- libraries/base/GHC/Exts.hs
- libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs
- libraries/ghc-prim/GHC/Prim/PtrEq.hs
- rts/Apply.cmm
- rts/ClosureFlags.c
- rts/ClosureSize.c
- rts/Compact.cmm
- + rts/Continuation.c
- + rts/Continuation.h
- + rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Heap.c
- rts/HeapStackCheck.cmm
- rts/LdvProfile.c
- rts/Printer.c
- rts/ProfHeap.c
- rts/RetainerProfile.c
- rts/RtsSymbols.c
- rts/StgMiscClosures.cmm
- rts/Ticky.c
- rts/TraverseHeap.c
- rts/include/Cmm.h
- rts/include/rts/storage/ClosureMacros.h


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04062510806e2a3ccf0ecdb71c704a8e1c548c53

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04062510806e2a3ccf0ecdb71c704a8e1c548c53
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/20220912/36ff1616/attachment.html>


More information about the ghc-commits mailing list