summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-10-10 14:51:28 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-10-25 18:07:43 -0400
commit7f203d00edd639d24af2cf5970e771207adc2bc6 (patch)
tree05ea44c037e3d5a9107b8fdf938c0548e41446bc /rts/RtsStartup.c
parent5a997e16cb2079c52f980d59af3de176922fa320 (diff)
downloadhaskell-7f203d00edd639d24af2cf5970e771207adc2bc6.tar.gz
Numeric exceptions: replace FFI calls with primops
ghc-bignum needs a way to raise numerical exceptions defined in base package. At the time we used FFI calls into primops defined in the RTS. These FFI calls had to be wrapped into hacky bottoming functions because "foreign import prim" syntax doesn't support giving a bottoming demand to the foreign call (cf #16929). These hacky wrapper functions trip up the JavaScript backend (#21078) because they are polymorphic in their return type. This commit replaces them with primops very similar to raise# but raising predefined exceptions.
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 8ec69f84ab..a80dfc2959 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -203,6 +203,9 @@ static void initBuiltinGcRoots(void)
getStablePtr((StgPtr)cannotCompactPinned_closure);
getStablePtr((StgPtr)cannotCompactMutable_closure);
getStablePtr((StgPtr)nestedAtomically_closure);
+ getStablePtr((StgPtr)underflowException_closure);
+ getStablePtr((StgPtr)overflowException_closure);
+ getStablePtr((StgPtr)divZeroException_closure);
getStablePtr((StgPtr)runSparks_closure);
getStablePtr((StgPtr)ensureIOManagerIsRunning_closure);
getStablePtr((StgPtr)interruptIOManager_closure);
@@ -220,9 +223,6 @@ static void initBuiltinGcRoots(void)
* GHC.Core.Make.mkExceptionId.
*/
getStablePtr((StgPtr)absentSumFieldError_closure);
- getStablePtr((StgPtr)raiseUnderflowException_closure);
- getStablePtr((StgPtr)raiseOverflowException_closure);
- getStablePtr((StgPtr)raiseDivZeroException_closure);
}
void