Changeset 7303
- Timestamp:
- Sep 26, 2007, 9:57:37 AM (13 years ago)
- Location:
- branches/working-0709/ccl/lisp-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0709/ccl/lisp-kernel/image.c
r6215 r7303 211 211 212 212 a->static_dnodes = sect->static_dnodes; 213 if (a->static_dnodes) {214 natural pages_size = (align_to_power_of_2((align_to_power_of_2(a->static_dnodes,215 log2_nbits_in_word)>>3),216 log2_page_size));217 lseek(fd,pos+mem_size, SEEK_SET);218 pos = seek_to_next_page(fd);219 addr = mmap(NULL,220 pages_size,221 PROT_READ | PROT_WRITE,222 MAP_PRIVATE,223 fd,224 pos);225 if (addr == MAP_FAILED) {226 return;227 }228 a->static_used = addr;229 advance = pages_size;230 }231 213 sect->area = a; 232 214 break; … … 477 459 case FWDNUM: 478 460 case GC_NUM: 479 case DELETED_STATIC_PAIRS:461 case STATIC_CONSES: 480 462 break; 481 463 default: … … 503 485 return errno; 504 486 } 505 if (nstatic) {506 /* Need to write the static_used bitmap */507 natural static_used_size_in_bytes =508 (align_to_power_of_2((align_to_power_of_2(nstatic, log2_nbits_in_word)>>3),509 log2_page_size));510 seek_to_next_page(fd);511 if (write(fd, tenured_area->static_used, static_used_size_in_bytes)512 != static_used_size_in_bytes) {513 return errno;514 }515 }516 487 } 517 488 } -
branches/working-0709/ccl/lisp-kernel/lisp_globals.h
r6901 r7303 33 33 #define TCR_AREA_LOCK (-11) /* all_areas/tcr queue lock */ 34 34 #define EXCEPTION_LOCK (-12) /* serialize exception handling */ 35 #define DELETED_STATIC_PAIRS (-13) /* for hash-consing */35 #define STATIC_CONSES (-13) 36 36 #define DEFAULT_ALLOCATION_QUANTUM (-14) 37 37 #define INTFLAG (-15) -
branches/working-0709/ccl/lisp-kernel/x86-exceptions.c
r7296 r7303 237 237 fatal_oserr(": save_application", err); 238 238 } 239 switch {salector) {239 switch (selector) { 240 240 case GC_TRAP_FUNCTION_SET_HONS_AREA_SIZE: 241 241 xpGPR(xp, Iimm0) = 0; … … 243 243 case GC_TRAP_FUNCTION_FREEZE: 244 244 a->active = (BytePtr) align_to_power_of_2(a->active, log2_page_size); 245 static_area->static_dnodes = area_dnode(a->active, a->low);246 xpGPR(xp, Iimm0) = static_area->static_dnodes;245 tenured_area->static_dnodes = area_dnode(a->active, a->low); 246 xpGPR(xp, Iimm0) = tenured_area->static_dnodes << dnode_shift; 247 247 break; 248 248 default: … … 1897 1897 1898 1898 int 1899 change_hons_area_size_from_xp(ExceptionInformation *xp, signed_natural delta_in_bytes)1900 {1901 return gc_like_from_xp(xp, change_hons_area_size, delta_in_bytes);1902 }1903 1904 int1905 1899 purify_from_xp(ExceptionInformation *xp, signed_natural param) 1906 1900 { -
branches/working-0709/ccl/lisp-kernel/x86-gc.c
r7296 r7303 2112 2112 } 2113 2113 2114 void 2115 forward_and_resolve_static_references(area *a) 2116 { 2117 natural 2118 nstatic = static_dnodes_for_area(a), 2119 nstatic_bitmap_words = nstatic >> bitmap_shift; 2120 if (nstatic != 0) { 2121 /* exploit the fact that a cons is the same size as a dnode. */ 2122 cons *pagelet_start = (cons *) a->low, *work; 2123 bitvector markbits = GCmarkbits, 2124 usedbits = tenured_area->static_used; 2125 natural marked, used, used_but_not_marked, ndeleted = 0, i; 2126 2127 while (nstatic_bitmap_words--) { 2128 marked = *markbits++; 2129 used = *usedbits; 2130 if (marked != used) { 2131 *usedbits = marked; 2132 } 2133 used |= marked; 2134 used_but_not_marked = used & ~marked; 2135 2136 while (marked) { 2137 i = count_leading_zeros(marked); 2138 marked &= ~(BIT0_MASK >> i); 2139 work = pagelet_start+i; 2140 update_noderef(&work->cdr); 2141 update_noderef(&work->car); 2142 } 2143 2144 while (used_but_not_marked) { 2145 i = count_leading_zeros(used_but_not_marked); 2146 used_but_not_marked &= ~(BIT0_MASK >> i); 2147 work = pagelet_start+i; 2148 if ((work->cdr != undefined) && 2149 (work->cdr != slot_unbound)) { 2150 work->car = slot_unbound; 2151 work->cdr = slot_unbound; 2152 ndeleted++; 2153 } 2154 } 2155 usedbits++; 2156 pagelet_start += nbits_in_word; 2157 } 2158 lisp_global(DELETED_STATIC_PAIRS) += box_fixnum(ndeleted); 2159 } 2160 } 2114 2161 2115 2162 2116 … … 2324 2278 } 2325 2279 2280 void 2281 reclaim_static_dnodes() 2282 { 2283 natural nstatic = tenured_area->static_dnodes, i, bits, mask, bitnum; 2284 cons *c = (cons *)tenured_area->low, *d; 2285 bitvector bitsp = GCmarkbits; 2286 LispObj head = lisp_global(STATIC_CONSES); 2287 2288 if (nstatic) { 2289 if (head) { 2290 for (i = 0; i < nstatic; i+= nbits_in_word, c+= nbits_in_word) { 2291 bits = *bitsp++; 2292 if (bits != ALL_ONES) { 2293 for (bitnum = 0; bitnum < nbits_in_word; bitnum++) { 2294 if (! (bits & (BIT0_MASK>>bitnum))) { 2295 d = c + bitnum; 2296 d->car = 0; 2297 d->cdr = head; 2298 head = ((LispObj)d)+fulltag_cons; 2299 } 2300 } 2301 } 2302 } 2303 lisp_global(STATIC_CONSES) = head; 2304 } else { 2305 for (i = 0; i < nstatic; i+= nbits_in_word, c+= nbits_in_word) { 2306 bits = *bitsp++; 2307 if (bits != ALL_ONES) { 2308 for (bitnum = 0; bitnum < nbits_in_word; bitnum++) { 2309 if (! (bits & (BIT0_MASK>>bitnum))) { 2310 d = c + bitnum; 2311 d->car = 0; 2312 d->cdr = 0; 2313 } 2314 } 2315 } 2316 } 2317 } 2318 } 2319 } 2326 2320 2327 2321 Boolean … … 2598 2592 GCfirstunmarked = calculate_relocation(); 2599 2593 2600 forward_range((LispObj *) ptr_from_lispobj(GCareadynamiclow), (LispObj *) ptr_from_lispobj(GCfirstunmarked)); 2594 if (!GCephemeral_low) { 2595 reclaim_static_dnodes(); 2596 } 2597 2598 forward_range((LispObj *) ptr_from_lispobj(GCarealow), (LispObj *) ptr_from_lispobj(GCfirstunmarked)); 2601 2599 2602 2600 other_tcr = tcr; … … 2644 2642 if (GCephemeral_low) { 2645 2643 forward_memoized_area(tenured_area, area_dnode(a->low, tenured_area->low)); 2646 } else {2647 /* Full GC, need to process static space */2648 forward_and_resolve_static_references(a);2649 2644 } 2650 2645
Note: See TracChangeset
for help on using the changeset viewer.