From d1e1ae7ff8aafe1bc2c1c57a002e0d23cb06571d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Sat, 6 Jan 2024 12:11:26 +0100 Subject: [PATCH] swiper: updating crossing map when sweeping --- dora-runtime/src/gc/swiper.rs | 2 +- dora-runtime/src/gc/swiper/full.rs | 2 ++ dora-runtime/src/gc/swiper/verify.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dora-runtime/src/gc/swiper.rs b/dora-runtime/src/gc/swiper.rs index 3955d96d8..8408cdd2d 100644 --- a/dora-runtime/src/gc/swiper.rs +++ b/dora-runtime/src/gc/swiper.rs @@ -641,7 +641,7 @@ fn forward_minor(object: Address, young: Region) -> Option
{ } } -#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Page(Address); impl Page { diff --git a/dora-runtime/src/gc/swiper/full.rs b/dora-runtime/src/gc/swiper/full.rs index 00791a274..ffa9ef357 100644 --- a/dora-runtime/src/gc/swiper/full.rs +++ b/dora-runtime/src/gc/swiper/full.rs @@ -231,6 +231,8 @@ impl<'a> FullCollector<'a> { } else { for free_region in free_regions { fill_region_with(self.vm, free_region.start, free_region.end, true); + self.old + .update_crossing(free_region.start(), free_region.end()); self.old_protected.add_to_freelist( self.vm, diff --git a/dora-runtime/src/gc/swiper/verify.rs b/dora-runtime/src/gc/swiper/verify.rs index c70b42c2c..211f2e063 100644 --- a/dora-runtime/src/gc/swiper/verify.rs +++ b/dora-runtime/src/gc/swiper/verify.rs @@ -177,7 +177,8 @@ impl<'a> Verifier<'a> { let object_end = curr.offset(size); // Object is not supposed to cross page boundary. - let page = Page::from_address(curr); + let page_for_object = Page::from_address(curr); + assert_eq!(page, page_for_object); assert!(object_end <= page.end()); if !object.is_filler(self.vm) {