Skip to content

Commit

Permalink
clean collect code
Browse files Browse the repository at this point in the history
  • Loading branch information
JHXSMatthew committed Aug 23, 2018
1 parent abc78a2 commit ee8fd84
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions src/s2/ddc-runtime/salt/runtime/Collect.dcs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ ddcCollectHeap
aaBackTop
(read# aaBackMax 0#)

-- after LLVM root, directly scan compact region root
ddcScanCompactRegionTable aaBackTop

-- Recursively follow pointers in to-space,
-- copying out any reachable objects from the from-space.
Expand Down Expand Up @@ -222,60 +220,7 @@ ddcEvacuateRoot
write# aaObj 0# aObjNew

()
-- | Scan the compact region RefList header
-- trace object in the RefList, copy objects on the heap to the back-heap
-- as root objects
ddcScanCompactRegionTable
(aaBackTop : Addr#)
: Unit
= do
tableBase = read# [Addr#] (global# [Addr#] "ddcCRTableBase"#) 0#
tableMax = read# [Addr#] (global# [Addr#] "ddcCRTableMax"#) 0#
ddcScanCompactRegionTable_iter aaBackTop tableBase tableMax


ddcScanCompactRegionTable_iter
(aaBackTop : Addr#)
(curr : Addr#)
(max : Addr#)
: Unit
= do
case ge# curr max of
True# -> ()
False# -> do rawBase = read# [Addr#] curr 0#
case ddcCompactRegionIsLive rawBase of
-- not live, just skip
False# -> do ddcScanCompactRegionTable_iter aaBackTop (plusAddr# curr 8#) max
True# -> do ddcCompactRegionDebugPrint "GC| CR| Enter "#
ddcPrintCompactRegionHeader rawBase
refListRawBase = read# [Addr#] rawBase 17#
refListTop = read# [Addr#] refListRawBase 0#
refListBase = plusAddr# refListRawBase 32# -- HEADER SIZE
ddcScanCompactRegionObjectRoot aaBackTop refListBase refListTop
ddcScanCompactRegionTable_iter aaBackTop (plusAddr# curr 8#) max

ddcScanCompactRegionObjectRoot
(aaBackTop : Addr#)
(refListCurr : Addr#)
(refListTop : Addr#)
: Unit
= do
case ge# refListCurr refListTop of
True# -> ()
False# -> do
boxedSize = ddcObjectSize refListCurr
actualObjAddr = ddcBoxedGetField refListCurr 0#
(case ddcCompactRegionDebug () of
True# -> do ddcCompactRegionDebugPrint "GC| Ref| Found "#
ddcCompactRegionDebugPrint "| RefAddr: "#
ddcPrimStderrPutAddr actualObjAddr
ddcCompactRegionDebugPrint "\n "#
()
False# -> ())
ddcScanObject aaBackTop refListCurr
ddcScanCompactRegionObjectRoot aaBackTop (plusAddr# refListCurr boxedSize) refListTop


-- | Evacuate a single object and update the to-space
-- to point to the word _after_ the new copy.
ddcEvacuateObject
Expand Down

0 comments on commit ee8fd84

Please sign in to comment.