* Let's call it what it is: The offset from where to start any
scan through the page to the start of the page. The only relation
this field has to an alloc_region is the way it is initialized.
* The low bits of each word are allocation flags.
*/
if ((word=data[i])) {
* The low bits of each word are allocation flags.
*/
if ((word=data[i])) {
- page_table[offset].region_start_offset = word & ~0x03;
+ page_table[offset].scan_start_offset = word & ~0x03;
page_table[offset].allocated = word & 0x03;
}
i++;
page_table[offset].allocated = word & 0x03;
}
i++;
* through a heap page (either for conservative root validation or
* for scavenging).
*/
* through a heap page (either for conservative root validation or
* for scavenging).
*/
- os_vm_size_t region_start_offset;
+ os_vm_size_t scan_start_offset;
/* the number of bytes of this page that are used. This may be less
* than the actual bytes used for pages within the current
/* the number of bytes of this page that are used. This may be less
* than the actual bytes used for pages within the current
/* Calculate the address where the allocation region associated with
* the page starts. */
static inline void *
/* Calculate the address where the allocation region associated with
* the page starts. */
static inline void *
-page_region_start(page_index_t page_index)
+page_scan_start(page_index_t page_index)
- return page_address(page_index)-page_table[page_index].region_start_offset;
+ return page_address(page_index)-page_table[page_index].scan_start_offset;
}
/* Find the page index within the page_table for the given
}
/* Find the page index within the page_table for the given
page_table[first_page].allocated = page_type_flag;
page_table[first_page].gen = gc_alloc_generation;
page_table[first_page].large_object = 0;
page_table[first_page].allocated = page_type_flag;
page_table[first_page].gen = gc_alloc_generation;
page_table[first_page].large_object = 0;
- page_table[first_page].region_start_offset = 0;
+ page_table[first_page].scan_start_offset = 0;
}
gc_assert(page_table[first_page].allocated == page_type_flag);
}
gc_assert(page_table[first_page].allocated == page_type_flag);
page_table[i].large_object = 0;
/* This may not be necessary for unboxed regions (think it was
* broken before!) */
page_table[i].large_object = 0;
/* This may not be necessary for unboxed regions (think it was
* broken before!) */
- page_table[i].region_start_offset =
+ page_table[i].scan_start_offset =
void_diff(page_address(i),alloc_region->start_addr);
page_table[i].allocated |= OPEN_REGION_PAGE_FLAG ;
}
void_diff(page_address(i),alloc_region->start_addr);
page_table[i].allocated |= OPEN_REGION_PAGE_FLAG ;
}
/* Update the first page. */
/* If the page was free then set up the gen, and
/* Update the first page. */
/* If the page was free then set up the gen, and
- * region_start_offset. */
+ * scan_start_offset. */
if (page_table[first_page].bytes_used == 0)
if (page_table[first_page].bytes_used == 0)
- gc_assert(page_table[first_page].region_start_offset == 0);
+ gc_assert(page_table[first_page].scan_start_offset == 0);
page_table[first_page].allocated &= ~(OPEN_REGION_PAGE_FLAG);
gc_assert(page_table[first_page].allocated & page_type_flag);
page_table[first_page].allocated &= ~(OPEN_REGION_PAGE_FLAG);
gc_assert(page_table[first_page].allocated & page_type_flag);
/* All the rest of the pages should be free. We need to set
/* All the rest of the pages should be free. We need to set
- * their region_start_offset pointer to the start of the
+ * their scan_start_offset pointer to the start of the
* region, and set the bytes_used. */
while (more) {
page_table[next_page].allocated &= ~(OPEN_REGION_PAGE_FLAG);
* region, and set the bytes_used. */
while (more) {
page_table[next_page].allocated &= ~(OPEN_REGION_PAGE_FLAG);
gc_assert(page_table[next_page].gen == gc_alloc_generation);
gc_assert(page_table[next_page].large_object == 0);
gc_assert(page_table[next_page].gen == gc_alloc_generation);
gc_assert(page_table[next_page].large_object == 0);
- gc_assert(page_table[next_page].region_start_offset ==
+ gc_assert(page_table[next_page].scan_start_offset ==
void_diff(page_address(next_page),
alloc_region->start_addr));
void_diff(page_address(next_page),
alloc_region->start_addr));
orig_first_page_bytes_used = page_table[first_page].bytes_used;
/* If the first page was free then set up the gen, and
orig_first_page_bytes_used = page_table[first_page].bytes_used;
/* If the first page was free then set up the gen, and
- * region_start_offset. */
+ * scan_start_offset. */
if (page_table[first_page].bytes_used == 0) {
page_table[first_page].allocated = page_type_flag;
page_table[first_page].gen = gc_alloc_generation;
if (page_table[first_page].bytes_used == 0) {
page_table[first_page].allocated = page_type_flag;
page_table[first_page].gen = gc_alloc_generation;
- page_table[first_page].region_start_offset = 0;
+ page_table[first_page].scan_start_offset = 0;
page_table[first_page].large_object = 1;
}
page_table[first_page].large_object = 1;
}
next_page = first_page+1;
/* All the rest of the pages should be free. We need to set their
next_page = first_page+1;
/* All the rest of the pages should be free. We need to set their
- * region_start_offset pointer to the start of the region, and set
+ * scan_start_offset pointer to the start of the region, and set
* the bytes_used. */
while (more) {
gc_assert(page_free_p(next_page));
* the bytes_used. */
while (more) {
gc_assert(page_free_p(next_page));
page_table[next_page].gen = gc_alloc_generation;
page_table[next_page].large_object = 1;
page_table[next_page].gen = gc_alloc_generation;
page_table[next_page].large_object = 1;
- page_table[next_page].region_start_offset =
+ page_table[next_page].scan_start_offset =
npage_bytes(next_page-first_page) - orig_first_page_bytes_used;
/* Calculate the number of bytes used in this page. */
npage_bytes(next_page-first_page) - orig_first_page_bytes_used;
/* Calculate the number of bytes used in this page. */
* new areas, but let's do it for them all (they'll probably
* be written anyway?). */
* new areas, but let's do it for them all (they'll probably
* be written anyway?). */
- gc_assert(page_table[first_page].region_start_offset == 0);
+ gc_assert(page_table[first_page].scan_start_offset == 0);
next_page = first_page;
remaining_bytes = nwords*N_WORD_BYTES;
while (remaining_bytes > GENCGC_CARD_BYTES) {
gc_assert(page_table[next_page].gen == from_space);
gc_assert(page_table[next_page].large_object);
next_page = first_page;
remaining_bytes = nwords*N_WORD_BYTES;
while (remaining_bytes > GENCGC_CARD_BYTES) {
gc_assert(page_table[next_page].gen == from_space);
gc_assert(page_table[next_page].large_object);
- gc_assert(page_table[next_page].region_start_offset ==
+ gc_assert(page_table[next_page].scan_start_offset ==
npage_bytes(next_page-first_page));
gc_assert(page_table[next_page].bytes_used == GENCGC_CARD_BYTES);
/* Should have been unprotected by unprotect_oldspace()
npage_bytes(next_page-first_page));
gc_assert(page_table[next_page].bytes_used == GENCGC_CARD_BYTES);
/* Should have been unprotected by unprotect_oldspace()
(page_table[next_page].gen == from_space) &&
/* FIXME: It is not obvious to me why this is necessary
* as a loop condition: it seems to me that the
(page_table[next_page].gen == from_space) &&
/* FIXME: It is not obvious to me why this is necessary
* as a loop condition: it seems to me that the
- * region_start_offset test should be sufficient, but
+ * scan_start_offset test should be sufficient, but
* experimentally that is not the case. --NS
* 2011-11-28 */
(boxedp ?
page_boxed_p(next_page) :
page_allocated_no_region_p(next_page)) &&
page_table[next_page].large_object &&
* experimentally that is not the case. --NS
* 2011-11-28 */
(boxedp ?
page_boxed_p(next_page) :
page_allocated_no_region_p(next_page)) &&
page_table[next_page].large_object &&
- (page_table[next_page].region_start_offset ==
+ (page_table[next_page].scan_start_offset ==
npage_bytes(next_page - first_page))) {
/* Checks out OK, free the page. Don't need to both zeroing
* pages as this should have been done before shrinking the
npage_bytes(next_page - first_page))) {
/* Checks out OK, free the page. Don't need to both zeroing
* pages as this should have been done before shrinking the
/* The address may be invalid, so do some checks. */
if ((page_index == -1) || page_free_p(page_index))
return NULL;
/* The address may be invalid, so do some checks. */
if ((page_index == -1) || page_free_p(page_index))
return NULL;
- start = (lispobj *)page_region_start(page_index);
+ start = (lispobj *)page_scan_start(page_index);
return (gc_search_space(start,
(((lispobj *)pointer)+2)-start,
(lispobj *)pointer));
return (gc_search_space(start,
(((lispobj *)pointer)+2)-start,
(lispobj *)pointer));
* but lets do it for them all (they'll probably be written
* anyway?). */
* but lets do it for them all (they'll probably be written
* anyway?). */
- gc_assert(page_table[first_page].region_start_offset == 0);
+ gc_assert(page_table[first_page].scan_start_offset == 0);
next_page = first_page;
remaining_bytes = nwords*N_WORD_BYTES;
next_page = first_page;
remaining_bytes = nwords*N_WORD_BYTES;
gc_assert(page_table[next_page].gen == from_space);
gc_assert(page_allocated_no_region_p(next_page));
gc_assert(page_table[next_page].large_object);
gc_assert(page_table[next_page].gen == from_space);
gc_assert(page_allocated_no_region_p(next_page));
gc_assert(page_table[next_page].large_object);
- gc_assert(page_table[next_page].region_start_offset ==
+ gc_assert(page_table[next_page].scan_start_offset ==
npage_bytes(next_page-first_page));
gc_assert(page_table[next_page].bytes_used == GENCGC_CARD_BYTES);
npage_bytes(next_page-first_page));
gc_assert(page_table[next_page].bytes_used == GENCGC_CARD_BYTES);
(page_table[next_page].gen == from_space) &&
page_allocated_no_region_p(next_page) &&
page_table[next_page].large_object &&
(page_table[next_page].gen == from_space) &&
page_allocated_no_region_p(next_page) &&
page_table[next_page].large_object &&
- (page_table[next_page].region_start_offset ==
+ (page_table[next_page].scan_start_offset ==
npage_bytes(next_page - first_page))) {
/* It checks out OK, free the page. We don't need to both zeroing
* pages as this should have been done before shrinking the
npage_bytes(next_page - first_page))) {
/* It checks out OK, free the page. We don't need to both zeroing
* pages as this should have been done before shrinking the
#if 0
/* I think this'd work just as well, but without the assertions.
* -dan 2004.01.01 */
#if 0
/* I think this'd work just as well, but without the assertions.
* -dan 2004.01.01 */
- first_page = find_page_index(page_region_start(addr_page_index))
+ first_page = find_page_index(page_scan_start(addr_page_index))
#else
first_page = addr_page_index;
#else
first_page = addr_page_index;
- while (page_table[first_page].region_start_offset != 0) {
+ while (page_table[first_page].scan_start_offset != 0) {
--first_page;
/* Do some checks. */
gc_assert(page_table[first_page].bytes_used == GENCGC_CARD_BYTES);
--first_page;
/* Do some checks. */
gc_assert(page_table[first_page].bytes_used == GENCGC_CARD_BYTES);
|| page_free_p(i+1)
|| (page_table[i+1].bytes_used == 0) /* next page free */
|| (page_table[i+1].gen != from_space) /* diff. gen */
|| page_free_p(i+1)
|| (page_table[i+1].bytes_used == 0) /* next page free */
|| (page_table[i+1].gen != from_space) /* diff. gen */
- || (page_table[i+1].region_start_offset == 0))
+ || (page_table[i+1].scan_start_offset == 0))
int write_protected=1;
/* This should be the start of a region */
int write_protected=1;
/* This should be the start of a region */
- gc_assert(page_table[i].region_start_offset == 0);
+ gc_assert(page_table[i].scan_start_offset == 0);
/* Now work forward until the end of the region */
for (last_page = i; ; last_page++) {
/* Now work forward until the end of the region */
for (last_page = i; ; last_page++) {
|| (!page_boxed_p(last_page+1))
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
|| (!page_boxed_p(last_page+1))
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
- || (page_table[last_page+1].region_start_offset == 0))
+ || (page_table[last_page+1].scan_start_offset == 0))
break;
}
if (!write_protected) {
break;
}
if (!write_protected) {
&& (page_table[i].write_protected_cleared != 0)) {
FSHOW((stderr, "/scavenge_generation() %d\n", generation));
FSHOW((stderr,
&& (page_table[i].write_protected_cleared != 0)) {
FSHOW((stderr, "/scavenge_generation() %d\n", generation));
FSHOW((stderr,
- "/page bytes_used=%d region_start_offset=%lu dont_move=%d\n",
+ "/page bytes_used=%d scan_start_offset=%lu dont_move=%d\n",
page_table[i].bytes_used,
page_table[i].bytes_used,
- page_table[i].region_start_offset,
+ page_table[i].scan_start_offset,
page_table[i].dont_move));
lose("write to protected page %d in scavenge_generation()\n", i);
}
page_table[i].dont_move));
lose("write to protected page %d in scavenge_generation()\n", i);
}
page_index_t last_page;
int all_wp=1;
page_index_t last_page;
int all_wp=1;
- /* The scavenge will start at the region_start_offset of
+ /* The scavenge will start at the scan_start_offset of
* page i.
*
* We need to find the full extent of this contiguous
* page i.
*
* We need to find the full extent of this contiguous
|| (!page_boxed_p(last_page+1))
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
|| (!page_boxed_p(last_page+1))
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
- || (page_table[last_page+1].region_start_offset == 0))
+ || (page_table[last_page+1].scan_start_offset == 0))
sword_t nwords = (((uword_t)
(page_table[last_page].bytes_used
+ npage_bytes(last_page-i)
sword_t nwords = (((uword_t)
(page_table[last_page].bytes_used
+ npage_bytes(last_page-i)
- + page_table[i].region_start_offset))
+ + page_table[i].scan_start_offset))
/ N_WORD_BYTES);
new_areas_ignore_page = last_page;
/ N_WORD_BYTES);
new_areas_ignore_page = last_page;
- scavenge(page_region_start(i), nwords);
+ scavenge(page_scan_start(i), nwords);
page_table[pi1].allocated,
page_table[pi1].gen,
page_table[pi1].bytes_used,
page_table[pi1].allocated,
page_table[pi1].gen,
page_table[pi1].bytes_used,
- page_table[pi1].region_start_offset,
+ page_table[pi1].scan_start_offset,
page_table[pi1].dont_move);
fprintf(stderr," %x %x %x %x (%x) %x %x %x %x\n",
*(addr-4),
page_table[pi1].dont_move);
fprintf(stderr," %x %x %x %x (%x) %x %x %x %x\n",
*(addr-4),
int region_allocation = page_table[i].allocated;
/* This should be the start of a contiguous block */
int region_allocation = page_table[i].allocated;
/* This should be the start of a contiguous block */
- gc_assert(page_table[i].region_start_offset == 0);
+ gc_assert(page_table[i].scan_start_offset == 0);
/* Need to find the full extent of this contiguous block in case
objects span pages. */
/* Need to find the full extent of this contiguous block in case
objects span pages. */
|| (page_table[last_page+1].allocated != region_allocation)
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
|| (page_table[last_page+1].allocated != region_allocation)
|| (page_table[last_page+1].bytes_used == 0)
|| (page_table[last_page+1].gen != generation)
- || (page_table[last_page+1].region_start_offset == 0))
+ || (page_table[last_page+1].scan_start_offset == 0))
break;
verify_space(page_address(i),
break;
verify_space(page_address(i),
first=gc_search_space(prev,(ptr+2)-prev,ptr);
if(ptr == first)
prev=ptr;
first=gc_search_space(prev,(ptr+2)-prev,ptr);
if(ptr == first)
prev=ptr;
- page_table[page].region_start_offset =
+ page_table[page].scan_start_offset =
page_address(page) - (void *)prev;
}
page++;
page_address(page) - (void *)prev;
}
page++;
"Fault @ %p, page %"PAGE_INDEX_FMT" not marked as write-protected:\n"
" boxed_region.first_page: %"PAGE_INDEX_FMT","
" boxed_region.last_page %"PAGE_INDEX_FMT"\n"
"Fault @ %p, page %"PAGE_INDEX_FMT" not marked as write-protected:\n"
" boxed_region.first_page: %"PAGE_INDEX_FMT","
" boxed_region.last_page %"PAGE_INDEX_FMT"\n"
- " page.region_start_offset: %"OS_VM_SIZE_FMT"\n"
+ " page.scan_start_offset: %"OS_VM_SIZE_FMT"\n"
" page.bytes_used: %"PAGE_BYTES_FMT"\n"
" page.allocated: %d\n"
" page.write_protected: %d\n"
" page.bytes_used: %"PAGE_BYTES_FMT"\n"
" page.allocated: %d\n"
" page.write_protected: %d\n"
page_index,
boxed_region.first_page,
boxed_region.last_page,
page_index,
boxed_region.first_page,
boxed_region.last_page,
- page_table[page_index].region_start_offset,
+ page_table[page_index].scan_start_offset,
page_table[page_index].bytes_used,
page_table[page_index].allocated,
page_table[page_index].write_protected,
page_table[page_index].bytes_used,
page_table[page_index].allocated,
page_table[page_index].write_protected,
* are always zero, so we can use them to store the
* allocation type -- region is always closed, so only
* the two low bits of allocation flags matter. */
* are always zero, so we can use them to store the
* allocation type -- region is always closed, so only
* the two low bits of allocation flags matter. */
- word = page_table[i].region_start_offset;
+ word = page_table[i].scan_start_offset;
gc_assert((word & 0x03) == 0);
data[i] = word | (0x03 & page_table[i].allocated);
}
gc_assert((word & 0x03) == 0);
data[i] = word | (0x03 & page_table[i].allocated);
}