projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement #2191 (traceCcs# -- prints CCS of a value when available -- take 3)
[ghc-hetmet.git]
/
rts
/
Stable.c
diff --git
a/rts/Stable.c
b/rts/Stable.c
index
0ed18bc
..
94a756a
100644
(file)
--- a/
rts/Stable.c
+++ b/
rts/Stable.c
@@
-6,9
+6,6
@@
*
* ---------------------------------------------------------------------------*/
*
* ---------------------------------------------------------------------------*/
-// Make static versions of inline functions in Stable.h:
-#define RTS_STABLE_C
-
#include "PosixSource.h"
#include "Rts.h"
#include "Hash.h"
#include "PosixSource.h"
#include "Rts.h"
#include "Hash.h"
@@
-195,9
+192,11
@@
removeIndirections(StgClosure* p)
get_itbl(q)->type == IND_OLDGEN ||
get_itbl(q)->type == IND_PERM ||
get_itbl(q)->type == IND_OLDGEN_PERM ) {
get_itbl(q)->type == IND_OLDGEN ||
get_itbl(q)->type == IND_PERM ||
get_itbl(q)->type == IND_OLDGEN_PERM ) {
+ q = ((StgInd *)q)->indirectee;
tag = GET_CLOSURE_TAG(q);
tag = GET_CLOSURE_TAG(q);
- q = UNTAG_CLOSURE(((StgInd *)q)->indirectee);
+ q = UNTAG_CLOSURE(q);
}
}
+
return TAG_CLOSURE(tag,q);
}
return TAG_CLOSURE(tag,q);
}
@@
-216,6
+215,9
@@
lookupStableName_(StgPtr p)
*/
p = (StgPtr)removeIndirections((StgClosure*)p);
*/
p = (StgPtr)removeIndirections((StgClosure*)p);
+ // register the untagged pointer. This just makes things simpler.
+ p = (StgPtr)UNTAG_CLOSURE((StgClosure*)p);
+
sn_tmp = lookupHashTable(addrToStableHash,(W_)p);
sn = (StgWord)sn_tmp;
sn_tmp = lookupHashTable(addrToStableHash,(W_)p);
sn = (StgWord)sn_tmp;
@@
-321,7
+323,7
@@
enlargeStablePtrTable(void)
* -------------------------------------------------------------------------- */
void
* -------------------------------------------------------------------------- */
void
-markStablePtrTable(evac_fn evac)
+markStablePtrTable(evac_fn evac, void *user)
{
snEntry *p, *end_stable_ptr_table;
StgPtr q;
{
snEntry *p, *end_stable_ptr_table;
StgPtr q;
@@
-345,7
+347,7
@@
markStablePtrTable(evac_fn evac)
// if the ref is non-zero, treat addr as a root
if (p->ref != 0) {
// if the ref is non-zero, treat addr as a root
if (p->ref != 0) {
- evac((StgClosure **)&p->addr);
+ evac(user, (StgClosure **)&p->addr);
}
}
}
}
}
}
@@
-360,7
+362,7
@@
markStablePtrTable(evac_fn evac)
* -------------------------------------------------------------------------- */
void
* -------------------------------------------------------------------------- */
void
-threadStablePtrTable( evac_fn evac )
+threadStablePtrTable( evac_fn evac, void *user )
{
snEntry *p, *end_stable_ptr_table;
StgPtr q;
{
snEntry *p, *end_stable_ptr_table;
StgPtr q;
@@
-370,12
+372,12
@@
threadStablePtrTable( evac_fn evac )
for (p = stable_ptr_table+1; p < end_stable_ptr_table; p++) {
if (p->sn_obj != NULL) {
for (p = stable_ptr_table+1; p < end_stable_ptr_table; p++) {
if (p->sn_obj != NULL) {
- evac((StgClosure **)&p->sn_obj);
+ evac(user, (StgClosure **)&p->sn_obj);
}
q = p->addr;
if (q && (q < (P_)stable_ptr_table || q >= (P_)end_stable_ptr_table)) {
}
q = p->addr;
if (q && (q < (P_)stable_ptr_table || q >= (P_)end_stable_ptr_table)) {
- evac((StgClosure **)&p->addr);
+ evac(user, (StgClosure **)&p->addr);
}
}
}
}
}
}