[project @ 2001-02-06 14:01:22 by simonmar]
[ghc-hetmet.git] / ghc / compiler / ghci / ByteCodeLink.lhs
1 %
2 % (c) The University of Glasgow 2000
3 %
4 \section[ByteCodeLink]{Bytecode assembler and linker}
5
6 \begin{code}
7 module ByteCodeLink ( UnlinkedBCO, UnlinkedBCOExpr, assembleBCO,
8                       ClosureEnv, HValue, linkSomeBCOs, filterNameMap,
9                       iNTERP_STACK_CHECK_THRESH
10                    ) where
11
12 #include "HsVersions.h"
13
14 import Outputable
15 import Name             ( Name, getName, nameModule, toRdrName, isGlobalName )
16 import RdrName          ( rdrNameOcc, rdrNameModule )
17 import OccName          ( occNameString )
18 import FiniteMap        ( FiniteMap, addListToFM, filterFM,
19                           addToFM, lookupFM, emptyFM )
20 import CoreSyn
21 import Literal          ( Literal(..) )
22 import PrimOp           ( PrimOp, primOpOcc )
23 import PrimRep          ( PrimRep(..) )
24 import Constants        ( wORD_SIZE )
25 import Module           ( ModuleName, moduleName, moduleNameFS )
26 import Linker           ( lookupSymbol )
27 import FastString       ( FastString(..) )
28 import ByteCodeInstr    ( BCInstr(..), ProtoBCO(..) )
29 import ByteCodeItbls    ( ItblEnv, ItblPtr )
30
31
32 import Monad            ( foldM )
33 import ST               ( runST )
34 import MArray           ( castSTUArray, 
35                           newFloatArray, writeFloatArray,
36                           newDoubleArray, writeDoubleArray,
37                           newIntArray, writeIntArray,
38                           newAddrArray, writeAddrArray )
39 import Foreign          ( Word16, Ptr(..) )
40 import Addr             ( Word, Addr )
41
42 import PrelBase         ( Int(..) )
43 import PrelGHC          ( BCO#, newBCO#, unsafeCoerce#, 
44                           ByteArray#, Array#, addrToHValue#, mkApUpd0# )
45 import IOExts           ( fixIO )
46 import ArrayBase        
47 import PrelArr          ( Array(..) )
48 import PrelIOBase       ( IO(..) )
49
50 \end{code}
51
52 %************************************************************************
53 %*                                                                      *
54 \subsection{Top-level stuff}
55 %*                                                                      *
56 %************************************************************************
57
58 \begin{code}
59
60 -- Link a bunch of BCOs and return them + updated closure env.
61 linkSomeBCOs :: Bool    -- False <=> add _all_ BCOs to returned closure env
62                         -- True  <=> add only toplevel BCOs to closure env
63              -> ItblEnv 
64              -> ClosureEnv 
65              -> [UnlinkedBCO]
66              -> IO (ClosureEnv, [HValue])
67 linkSomeBCOs toplevs_only ie ce_in ul_bcos
68    = do let nms = map nameOfUnlinkedBCO ul_bcos
69         hvals <- fixIO 
70                     ( \ hvs -> let ce_out = addListToFM ce_in (zipLazily nms hvs)
71                                in  mapM (linkBCO ie ce_out) ul_bcos )
72
73         let ce_all_additions = zip nms hvals
74             ce_top_additions = filter (isGlobalName.fst) ce_all_additions
75             ce_additions     = if toplevs_only then ce_top_additions 
76                                                else ce_all_additions
77             ce_out = addListToFM ce_in ce_additions
78         return (ce_out, hvals)
79      where
80         -- A lazier zip, in which no demand is propagated to the second
81         -- list unless some demand is propagated to the snd of one of the
82         -- result list elems.
83         zipLazily []     ys = []
84         zipLazily (x:xs) ys = (x, head ys) : zipLazily xs (tail ys)
85
86
87 data UnlinkedBCO
88    = UnlinkedBCO Name
89                  (SizedSeq Word16)               -- insns
90                  (SizedSeq Word)                 -- literals
91                  (SizedSeq (Either Name PrimOp)) -- ptrs
92                  (SizedSeq Name)                 -- itbl refs
93
94 nameOfUnlinkedBCO (UnlinkedBCO nm _ _ _ _) = nm
95
96 -- When translating expressions, we need to distinguish the root
97 -- BCO for the expression
98 type UnlinkedBCOExpr = (UnlinkedBCO, [UnlinkedBCO])
99
100 instance Outputable UnlinkedBCO where
101    ppr (UnlinkedBCO nm insns lits ptrs itbls)
102       = sep [text "BCO", ppr nm, text "with", 
103              int (sizeSS insns), text "insns",
104              int (sizeSS lits), text "lits",
105              int (sizeSS ptrs), text "ptrs",
106              int (sizeSS itbls), text "itbls"]
107
108
109 -- these need a proper home
110 type ClosureEnv = FiniteMap Name HValue
111 data HValue     = HValue  -- dummy type, actually a pointer to some Real Code.
112
113 -- remove all entries for a given set of modules from the environment
114 filterNameMap :: [ModuleName] -> FiniteMap Name a -> FiniteMap Name a
115 filterNameMap mods env 
116    = filterFM (\n _ -> moduleName (nameModule n) `elem` mods) env
117 \end{code}
118
119 %************************************************************************
120 %*                                                                      *
121 \subsection{The bytecode assembler}
122 %*                                                                      *
123 %************************************************************************
124
125 The object format for bytecodes is: 16 bits for the opcode, and 16 for
126 each field -- so the code can be considered a sequence of 16-bit ints.
127 Each field denotes either a stack offset or number of items on the
128 stack (eg SLIDE), and index into the pointer table (eg PUSH_G), an
129 index into the literal table (eg PUSH_I/D/L), or a bytecode address in
130 this BCO.
131
132 \begin{code}
133 -- Top level assembler fn.
134 assembleBCO :: ProtoBCO Name -> IO UnlinkedBCO
135
136 assembleBCO (ProtoBCO nm instrs origin)
137    = let
138          -- pass 1: collect up the offsets of the local labels.
139          -- Remember that the first insn starts at offset 1 since offset 0
140          -- (eventually) will hold the total # of insns.
141          label_env = mkLabelEnv emptyFM 1 instrs
142
143          mkLabelEnv env i_offset [] = env
144          mkLabelEnv env i_offset (i:is)
145             = let new_env 
146                      = case i of LABEL n -> addToFM env n i_offset ; _ -> env
147               in  mkLabelEnv new_env (i_offset + instrSize16s i) is
148
149          findLabel lab
150             = case lookupFM label_env lab of
151                  Just bco_offset -> bco_offset
152                  Nothing -> pprPanic "assembleBCO.findLabel" (int lab)
153      in
154      do  -- pass 2: generate the instruction, ptr and nonptr bits
155          insns <- return emptySS :: IO (SizedSeq Word16)
156          lits  <- return emptySS :: IO (SizedSeq Word)
157          ptrs  <- return emptySS :: IO (SizedSeq (Either Name PrimOp))
158          itbls <- return emptySS :: IO (SizedSeq Name)
159          let init_asm_state = (insns,lits,ptrs,itbls)
160          (final_insns, final_lits, final_ptrs, final_itbls) 
161             <- mkBits findLabel init_asm_state instrs         
162
163          return (UnlinkedBCO nm final_insns final_lits final_ptrs final_itbls)
164
165 -- instrs nonptrs ptrs itbls
166 type AsmState = (SizedSeq Word16, SizedSeq Word, 
167                  SizedSeq (Either Name PrimOp), SizedSeq Name)
168
169 data SizedSeq a = SizedSeq !Int [a]
170 emptySS = SizedSeq 0 []
171 addToSS (SizedSeq n r_xs) x = return (SizedSeq (n+1) (x:r_xs))
172 addListToSS (SizedSeq n r_xs) xs 
173    = return (SizedSeq (n + length xs) (reverse xs ++ r_xs))
174 sizeSS (SizedSeq n r_xs) = n
175 listFromSS (SizedSeq n r_xs) = return (reverse r_xs)
176
177
178 -- This is where all the action is (pass 2 of the assembler)
179 mkBits :: (Int -> Int)                  -- label finder
180        -> AsmState
181        -> [BCInstr]                     -- instructions (in)
182        -> IO AsmState
183
184 mkBits findLabel st proto_insns
185   = foldM doInstr st proto_insns
186     where
187        doInstr :: AsmState -> BCInstr -> IO AsmState
188        doInstr st i
189           = case i of
190                ARGCHECK  n        -> instr2 st i_ARGCHECK n
191                STKCHECK  n        -> instr2 st i_STKCHECK n
192                PUSH_L    o1       -> instr2 st i_PUSH_L o1
193                PUSH_LL   o1 o2    -> instr3 st i_PUSH_LL o1 o2
194                PUSH_LLL  o1 o2 o3 -> instr4 st i_PUSH_LLL o1 o2 o3
195                PUSH_G    nm       -> do (p, st2) <- ptr st nm
196                                         instr2 st2 i_PUSH_G p
197                PUSH_AS   nm pk    -> do (p, st2)  <- ptr st (Left nm)
198                                         (np, st3) <- ctoi_itbl st2 pk
199                                         instr3 st3 i_PUSH_AS p np
200                PUSH_UBX  lit nws  -> do (np, st2) <- literal st lit
201                                         instr3 st2 i_PUSH_UBX np nws
202                PUSH_TAG  tag      -> instr2 st i_PUSH_TAG tag
203                SLIDE     n by     -> instr3 st i_SLIDE n by
204                ALLOC     n        -> instr2 st i_ALLOC n
205                MKAP      off sz   -> instr3 st i_MKAP off sz
206                UNPACK    n        -> instr2 st i_UNPACK n
207                UPK_TAG   n m k    -> instr4 st i_UPK_TAG n m k
208                PACK      dcon sz  -> do (itbl_no,st2) <- itbl st dcon
209                                         instr3 st2 i_PACK itbl_no sz
210                LABEL     lab      -> return st
211                TESTLT_I  i l      -> do (np, st2) <- int st i
212                                         instr3 st2 i_TESTLT_I np (findLabel l)
213                TESTEQ_I  i l      -> do (np, st2) <- int st i
214                                         instr3 st2 i_TESTEQ_I np (findLabel l)
215                TESTLT_F  f l      -> do (np, st2) <- float st f
216                                         instr3 st2 i_TESTLT_F np (findLabel l)
217                TESTEQ_F  f l      -> do (np, st2) <- float st f
218                                         instr3 st2 i_TESTEQ_F np (findLabel l)
219                TESTLT_D  d l      -> do (np, st2) <- double st d
220                                         instr3 st2 i_TESTLT_D np (findLabel l)
221                TESTEQ_D  d l      -> do (np, st2) <- double st d
222                                         instr3 st2 i_TESTEQ_D np (findLabel l)
223                TESTLT_P  i l      -> instr3 st i_TESTLT_P i (findLabel l)
224                TESTEQ_P  i l      -> instr3 st i_TESTEQ_P i (findLabel l)
225                CASEFAIL           -> instr1 st i_CASEFAIL
226                ENTER              -> instr1 st i_ENTER
227                RETURN rep         -> do (itbl_no,st2) <- itoc_itbl st rep
228                                         instr2 st2 i_RETURN itbl_no
229
230        i2s :: Int -> Word16
231        i2s = fromIntegral
232
233        instr1 (st_i0,st_l0,st_p0,st_I0) i1
234           = do st_i1 <- addToSS st_i0 (i2s i1)
235                return (st_i1,st_l0,st_p0,st_I0)
236
237        instr2 (st_i0,st_l0,st_p0,st_I0) i1 i2
238           = do st_i1 <- addToSS st_i0 (i2s i1)
239                st_i2 <- addToSS st_i1 (i2s i2)
240                return (st_i2,st_l0,st_p0,st_I0)
241
242        instr3 (st_i0,st_l0,st_p0,st_I0) i1 i2 i3
243           = do st_i1 <- addToSS st_i0 (i2s i1)
244                st_i2 <- addToSS st_i1 (i2s i2)
245                st_i3 <- addToSS st_i2 (i2s i3)
246                return (st_i3,st_l0,st_p0,st_I0)
247
248        instr4 (st_i0,st_l0,st_p0,st_I0) i1 i2 i3 i4
249           = do st_i1 <- addToSS st_i0 (i2s i1)
250                st_i2 <- addToSS st_i1 (i2s i2)
251                st_i3 <- addToSS st_i2 (i2s i3)
252                st_i4 <- addToSS st_i3 (i2s i4)
253                return (st_i4,st_l0,st_p0,st_I0)
254
255        float (st_i0,st_l0,st_p0,st_I0) f
256           = do let ws = mkLitF f
257                st_l1 <- addListToSS st_l0 ws
258                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
259
260        double (st_i0,st_l0,st_p0,st_I0) d
261           = do let ws = mkLitD d
262                st_l1 <- addListToSS st_l0 ws
263                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
264
265        int (st_i0,st_l0,st_p0,st_I0) i
266           = do let ws = mkLitI i
267                st_l1 <- addListToSS st_l0 ws
268                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
269
270        addr (st_i0,st_l0,st_p0,st_I0) a
271           = do let ws = mkLitA a
272                st_l1 <- addListToSS st_l0 ws
273                return (sizeSS st_l0, (st_i0,st_l1,st_p0,st_I0))
274
275        ptr (st_i0,st_l0,st_p0,st_I0) p
276           = do st_p1 <- addToSS st_p0 p
277                return (sizeSS st_p0, (st_i0,st_l0,st_p1,st_I0))
278
279        itbl (st_i0,st_l0,st_p0,st_I0) dcon
280           = do st_I1 <- addToSS st_I0 (getName dcon)
281                return (sizeSS st_I0, (st_i0,st_l0,st_p0,st_I1))
282
283        literal st (MachWord w)   = int st (fromIntegral w)
284        literal st (MachInt j)    = int st (fromIntegral j)
285        literal st (MachFloat r)  = float st (fromRational r)
286        literal st (MachDouble r) = double st (fromRational r)
287        literal st (MachChar c)   = int st c
288
289        ctoi_itbl st pk
290           = addr st ret_itbl_addr
291             where
292                ret_itbl_addr = case pk of
293                                   PtrRep    -> stg_ctoi_ret_R1p_info
294                                   WordRep   -> stg_ctoi_ret_R1n_info
295                                   IntRep    -> stg_ctoi_ret_R1n_info
296                                   AddrRep   -> stg_ctoi_ret_R1n_info
297                                   CharRep   -> stg_ctoi_ret_R1n_info
298                                   FloatRep  -> stg_ctoi_ret_F1_info
299                                   DoubleRep -> stg_ctoi_ret_D1_info
300                                   _ -> pprPanic "mkBits.ctoi_itbl" (ppr pk)
301
302        itoc_itbl st pk
303           = addr st ret_itbl_addr
304             where
305                ret_itbl_addr = case pk of
306                                   CharRep   -> stg_gc_unbx_r1_info
307                                   IntRep    -> stg_gc_unbx_r1_info
308                                   FloatRep  -> stg_gc_f1_info
309                                   DoubleRep -> stg_gc_d1_info
310                      
311 foreign label "stg_ctoi_ret_R1p_info" stg_ctoi_ret_R1p_info :: Addr
312 foreign label "stg_ctoi_ret_R1n_info" stg_ctoi_ret_R1n_info :: Addr
313 foreign label "stg_ctoi_ret_F1_info"  stg_ctoi_ret_F1_info :: Addr
314 foreign label "stg_ctoi_ret_D1_info"  stg_ctoi_ret_D1_info :: Addr
315
316 foreign label "stg_gc_unbx_r1_info" stg_gc_unbx_r1_info :: Addr
317 foreign label "stg_gc_f1_info"      stg_gc_f1_info :: Addr
318 foreign label "stg_gc_d1_info"      stg_gc_d1_info :: Addr
319
320 -- The size in 16-bit entities of an instruction.
321 instrSize16s :: BCInstr -> Int
322 instrSize16s instr
323    = case instr of
324         STKCHECK _     -> 2
325         ARGCHECK _     -> 2
326         PUSH_L   _     -> 2
327         PUSH_LL  _ _   -> 3
328         PUSH_LLL _ _ _ -> 4
329         PUSH_G   _     -> 2
330         PUSH_AS  _ _   -> 3
331         PUSH_UBX _ _   -> 3
332         PUSH_TAG _     -> 2
333         SLIDE    _ _   -> 3
334         ALLOC    _     -> 2
335         MKAP     _ _   -> 3
336         UNPACK   _     -> 2
337         UPK_TAG  _ _ _ -> 4
338         PACK     _ _   -> 3
339         LABEL    _     -> 0     -- !!
340         TESTLT_I _ _   -> 3
341         TESTEQ_I _ _   -> 3
342         TESTLT_F _ _   -> 3
343         TESTEQ_F _ _   -> 3
344         TESTLT_D _ _   -> 3
345         TESTEQ_D _ _   -> 3
346         TESTLT_P _ _   -> 3
347         TESTEQ_P _ _   -> 3
348         CASEFAIL       -> 1
349         ENTER          -> 1
350         RETURN   _     -> 2
351
352
353 -- Make lists of host-sized words for literals, so that when the
354 -- words are placed in memory at increasing addresses, the
355 -- bit pattern is correct for the host's word size and endianness.
356 mkLitI :: Int    -> [Word]
357 mkLitF :: Float  -> [Word]
358 mkLitD :: Double -> [Word]
359 mkLitA :: Addr   -> [Word]
360
361 mkLitF f
362    = runST (do
363         arr <- newFloatArray ((0::Int),0)
364         writeFloatArray arr 0 f
365         f_arr <- castSTUArray arr
366         w0 <- readWordArray f_arr 0
367         return [w0]
368      )
369
370 mkLitD d
371    | wORD_SIZE == 4
372    = runST (do
373         arr <- newDoubleArray ((0::Int),1)
374         writeDoubleArray arr 0 d
375         d_arr <- castSTUArray arr
376         w0 <- readWordArray d_arr 0
377         w1 <- readWordArray d_arr 1
378         return [w0,w1]
379      )
380    | wORD_SIZE == 8
381    = runST (do
382         arr <- newDoubleArray ((0::Int),0)
383         writeDoubleArray arr 0 d
384         d_arr <- castSTUArray arr
385         w0 <- readWordArray d_arr 0
386         return [w0]
387      )
388
389 mkLitI i
390    = runST (do
391         arr <- newIntArray ((0::Int),0)
392         writeIntArray arr 0 i
393         i_arr <- castSTUArray arr
394         w0 <- readWordArray i_arr 0
395         return [w0]
396      )
397
398 mkLitA a
399    = runST (do
400         arr <- newAddrArray ((0::Int),0)
401         writeAddrArray arr 0 a
402         a_arr <- castSTUArray arr
403         w0 <- readWordArray a_arr 0
404         return [w0]
405      )
406
407 \end{code}
408
409 %************************************************************************
410 %*                                                                      *
411 \subsection{Linking interpretables into something we can run}
412 %*                                                                      *
413 %************************************************************************
414
415 \begin{code}
416
417 {- 
418 data BCO# = BCO# ByteArray#             -- instrs   :: array Word16#
419                  ByteArray#             -- literals :: array Word32#
420                  PtrArray#              -- ptrs     :: Array HValue
421                  ByteArray#             -- itbls    :: Array Addr#
422 -}
423
424 linkBCO ie ce (UnlinkedBCO nm insnsSS literalsSS ptrsSS itblsSS)
425    = do insns    <- listFromSS insnsSS
426         literals <- listFromSS literalsSS
427         ptrs     <- listFromSS ptrsSS
428         itbls    <- listFromSS itblsSS
429
430         linked_ptrs  <- mapM (lookupCE ce) ptrs
431         linked_itbls <- mapM (lookupIE ie) itbls
432
433         let n_insns    = sizeSS insnsSS
434             n_literals = sizeSS literalsSS
435             n_ptrs     = sizeSS ptrsSS
436             n_itbls    = sizeSS itblsSS
437
438         let ptrs_arr = array (0, n_ptrs-1) (indexify linked_ptrs)
439                        :: Array Int HValue
440             ptrs_parr = case ptrs_arr of Array lo hi parr -> parr
441
442             itbls_arr = array (0, n_itbls-1) (indexify linked_itbls)
443                         :: UArray Int ItblPtr
444             itbls_barr = case itbls_arr of UArray lo hi barr -> barr
445
446             insns_arr | n_insns > 65535
447                       = panic "linkBCO: >= 64k insns in BCO"
448                       | otherwise 
449                       = array (0, n_insns) 
450                               (indexify (fromIntegral n_insns:insns))
451                         :: UArray Int Word16
452             insns_barr = case insns_arr of UArray lo hi barr -> barr
453
454             literals_arr = array (0, n_literals-1) (indexify literals)
455                            :: UArray Int Word
456             literals_barr = case literals_arr of UArray lo hi barr -> barr
457
458             indexify :: [a] -> [(Int, a)]
459             indexify xs = zip [0..] xs
460
461         BCO bco# <- newBCO insns_barr literals_barr ptrs_parr itbls_barr
462
463         -- WAS: return (unsafeCoerce# bco#)
464         case mkApUpd0# (unsafeCoerce# bco#) of
465            (# final_bco #) -> return final_bco
466
467
468 data BCO = BCO BCO#
469
470 newBCO :: ByteArray# -> ByteArray# -> Array# a -> ByteArray# -> IO BCO
471 newBCO a b c d
472    = IO (\s -> case newBCO# a b c d s of (# s1, bco #) -> (# s1, BCO bco #))
473
474
475 lookupCE :: ClosureEnv -> Either Name PrimOp -> IO HValue
476 lookupCE ce (Right primop)
477    = do m <- lookupSymbol (primopToCLabel primop "closure")
478         case m of
479            Just (Ptr addr) -> case addrToHValue# addr of
480                                  (# hval #) -> return hval
481            Nothing -> pprPanic "ByteCodeGen.lookupCE(primop)" (ppr primop)
482 lookupCE ce (Left nm)
483    = case lookupFM ce nm of
484         Just aa -> return aa
485         Nothing 
486            -> do m <- lookupSymbol (nameToCLabel nm "closure")
487                  case m of
488                     Just (Ptr addr) -> case addrToHValue# addr of
489                                           (# hval #) -> return hval
490                     Nothing        -> pprPanic "ByteCodeGen.lookupCE" (ppr nm)
491
492 lookupIE :: ItblEnv -> Name -> IO (Ptr a)
493 lookupIE ie con_nm 
494    = case lookupFM ie con_nm of
495         Just (Ptr a) -> return (Ptr a)
496         Nothing
497            -> do -- try looking up in the object files.
498                  m <- lookupSymbol (nameToCLabel con_nm "con_info")
499                  case m of
500                     Just addr -> return addr
501                     Nothing 
502                        -> do -- perhaps a nullary constructor?
503                              n <- lookupSymbol (nameToCLabel con_nm "static_info")
504                              case n of
505                                 Just addr -> return addr
506                                 Nothing -> pprPanic "ByteCodeGen.lookupIE" (ppr con_nm)
507
508 -- HACKS!!!  ToDo: cleaner
509 nameToCLabel :: Name -> String{-suffix-} -> String
510 nameToCLabel n suffix
511    = _UNPK_(moduleNameFS (rdrNameModule rn)) 
512      ++ '_':occNameString(rdrNameOcc rn) ++ '_':suffix
513      where rn = toRdrName n
514
515 primopToCLabel :: PrimOp -> String{-suffix-} -> String
516 primopToCLabel primop suffix
517    = let str = "PrelPrimopWrappers_" ++ occNameString (primOpOcc primop) ++ '_':suffix
518      in --trace ("primopToCLabel: " ++ str)
519         str
520
521 \end{code}
522
523 %************************************************************************
524 %*                                                                      *
525 \subsection{Connect to actual values for bytecode opcodes}
526 %*                                                                      *
527 %************************************************************************
528
529 \begin{code}
530
531 #include "Bytecodes.h"
532
533 i_ARGCHECK = (bci_ARGCHECK :: Int)
534 i_PUSH_L   = (bci_PUSH_L :: Int)
535 i_PUSH_LL  = (bci_PUSH_LL :: Int)
536 i_PUSH_LLL = (bci_PUSH_LLL :: Int)
537 i_PUSH_G   = (bci_PUSH_G :: Int)
538 i_PUSH_AS  = (bci_PUSH_AS :: Int)
539 i_PUSH_UBX = (bci_PUSH_UBX :: Int)
540 i_PUSH_TAG = (bci_PUSH_TAG :: Int)
541 i_SLIDE    = (bci_SLIDE :: Int)
542 i_ALLOC    = (bci_ALLOC :: Int)
543 i_MKAP     = (bci_MKAP :: Int)
544 i_UNPACK   = (bci_UNPACK :: Int)
545 i_UPK_TAG  = (bci_UPK_TAG :: Int)
546 i_PACK     = (bci_PACK :: Int)
547 i_TESTLT_I = (bci_TESTLT_I :: Int)
548 i_TESTEQ_I = (bci_TESTEQ_I :: Int)
549 i_TESTLT_F = (bci_TESTLT_F :: Int)
550 i_TESTEQ_F = (bci_TESTEQ_F :: Int)
551 i_TESTLT_D = (bci_TESTLT_D :: Int)
552 i_TESTEQ_D = (bci_TESTEQ_D :: Int)
553 i_TESTLT_P = (bci_TESTLT_P :: Int)
554 i_TESTEQ_P = (bci_TESTEQ_P :: Int)
555 i_CASEFAIL = (bci_CASEFAIL :: Int)
556 i_ENTER    = (bci_ENTER :: Int)
557 i_RETURN   = (bci_RETURN :: Int)
558 i_STKCHECK = (bci_STKCHECK :: Int)
559
560 iNTERP_STACK_CHECK_THRESH = (INTERP_STACK_CHECK_THRESH :: Int)
561
562 \end{code}