summaryrefslogtreecommitdiff
path: root/rts/Compact.cmm
diff options
context:
space:
mode:
authorSergei Trofimovich <siarheit@google.com>2016-12-17 13:39:18 +0000
committerSergei Trofimovich <siarheit@google.com>2016-12-17 16:48:19 +0000
commitc4808602124577217dbd39576c120a77f923ca6f (patch)
treedbbd9415dd1c73ff84bf25b4fe700325018c3137 /rts/Compact.cmm
parenta6657bd0d6b9949098021d89ed3cd8a943bdd3b6 (diff)
downloadhaskell-c4808602124577217dbd39576c120a77f923ca6f.tar.gz
rts/Compact.cmm: fix UNREG build failure
The change does the following: - Add explicit declaration of exception closures from base. C backend needs those symbols to be visible. - Reorder cmm functions in use order. Again C backend needs symbol declaration/definition before use. even for module-local cmm functions. Fixes the following build failure: rts_dist_HC rts/dist/build/Compact.o In file included from /tmp/ghc3348_0/ghc_4.hc:3:0: error: /tmp/ghc3348_0/ghc_4.hc: In function 'stg_compactAddWithSharingzh': /tmp/ghc3348_0/ghc_4.hc:27:11: error: error: 'stg_compactAddWorkerzh' undeclared (first use in this function) JMP_((W_)&stg_compactAddWorkerzh); ^ ... /tmp/ghc3348_0/ghc_4.hc:230:13: error: error: 'base_GHCziIOziException_cannotCompactMutable_closure' undeclared (first use in this function) R1.w = (W_)&base_GHCziIOziException_cannotCompactMutable_closure; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Diffstat (limited to 'rts/Compact.cmm')
-rw-r--r--rts/Compact.cmm109
1 files changed, 55 insertions, 54 deletions
diff --git a/rts/Compact.cmm b/rts/Compact.cmm
index fe54d2ad39..0b98f39042 100644
--- a/rts/Compact.cmm
+++ b/rts/Compact.cmm
@@ -10,60 +10,9 @@
#include "Cmm.h"
#include "sm/ShouldCompact.h"
-
-//
-// compactAddWithSharing#
-// :: State# RealWorld
-// -> Compact#
-// -> a
-// -> (# State# RealWorld, a #)
-//
-stg_compactAddWithSharingzh (P_ compact, P_ p)
-{
- W_ hash;
- ASSERT(StgCompactNFData_hash(compact) == NULL);
- (hash) = ccall allocHashTable();
- StgCompactNFData_hash(compact) = hash;
-
- // Note [compactAddWorker result]
- //
- // compactAddWorker needs somewhere to store the result - this is
- // so that it can be tail-recursive. It must be an address that
- // doesn't move during GC, so we can't use heap or stack.
- // Therefore we have a special field in the StgCompactNFData
- // object to hold the final result of compaction.
- W_ pp;
- pp = compact + SIZEOF_StgHeader + OFFSET_StgCompactNFData_result;
- call stg_compactAddWorkerzh(compact, p, pp);
- ccall freeHashTable(StgCompactNFData_hash(compact), NULL);
- StgCompactNFData_hash(compact) = NULL;
-#ifdef DEBUG
- ccall verifyCompact(compact);
-#endif
- return (P_[pp]);
-}
-
-
-//
-// compactAdd#
-// :: State# RealWorld
-// -> Compact#
-// -> a
-// -> (# State# RealWorld, a #)
-//
-stg_compactAddzh (P_ compact, P_ p)
-{
- ASSERT(StgCompactNFData_hash(compact) == NULL);
-
- W_ pp; // See Note [compactAddWorker result]
- pp = compact + SIZEOF_StgHeader + OFFSET_StgCompactNFData_result;
- call stg_compactAddWorkerzh(compact, p, pp);
-#ifdef DEBUG
- ccall verifyCompact(compact);
-#endif
- return (P_[pp]);
-}
-
+import CLOSURE base_GHCziIOziException_cannotCompactFunction_closure;
+import CLOSURE base_GHCziIOziException_cannotCompactMutable_closure;
+import CLOSURE base_GHCziIOziException_cannotCompactPinned_closure;
//
// Allocate space for a new object in the compact region. We first try
@@ -310,6 +259,58 @@ eval:
ccall barf("stg_compactWorkerzh");
}
+//
+// compactAddWithSharing#
+// :: State# RealWorld
+// -> Compact#
+// -> a
+// -> (# State# RealWorld, a #)
+//
+stg_compactAddWithSharingzh (P_ compact, P_ p)
+{
+ W_ hash;
+ ASSERT(StgCompactNFData_hash(compact) == NULL);
+ (hash) = ccall allocHashTable();
+ StgCompactNFData_hash(compact) = hash;
+
+ // Note [compactAddWorker result]
+ //
+ // compactAddWorker needs somewhere to store the result - this is
+ // so that it can be tail-recursive. It must be an address that
+ // doesn't move during GC, so we can't use heap or stack.
+ // Therefore we have a special field in the StgCompactNFData
+ // object to hold the final result of compaction.
+ W_ pp;
+ pp = compact + SIZEOF_StgHeader + OFFSET_StgCompactNFData_result;
+ call stg_compactAddWorkerzh(compact, p, pp);
+ ccall freeHashTable(StgCompactNFData_hash(compact), NULL);
+ StgCompactNFData_hash(compact) = NULL;
+#ifdef DEBUG
+ ccall verifyCompact(compact);
+#endif
+ return (P_[pp]);
+}
+
+//
+// compactAdd#
+// :: State# RealWorld
+// -> Compact#
+// -> a
+// -> (# State# RealWorld, a #)
+//
+stg_compactAddzh (P_ compact, P_ p)
+{
+ ASSERT(StgCompactNFData_hash(compact) == NULL);
+
+ W_ pp; // See Note [compactAddWorker result]
+ pp = compact + SIZEOF_StgHeader + OFFSET_StgCompactNFData_result;
+ call stg_compactAddWorkerzh(compact, p, pp);
+#ifdef DEBUG
+ ccall verifyCompact(compact);
+#endif
+ return (P_[pp]);
+}
+
stg_compactSizzezh (P_ compact)
{
return (StgCompactNFData_totalW(compact) * SIZEOF_W);