diff options
author | simonmar <unknown> | 2001-01-30 10:50:48 +0000 |
---|---|---|
committer | simonmar <unknown> | 2001-01-30 10:50:48 +0000 |
commit | fb94cfbfa6903d1683a7100a7423b73259d23b8a (patch) | |
tree | 269019666f084518ada9af56c40832f8880ced2d /ghc/compiler/ghci/ByteCodeLink.lhs | |
parent | 6300924b9081e4670a206fda0e629d2dc217facc (diff) | |
download | haskell-fb94cfbfa6903d1683a7100a7423b73259d23b8a.tar.gz |
[project @ 2001-01-30 10:50:48 by simonmar]
remove CAF List hack; the RTS has support for CAF retension and reversion.
Diffstat (limited to 'ghc/compiler/ghci/ByteCodeLink.lhs')
-rw-r--r-- | ghc/compiler/ghci/ByteCodeLink.lhs | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/ghc/compiler/ghci/ByteCodeLink.lhs b/ghc/compiler/ghci/ByteCodeLink.lhs index 2792b3d3e1..8942a4c027 100644 --- a/ghc/compiler/ghci/ByteCodeLink.lhs +++ b/ghc/compiler/ghci/ByteCodeLink.lhs @@ -13,14 +13,13 @@ module ByteCodeLink ( UnlinkedBCO, UnlinkedBCOExpr, assembleBCO, import Outputable import Name ( Name, getName, nameModule, toRdrName ) import RdrName ( rdrNameOcc, rdrNameModule ) -import OccName ( occNameString, occNameUserString ) +import OccName ( occNameString ) import FiniteMap ( FiniteMap, addListToFM, filterFM, addToFM, lookupFM, emptyFM ) import CoreSyn import Literal ( Literal(..) ) import PrimOp ( PrimOp, primOpOcc ) import PrimRep ( PrimRep(..) ) -import Util ( global ) import Constants ( wORD_SIZE ) import Module ( ModuleName, moduleName, moduleNameFS ) import Linker ( lookupSymbol ) @@ -42,7 +41,7 @@ import Addr ( Word, Addr ) import PrelBase ( Int(..) ) import PrelGHC ( BCO#, newBCO#, unsafeCoerce#, ByteArray#, Array#, addrToHValue#, mkApUpd0# ) -import IOExts ( IORef, fixIO, readIORef, writeIORef ) +import IOExts ( fixIO ) import ArrayBase import PrelArr ( Array(..) ) import PrelIOBase ( IO(..) ) @@ -411,14 +410,6 @@ data BCO# = BCO# ByteArray# -- instrs :: array Word16# ByteArray# -- itbls :: Array Addr# -} -GLOBAL_VAR(v_cafTable, [], [HValue]) - -addCAF :: HValue -> IO () -addCAF x = do xs <- readIORef v_cafTable - --putStrLn ("addCAF " ++ show (1 + length xs)) - writeIORef v_cafTable (x:xs) - - linkBCO ie ce (UnlinkedBCO nm insnsSS literalsSS ptrsSS itblsSS) = do insns <- listFromSS insnsSS literals <- listFromSS literalsSS @@ -475,8 +466,7 @@ lookupCE ce (Right primop) = do m <- lookupSymbol (primopToCLabel primop "closure") case m of Just (Ptr addr) -> case addrToHValue# addr of - (# hval #) -> do addCAF hval - return hval + (# hval #) -> return hval Nothing -> pprPanic "ByteCodeGen.lookupCE(primop)" (ppr primop) lookupCE ce (Left nm) = case lookupFM ce nm of @@ -485,8 +475,7 @@ lookupCE ce (Left nm) -> do m <- lookupSymbol (nameToCLabel nm "closure") case m of Just (Ptr addr) -> case addrToHValue# addr of - (# hval #) -> do addCAF hval - return hval + (# hval #) -> return hval Nothing -> pprPanic "ByteCodeGen.lookupCE" (ppr nm) lookupIE :: ItblEnv -> Name -> IO (Ptr a) |