summaryrefslogtreecommitdiff
path: root/ghc/compiler/ghci/ByteCodeLink.lhs
diff options
context:
space:
mode:
authorsewardj <unknown>2001-08-03 15:11:10 +0000
committersewardj <unknown>2001-08-03 15:11:10 +0000
commitdaf8e15b8dcad8808ad068c3b93ee5fe99ece5bf (patch)
treec3eb7b210f88d89fd4b35e22fa2ac6a79f6bf22a /ghc/compiler/ghci/ByteCodeLink.lhs
parent593c27ba9d4a5d7d7880ff7b17723da47d6d22b4 (diff)
downloadhaskell-daf8e15b8dcad8808ad068c3b93ee5fe99ece5bf.tar.gz
[project @ 2001-08-03 15:11:10 by sewardj]
Fix enough bugs/incompletenesses so that foreign import (static) works fairly well on x86. Still ToDo: * f-i dynamic * save/restore GC/thread context around calls * stdcall support * pass/return of 64-bit integral quantities on x86 * sparc implementation
Diffstat (limited to 'ghc/compiler/ghci/ByteCodeLink.lhs')
-rw-r--r--ghc/compiler/ghci/ByteCodeLink.lhs40
1 files changed, 22 insertions, 18 deletions
diff --git a/ghc/compiler/ghci/ByteCodeLink.lhs b/ghc/compiler/ghci/ByteCodeLink.lhs
index 8aecbe28af..50d01254dd 100644
--- a/ghc/compiler/ghci/ByteCodeLink.lhs
+++ b/ghc/compiler/ghci/ByteCodeLink.lhs
@@ -322,32 +322,36 @@ mkBits findLabel st proto_insns
literal st (MachFloat r) = float st (fromRational r)
literal st (MachDouble r) = double st (fromRational r)
literal st (MachChar c) = int st c
- literal st other = pprPanic "ByteCodeLink.mkBits" (ppr other)
+ literal st other = pprPanic "ByteCodeLink.literal" (ppr other)
ctoi_itbl st pk
= addr st ret_itbl_addr
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
- CharRep -> stg_ctoi_ret_R1n_info
- FloatRep -> stg_ctoi_ret_F1_info
- DoubleRep -> stg_ctoi_ret_D1_info
- VoidRep -> stg_ctoi_ret_V_info
- _ -> pprPanic "mkBits.ctoi_itbl" (ppr pk)
+ 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
+ CharRep -> 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)
itoc_itbl st pk
= addr st ret_itbl_addr
where
- ret_itbl_addr = case pk of
- CharRep -> stg_gc_unbx_r1_ret_info
- IntRep -> stg_gc_unbx_r1_ret_info
- FloatRep -> stg_gc_f1_ret_info
- DoubleRep -> stg_gc_d1_ret_info
- VoidRep -> nullAddr
- -- Interpreter.c spots this special case
+ ret_itbl_addr
+ = case pk of
+ CharRep -> stg_gc_unbx_r1_ret_info
+ IntRep -> stg_gc_unbx_r1_ret_info
+ AddrRep -> stg_gc_unbx_r1_ret_info
+ FloatRep -> stg_gc_f1_ret_info
+ DoubleRep -> stg_gc_d1_ret_info
+ VoidRep -> nullAddr
+ -- Interpreter.c spots this special case
+ other -> pprPanic "ByteCodeLink.itoc_itbl" (ppr pk)
foreign label "stg_ctoi_ret_R1p_info" stg_ctoi_ret_R1p_info :: Addr
foreign label "stg_ctoi_ret_R1n_info" stg_ctoi_ret_R1n_info :: Addr