Changeset 13260
- Timestamp:
- Dec 7, 2009, 4:39:21 PM (15 years ago)
- File:
-
- 1 edited
-
branches/purify/source/lisp-kernel/x86-gc.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/purify/source/lisp-kernel/x86-gc.c
r13127 r13260 2256 2256 2257 2257 2258 /* Leave a trail of breadcrumbs. Or maybe just one breadcrumb. */2259 /* Actually, it's best to always leave a trail, for two reasons.2260 a) We may be walking the same heap that we're leaving forwaring2261 pointers in, so we don't want garbage that we leave behind to2262 look like a header.2263 b) We'd like to be able to forward code-vector locatives, and2264 it's easiest to do so if we leave a {forward_marker, dnode_locative}2265 pair at every doubleword in the old vector.2266 */2267 2258 while(physbytes) { 2268 2259 *old++ = (BytePtr) forward_marker; … … 2281 2272 2282 2273 Boolean 2283 copy_reference(LispObj *ref,BytePtr low, BytePtr high, area *dest, int what)2274 purify_locref(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what) 2284 2275 { 2285 2276 LispObj obj = *ref, header, new; … … 2287 2278 Boolean changed = false; 2288 2279 2280 if ((((BytePtr)ptr_from_lispobj(obj)) > low) && 2281 (((BytePtr)ptr_from_lispobj(obj)) < high)) { 2282 header = deref(obj, 0); 2283 if (header == forward_marker) { /* already copied */ 2284 *ref = (untag(deref(obj,1)) + tag); 2285 changed = true; 2286 } else { 2287 header_tag = fulltag_of(header); 2288 if ((what == PURIFY_ALL) || 2289 ((what & PURIFY_IVECTORS) && 2290 immheader_tag_p(header_tag) && 2291 header_subtag(header) != subtag_macptr) || 2292 ((what & PURIFY_FUNCTIONS) && 2293 immutable_function_p(obj))) { 2294 new = purify_object(obj, dest); 2295 *ref = new; 2296 changed = (new != obj); 2297 } 2298 } 2299 } 2300 return changed; 2301 } 2302 2303 Boolean 2304 copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what) 2305 { 2306 LispObj obj = *ref; 2307 natural tag = fulltag_of(obj); 2308 2289 2309 if ( 2290 2310 #ifdef X8664 2291 (tag != fulltag_tra_0) && (tag != fulltag_tra_1)2311 (tag == fulltag_tra_0) || (tag == fulltag_tra_1) 2292 2312 #endif 2293 2313 #ifdef X8632 2294 tag != fulltag_tra2314 tag == fulltag_tra 2295 2315 #endif 2296 2316 ) { 2297 if (is_node_fulltag(tag) && 2298 (((BytePtr)ptr_from_lispobj(obj)) > low) && 2299 (((BytePtr)ptr_from_lispobj(obj)) < high)) { 2300 header = deref(obj, 0); 2301 if (header == forward_marker) { /* already copied */ 2302 *ref = (untag(deref(obj,1)) + tag); 2303 changed = true; 2304 } else { 2305 header_tag = fulltag_of(header); 2306 if ((what == PURIFY_ALL) || 2307 ((what & PURIFY_IVECTORS) && 2308 immheader_tag_p(header_tag) && 2309 header_subtag(header) != subtag_macptr) || 2310 ((what & PURIFY_FUNCTIONS) && 2311 immutable_function_p(obj))) { 2312 new = purify_object(obj, dest); 2313 *ref = new; 2314 changed = (new != obj); 2315 } 2316 } 2317 } 2318 } 2319 return changed; 2320 } 2317 what = PURIFY_NOTHING; 2318 } 2319 if (is_node_fulltag(tag)) { 2320 return purify_locref(ref,low,high,dest,what); 2321 } 2322 return false; 2323 } 2324 2321 2325 2322 2326 … … 2469 2473 copy_reference(&(regs[Itemp1]), low, high, to, what); 2470 2474 copy_reference(&(regs[Itemp2]), low, high, to, what); 2471 #if 0 2472 purify_locref(&(regs[Iip]), low, high, to, what);2473 #endif 2475 2476 purify_locref(&(regs[Iip]), low, high, to, PURIFY_NOTHING); 2477 2474 2478 #else 2475 2479 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
