Add PrimCallConv support to GHCi
This adds support for calling Cmm code from bytecode using the native calling convention, allowing modules that use `foreign import prim` to be loaded and debugged in GHCi. This patch introduces a new `PRIMCALL` bytecode instruction and a helper stack frame `stg_primcall`. The code is based on the existing functionality for dealing with unboxed tuples in bytecode, which has been generalised to handle arbitrary calls. Fixes #22051
parent
e3fff751
No related branches found
No related tags found
Pipeline #61217 canceled
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Showing
- compiler/GHC/ByteCode/Asm.hs 34 additions, 29 deletionscompiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs 10 additions, 6 deletionscompiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs 27 additions, 17 deletionscompiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/CallConv.hs 105 additions, 8 deletionscompiler/GHC/Cmm/CallConv.hs
- compiler/GHC/Cmm/Parser.y 2 additions, 2 deletionscompiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Reg.hs 1 addition, 1 deletioncompiler/GHC/Cmm/Reg.hs
- compiler/GHC/StgToByteCode.hs 156 additions, 55 deletionscompiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Foreign.hs 11 additions, 11 deletionscompiler/GHC/StgToCmm/Foreign.hs
- rts/Disassembler.c 3 additions, 0 deletionsrts/Disassembler.c
- rts/Interpreter.c 6 additions, 0 deletionsrts/Interpreter.c
- rts/RtsSymbols.c 1 addition, 0 deletionsrts/RtsSymbols.c
- rts/StgMiscClosures.cmm 49 additions, 15 deletionsrts/StgMiscClosures.cmm
- rts/include/rts/Bytecodes.h 2 additions, 0 deletionsrts/include/rts/Bytecodes.h
- rts/include/stg/MiscClosures.h 1 addition, 0 deletionsrts/include/stg/MiscClosures.h
- testsuite/tests/ghci/prog014/prog014.T 0 additions, 1 deletiontestsuite/tests/ghci/prog014/prog014.T
- testsuite/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall.hs 279 additions, 0 deletionstestsuite/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall.hs
- testsuite/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall.stdout 60 additions, 0 deletions...te/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall.stdout
- testsuite/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall.stdout-ws-32 60 additions, 0 deletions...ts/ghci/should_run/GHCiPrimCall/GHCiPrimCall.stdout-ws-32
- testsuite/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall_cmm.cmm 230 additions, 0 deletions...e/tests/ghci/should_run/GHCiPrimCall/GHCiPrimCall_cmm.cmm
- testsuite/tests/ghci/should_run/GHCiPrimCall/Makefile 4 additions, 0 deletionstestsuite/tests/ghci/should_run/GHCiPrimCall/Makefile
Loading
Please register or sign in to comment