-/* This function computes the revised profiling data of the first closed destination
- * page of an object that acrosses multiple pages
- */
-void firstPageConvert(bool origclosefirst, unsigned INTPTR main_factor, unsigned INTPTR delta_factor) {
- unsigned INTPTR topage=gc_cache_revise_information.to_page_index*NUMCORESACTIVE;
- unsigned INTPTR oldpage=gc_cache_revise_information.orig_page_index*NUMCORESACTIVE;
- int * newtable=&gccachesamplingtbl_r[topage];
- int * oldtable=&gccachesamplingtbl[oldpage];
- // compute the revised profiling info for the start destination page
- if(origclosefirst) {
- // the start original page closes first, now compute the revised profiling
- // info for the start destination page.
- // The start destination page = the rest of the start original page +
- // delta_fator from the next original page
- int * oldtable_next=&gccachesamplingtbl[oldpage+NUMCORESACTIVE];
- for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=(*newtable)+((*oldtable)*main_factor+(*oldtable_next)*delta_factor)>>BAMBOO_PAGE_SIZE_BITS;
- newtable++;
- oldtable++;
- oldtable_next++;
- }
- // close the start original page
- gc_cache_revise_information.orig_page_start_va+=main_factor+delta_factor;
- gc_cache_revise_information.orig_page_end_va+=BAMBOO_PAGE_SIZE;
- gc_cache_revise_information.orig_page_index++;
- } else {
- // the start destination page closes first, now compute the revised
- // profiling info for it.
- for(int tt = 0; tt < NUMCORESACTIVE; tt++) {
- (*newtable)=(*newtable)+((*oldtable)*main_factor)>>BAMBOO_PAGE_SIZE_BITS;
- newtable++;
- oldtable++;
- }
- // record the new start of the original page
- gc_cache_revise_information.orig_page_start_va+=main_factor;
- }
- // close the start original page and destination page
- gc_cache_revise_information.to_page_start_va=gc_cache_revise_information.to_page_end_va;
- gc_cache_revise_information.to_page_end_va+=BAMBOO_PAGE_SIZE;
- gc_cache_revise_information.to_page_index++;