import MachOp ( MachOp(..) )
import PrimRep ( PrimRep(..), getPrimRepSizeInBytes )
import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
import MachOp ( MachOp(..) )
import PrimRep ( PrimRep(..), getPrimRepSizeInBytes )
import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
-import Constants ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
+import Constants ( mIN_INTLIKE, mIN_CHARLIKE, bLOCK_SIZE,
mkForeignLabel )
import ForeignCall ( ForeignCall(..), CCallSpec(..), CCallTarget(..),
CCallConv(..), playSafe, playThreadSafe )
mkForeignLabel )
import ForeignCall ( ForeignCall(..), CCallSpec(..), CCallTarget(..),
CCallConv(..), playSafe, playThreadSafe )
Usually, this compiles to an assignment, but when the left-hand side
is empty, we just perform the call and ignore the result.
Usually, this compiles to an assignment, but when the left-hand side
is empty, we just perform the call and ignore the result.
ToDo: saving/restoring of volatile regs around ccalls.
JRS, 001113: always do the call of suspendThread and resumeThread as a ccall
ToDo: saving/restoring of volatile regs around ccalls.
JRS, 001113: always do the call of suspendThread and resumeThread as a ccall
StaticTarget nm -> (rhs, Left nm)
DynamicTarget | notNull rhs -- an assertion
-> (tail rhs, Right (amodeToStix (head rhs)))
StaticTarget nm -> (rhs, Left nm)
DynamicTarget | notNull rhs -- an assertion
-> (tail rhs, Right (amodeToStix (head rhs)))
amodeToStix (CCharLike (CLit (MachChar c)))
= StIndex Word8Rep cHARLIKE_closure (StInt (toInteger off))
where
amodeToStix (CCharLike (CLit (MachChar c)))
= StIndex Word8Rep cHARLIKE_closure (StInt (toInteger off))
where
-- dreadful, but rare.
MachLabel l (Just x) -> StCLbl (mkForeignLabel (mkFastString (unpackFS l ++ '@':show x)) False)
MachLabel l _ -> StCLbl (mkForeignLabel l False{-ToDo: dynamic-})
-- dreadful, but rare.
MachLabel l (Just x) -> StCLbl (mkForeignLabel (mkFastString (unpackFS l ++ '@':show x)) False)
MachLabel l _ -> StCLbl (mkForeignLabel l False{-ToDo: dynamic-})
-- these are the sizes of charLike and intLike closures, in _bytes_.
charLikeSize = (fixedHdrSize + 1) * (getPrimRepSizeInBytes PtrRep)
intLikeSize = (fixedHdrSize + 1) * (getPrimRepSizeInBytes PtrRep)
-- these are the sizes of charLike and intLike closures, in _bytes_.
charLikeSize = (fixedHdrSize + 1) * (getPrimRepSizeInBytes PtrRep)
intLikeSize = (fixedHdrSize + 1) * (getPrimRepSizeInBytes PtrRep)