import CoreSyn
import Literal ( Literal(..) )
import PrimOp ( PrimOp, primOpOcc )
-import PrimRep ( PrimRep(..) )
+import PrimRep ( PrimRep(..), isFollowableRep )
import Constants ( wORD_SIZE )
import Module ( ModuleName, moduleName, moduleNameFS )
import Linker ( lookupSymbol )
where
ret_itbl_addr
= case pk of
- PtrRep -> stg_ctoi_ret_R1p_info
WordRep -> stg_ctoi_ret_R1n_info
IntRep -> stg_ctoi_ret_R1n_info
AddrRep -> stg_ctoi_ret_R1n_info
FloatRep -> stg_ctoi_ret_F1_info
DoubleRep -> stg_ctoi_ret_D1_info
VoidRep -> stg_ctoi_ret_V_info
- other -> pprPanic "ByteCodeLink.ctoi_itbl" (ppr pk)
+ other | isFollowableRep pk -> stg_ctoi_ret_R1p_info
+ -- Includes ArrayRep, ByteArrayRep, as well as
+ -- the obvious PtrRep
+ | otherwise
+ -> pprPanic "ByteCodeLink.ctoi_itbl" (ppr pk)
itoc_itbl st pk
= addr st ret_itbl_addr
AddrRep -> stg_gc_unbx_r1_info
FloatRep -> stg_gc_f1_info
DoubleRep -> stg_gc_d1_info
- VoidRep -> nullPtr
- -- Interpreter.c spots this special case
- other -> pprPanic "ByteCodeLink.itoc_itbl" (ppr pk)
+ VoidRep -> nullPtr -- Interpreter.c spots this special case
+ other | isFollowableRep pk -> stg_gc_unpt_r1_info
+ | otherwise
+ -> pprPanic "ByteCodeLink.itoc_itbl" (ppr pk)
foreign label "stg_ctoi_ret_R1p_info" stg_ctoi_ret_R1p_info :: Ptr ()
foreign label "stg_ctoi_ret_R1n_info" stg_ctoi_ret_R1n_info :: Ptr ()
foreign label "stg_ctoi_ret_V_info" stg_ctoi_ret_V_info :: Ptr ()
foreign label "stg_gc_unbx_r1_info" stg_gc_unbx_r1_info :: Ptr ()
+foreign label "stg_gc_unpt_r1_info" stg_gc_unpt_r1_info :: Ptr ()
foreign label "stg_gc_f1_info" stg_gc_f1_info :: Ptr ()
foreign label "stg_gc_d1_info" stg_gc_d1_info :: Ptr ()