projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make the smp way RTS-only, normal libraries now work with -smp
[ghc-hetmet.git]
/
ghc
/
includes
/
Cmm.h
diff --git
a/ghc/includes/Cmm.h
b/ghc/includes/Cmm.h
index
e989a00
..
ea760a8
100644
(file)
--- a/
ghc/includes/Cmm.h
+++ b/
ghc/includes/Cmm.h
@@
-292,6
+292,8
@@
#error mp_limb_t != StgWord: assumptions in PrimOps.cmm are now false
#endif
#error mp_limb_t != StgWord: assumptions in PrimOps.cmm are now false
#endif
+#define MyCapability() (BaseReg - OFFSET_Capability_r)
+
/* -------------------------------------------------------------------------
Allocation and garbage collection
------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------
Allocation and garbage collection
------------------------------------------------------------------------- */
@@
-317,8
+319,11
@@
HP_CHK_GEN(alloc,liveness,reentry); \
TICK_ALLOC_HEAP_NOCTR(alloc);
HP_CHK_GEN(alloc,liveness,reentry); \
TICK_ALLOC_HEAP_NOCTR(alloc);
+// allocateLocal() allocates from the nursery, so we check to see
+// whether the nursery is nearly empty in any function that uses
+// allocateLocal() - this includes many of the primops.
#define MAYBE_GC(liveness,reentry) \
#define MAYBE_GC(liveness,reentry) \
- if (CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \
+ if (bdescr_link(CurrentNursery) == NULL || CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \
R9 = liveness; \
R10 = reentry; \
jump stg_gc_gen_hp; \
R9 = liveness; \
R10 = reentry; \
jump stg_gc_gen_hp; \
@@
-335,11
+340,7
@@
* the value from GHC, but it seems like too much trouble to do that
* for StgThunkHeader.
*/
* the value from GHC, but it seems like too much trouble to do that
* for StgThunkHeader.
*/
-#ifdef SMP
#define SIZEOF_StgThunkHeader SIZEOF_StgHeader+SIZEOF_StgSMPThunkHeader
#define SIZEOF_StgThunkHeader SIZEOF_StgHeader+SIZEOF_StgSMPThunkHeader
-#else
-#define SIZEOF_StgThunkHeader SIZEOF_StgHeader
-#endif
#define StgThunk_payload(__ptr__,__ix__) \
W_[__ptr__+SIZEOF_StgThunkHeader+ WDS(__ix__)]
#define StgThunk_payload(__ptr__,__ix__) \
W_[__ptr__+SIZEOF_StgThunkHeader+ WDS(__ix__)]