[move debugging routines to rts/profile.c
John Meacham <john@repetae.net>**20120217052015
 Ignore-this: d2e087faf6e3408dc135fd905d85244b
] hunk ./rts/rts/gc_jgc.c 146
-            gc_add_grey(&stack, sp);
+            gc_add_grey(&stack, (entry_t *)sp);
hunk ./rts/rts/gc_jgc.c 267
-#include "sys/bitarray.h"
-#include "sys/queue.h"
-
hunk ./rts/rts/gc_jgc.c 453
-/*
-static void
-s_free(void *val)
-{
-        assert(val);
-        struct s_block *pg = s_block(val);
-        unsigned int offset = ((uintptr_t *)val - (uintptr_t *)pg) - pg->pi.color;
-//        printf("s_free:  val: %p s_block: %p size: %i color: %i num_free: %i offset: %i bit: %i\n", val, pg, pg->pi.size, pg->pi.color, pg->num_free, offset, offset/pg->pi.size);
-        assert(BIT_VALUE(pg->used,offset/(pg->pi.size)));
-        BIT_UNSET(pg->used,offset/(pg->pi.size));
-        pg->num_free++;
-}
-*/
-
hunk ./rts/rts/jhc_rts.c 109
-
-#define BLACK_HOLE TO_FPTR(0xDEADBEE0)
-
-#if _JHC_DEBUG
-
-// these ensure the type synonyms are available to the debugger
-uintptr_t _dummy1;
-node_t *_dummy2;
-dnode_t *_dummy3;
-sptr_t *_dummy4;
-fptr_t *_dummy5;
-wptr_t *_dummy6;
-
-static bool A_UNUSED
-jhc_valid_whnf(wptr_t s)
-{
-        return ((GET_PTYPE(s) == P_VALUE) || ((GET_PTYPE(s) == P_WHNF) && jhc_malloc_sanity(s,P_WHNF)));
-}
-
-static bool A_UNUSED
-jhc_valid_lazy(sptr_t s)
-{
-        if(jhc_valid_whnf((wptr_t)s))
-                return true;
-        assert(GET_PTYPE(s) == P_LAZY);
-        node_t *ds = (node_t *)FROM_SPTR(s);
-        assert(jhc_malloc_sanity(ds,P_LAZY));
-        if(IS_LAZY(ds->head)) {
-                if(ds->head == BLACK_HOLE) return true;
-                assert(GET_PTYPE(ds->head) == P_FUNC);
-                return true;
-        } else
-                return jhc_valid_whnf((wptr_t)ds->head);
-}
-
-#else
-
-#define jhc_valid_whnf(x) true
-#define jhc_valid_lazy(x) true
-
-#endif
-
hunk ./rts/rts/jhc_rts.c 115
-// both promote and demote evaluate to nothing when debugging is not enabled
-// otherwise, they check that their arguments are in the correct form.
-
-#if _JHC_DEBUG
-wptr_t A_STD A_UNUSED
-promote(sptr_t s)
-{
-        assert(!IS_LAZY(s));
-        assert(jhc_valid_whnf((wptr_t)s));
-        return (wptr_t)s;
-}
-
-sptr_t A_STD A_UNUSED
-demote(wptr_t s)
-{
-        assert(!IS_LAZY(s));
-        assert(jhc_valid_whnf(s));
-        return (sptr_t)s;
-}
-#endif
-
hunk ./rts/rts/jhc_rts.c 163
-#if _JHC_DEBUG
-void A_STD A_UNUSED A_HOT
-update(void * thunk, wptr_t new)
-{
-        assert(GETHEAD(thunk) == BLACK_HOLE);
-        assert(!IS_LAZY(new));
-        GETHEAD(thunk) = (fptr_t)new;
-}
-#endif
-
hunk ./rts/rts/jhc_rts.h 68
+#define BLACK_HOLE TO_FPTR(0xDEADBEE0)
+
hunk ./rts/rts/jhc_rts.h 77
+// both promote and demote evaluate to nothing when debugging is not enabled
+// otherwise, they check that their arguments are in the correct form.
hunk ./rts/rts/jhc_rts.h 89
+#if _JHC_DEBUG && _JHC_GC == _JHC_GC_JGC
+bool jhc_valid_whnf(wptr_t s);
+bool jhc_valid_lazy(sptr_t s);
+#else
+#define jhc_valid_whnf(x) true
+#define jhc_valid_lazy(x) true
+#endif
hunk ./rts/rts/profile.c 1
+// profiling and debugging code.
+
hunk ./rts/rts/profile.c 17
-#include "rts/gc.h"
-#include "rts/cdefs.h"
-#include "rts/profile.h"
-#include "rts/rts_support.h"
+#include "jhc_rts_header.h"
hunk ./rts/rts/profile.c 149
+#endif
+
+#if _JHC_DEBUG  && _JHC_GC == _JHC_GC_JGC
+
+// these ensure the type synonyms are available to the debugger
+uintptr_t _dummy1;
+node_t *_dummy2;
+dnode_t *_dummy3;
+sptr_t *_dummy4;
+fptr_t *_dummy5;
+wptr_t *_dummy6;
+
+bool A_UNUSED
+jhc_valid_whnf(wptr_t s)
+{
+        return ((GET_PTYPE(s) == P_VALUE) || ((GET_PTYPE(s) == P_WHNF) && jhc_malloc_sanity(s,P_WHNF)));
+}
+
+bool A_UNUSED
+jhc_valid_lazy(sptr_t s)
+{
+        if(jhc_valid_whnf((wptr_t)s))
+                return true;
+        assert(GET_PTYPE(s) == P_LAZY);
+        node_t *ds = (node_t *)FROM_SPTR(s);
+        assert(jhc_malloc_sanity(ds,P_LAZY));
+        if(IS_LAZY(ds->head)) {
+                if(ds->head == BLACK_HOLE) return true;
+                assert(GET_PTYPE(ds->head) == P_FUNC);
+                return true;
+        } else
+                return jhc_valid_whnf((wptr_t)ds->head);
+}
+
+#endif
+
+#if _JHC_DEBUG
+wptr_t A_STD
+promote(sptr_t s)
+{
+        assert(!IS_LAZY(s));
+        assert(jhc_valid_whnf((wptr_t)s));
+        return (wptr_t)s;
+}
+
+sptr_t A_STD
+demote(wptr_t s)
+{
+        assert(!IS_LAZY(s));
+        assert(jhc_valid_whnf(s));
+        return (sptr_t)s;
+}
+
+void A_STD
+update(void * thunk, wptr_t new)
+{
+        assert(GETHEAD(thunk) == BLACK_HOLE);
+        assert(!IS_LAZY(new));
+        GETHEAD(thunk) = (fptr_t)new;
+}
+
hunk ./src/Grin/Main.hs 123
-                  "rts/jhc_rts.c", "lib/lib_cbits.c", "rts/gc_jgc.c"]
+                  "rts/jhc_rts.c", "lib/lib_cbits.c", "rts/gc_jgc.c",
+                  "rts/stableptr.c"]