summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2016-02-29 17:35:43 -0500
committerReid Barton <rwbarton@gmail.com>2016-02-29 17:35:43 -0500
commit0fd5db798e31912f335e4553e939e1e783284495 (patch)
tree43f1d3c8466b7e4276dfb3bb25e2a1839d7265f8 /rts
parent49c55e68aae9841c166430ae566b0d9bdc03c99d (diff)
downloadhaskell-wip/rwbarton-tiny-tables.tar.gz
Experiment with one-byte info tableswip/rwbarton-tiny-tables
Diffstat (limited to 'rts')
-rw-r--r--rts/ThreadPaused.c8
-rw-r--r--rts/sm/Scav.c20
2 files changed, 28 insertions, 0 deletions
diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c
index 1f1d0afe58..e0e616aec4 100644
--- a/rts/ThreadPaused.c
+++ b/rts/ThreadPaused.c
@@ -219,6 +219,14 @@ threadPaused(Capability *cap, StgTSO *tso)
frame = (StgClosure *)tso->stackobj->sp;
while ((P_)frame < stack_end) {
+ if (*(P_)frame & 1) {
+ nat frame_size = stack_frame_sizeW(frame);
+ weight_pending += frame_size;
+ frame = (StgClosure *)((StgPtr)frame + frame_size);
+ prev_was_update_frame = rtsFalse;
+ continue;
+ }
+
info = get_ret_itbl(frame);
switch (info->i.type) {
diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c
index 953f055d57..b6783749c5 100644
--- a/rts/sm/Scav.c
+++ b/rts/sm/Scav.c
@@ -174,6 +174,19 @@ static StgPtr scavenge_mut_arr_ptrs_marked (StgMutArrPtrs *a)
}
STATIC_INLINE StgPtr
+scavenge_tiny_bitmap (StgPtr p, uint8_t layout)
+{
+ while (layout > 1) {
+ if ((layout & 1) == 0) {
+ evacuate((StgClosure **)p);
+ }
+ p++;
+ layout = layout >> 1;
+ }
+ return p;
+}
+
+STATIC_INLINE StgPtr
scavenge_small_bitmap (StgPtr p, StgWord size, StgWord bitmap)
{
while (size > 0) {
@@ -1807,6 +1820,13 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
*/
while (p < stack_end) {
+ if (*p & 1) {
+ // Tiny liveness layout: no SRT
+ uint8_t liveness = *((uint8_t *)(*p) - 1);
+ p = scavenge_tiny_bitmap(p+1, liveness);
+ continue;
+ }
+
info = get_ret_itbl((StgClosure *)p);
switch (info->i.type) {