rts: Major refactor of adjustor logic
This is a major refactoring and clean-up of the logic surrounding adjustors and executable region mapping, motivated by our current mis-use of ffi_closure_alloc
which results in #20051 (closed). In short we:
- Break
Adjustors.c
up into a number of platform-specific files and thelibffi
backend, significantly improving readability. Note that I do not drop the Alpha, SPARC or IA64 implementations despite having no means of testing on these platforms. - Introduce
ExecPage
, a new, quite thin abstraction for allocating and later protecting single executable pages. - Teach the
Adjustors
implementations to useExecPage
instead ofallocateExec
- Refactor GHCi to use
ExecPage
instead ofallocateExec
andallocateWrite
- Remove
allocateExec
and friends as they are now unused
Fixes #20051 (closed).
Edited by Ben Gamari