Changeset 13497
- Timestamp:
- Mar 8, 2010, 6:27:13 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lisp-kernel/x86-gc.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/x86-gc.c
r13466 r13497 2363 2363 2364 2364 Boolean 2365 copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what )2366 { 2367 LispObj obj = *ref ;2365 copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what, Boolean recursive) 2366 { 2367 LispObj obj = *ref, *scan = NULL; 2368 2368 natural tag = fulltag_of(obj); 2369 2370 if (recursive) { 2371 scan = (LispObj *)(dest->active); 2372 } 2369 2373 2370 2374 if ( … … 2379 2383 } 2380 2384 if (is_node_fulltag(tag)) { 2381 return purify_locref(ref,low,high,dest,what); 2385 if (purify_locref(ref,low,high,dest,what)) { 2386 if (recursive) { 2387 LispObj header; 2388 unsigned tag; 2389 natural nwords; 2390 2391 while (scan < (LispObj *)(dest->active)) { 2392 header = *scan; 2393 tag = fulltag_of(header); 2394 if (immheader_tag_p(tag)) { 2395 scan = (LispObj *)skip_over_ivector((natural)scan, header); 2396 } else if (nodeheader_tag_p(tag)) { 2397 if ((header_subtag(header) == subtag_simple_vector) || 2398 (header_subtag(header) == subtag_struct)) { 2399 scan++; 2400 purify_locref(scan,low,high,dest,what); 2401 scan++; 2402 } else { 2403 nwords = (header_element_count(header)+2)&~1; 2404 scan += nwords; 2405 } 2406 } else { 2407 purify_locref(scan,low,high,dest,what); 2408 scan++; 2409 purify_locref(scan,low,high,dest,what); 2410 scan++; 2411 } 2412 } 2413 } 2414 } 2415 return true; 2382 2416 } 2383 2417 return false; … … 2392 2426 2393 2427 while ((*prev) != (LispObj)NULL) { 2394 copy_reference(prev, low, high, to, what );2428 copy_reference(prev, low, high, to, what, false); 2395 2429 next = *prev; 2396 2430 prev = &(((xmacptr *)ptr_from_lispobj(untag(next)))->link); … … 2402 2436 { 2403 2437 while (start < end) { 2404 copy_reference(start, low, high, to, what );2438 copy_reference(start, low, high, to, what, false); 2405 2439 start++; 2406 2440 } … … 2408 2442 2409 2443 void 2410 purify_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area *to, int what )2444 purify_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area *to, int what, Boolean recursive) 2411 2445 { 2412 2446 LispObj header; … … 2435 2469 nwords -= skip; 2436 2470 while(skip--) { 2437 copy_reference(start, low, high, to, what );2471 copy_reference(start, low, high, to, what, recursive); 2438 2472 start++; 2439 2473 } … … 2444 2478 nwords >>= 1; 2445 2479 while(nwords--) { 2446 if (copy_reference(start, low, high, to, what) && hashp) { 2480 2481 if (copy_reference(start, low, high, to, what, recursive) 2482 && hashp) { 2447 2483 hashp->flags |= nhash_key_moved_mask; 2448 2484 hashp = NULL; 2449 2485 } 2450 2486 start++; 2451 copy_reference(start, low, high, to, what );2487 copy_reference(start, low, high, to, what, recursive); 2452 2488 start++; 2453 2489 } … … 2469 2505 start++; 2470 2506 while(nwords--) { 2471 copy_reference(start, low, high, to, what );2507 copy_reference(start, low, high, to, what, recursive); 2472 2508 start++; 2473 2509 } … … 2475 2511 } else { 2476 2512 /* Not a header, just a cons cell */ 2477 copy_reference(start, low, high, to, what );2513 copy_reference(start, low, high, to, what, recursive); 2478 2514 start++; 2479 copy_reference(start, low, high, to, what );2515 copy_reference(start, low, high, to, what, recursive); 2480 2516 start++; 2481 2517 } … … 2500 2536 next = (LispObj *) ptr_from_lispobj(*current); 2501 2537 end = ((next >= start) && (next < limit)) ? next : limit; 2502 purify_range(current+2, end, low, high, to, what );2538 purify_range(current+2, end, low, high, to, what, false); 2503 2539 } 2504 2540 } … … 2527 2563 2528 2564 #ifdef X8664 2529 copy_reference(&(regs[Iarg_z]), low, high, to, what );2530 copy_reference(&(regs[Iarg_y]), low, high, to, what );2531 copy_reference(&(regs[Iarg_x]), low, high, to, what );2532 copy_reference(&(regs[Isave3]), low, high, to, what );2533 copy_reference(&(regs[Isave2]), low, high, to, what );2534 copy_reference(&(regs[Isave1]), low, high, to, what );2535 copy_reference(&(regs[Isave0]), low, high, to, what );2536 copy_reference(&(regs[Ifn]), low, high, to, what );2537 copy_reference(&(regs[Itemp0]), low, high, to, what );2538 copy_reference(&(regs[Itemp1]), low, high, to, what );2539 copy_reference(&(regs[Itemp2]), low, high, to, what );2565 copy_reference(&(regs[Iarg_z]), low, high, to, what, false); 2566 copy_reference(&(regs[Iarg_y]), low, high, to, what, false); 2567 copy_reference(&(regs[Iarg_x]), low, high, to, what, false); 2568 copy_reference(&(regs[Isave3]), low, high, to, what, false); 2569 copy_reference(&(regs[Isave2]), low, high, to, what, false); 2570 copy_reference(&(regs[Isave1]), low, high, to, what, false); 2571 copy_reference(&(regs[Isave0]), low, high, to, what, false); 2572 copy_reference(&(regs[Ifn]), low, high, to, what, false); 2573 copy_reference(&(regs[Itemp0]), low, high, to, what, false); 2574 copy_reference(&(regs[Itemp1]), low, high, to, what, false); 2575 copy_reference(&(regs[Itemp2]), low, high, to, what, false); 2540 2576 2541 2577 purify_locref(&(regs[Iip]), low, high, to, PURIFY_NOTHING); … … 2543 2579 #else 2544 2580 if (node_regs_mask & (1<<0)) { 2545 copy_reference(&(regs[REG_EAX]), low, high, to, what );2581 copy_reference(&(regs[REG_EAX]), low, high, to, what, false); 2546 2582 } 2547 2583 if (node_regs_mask & (1<<1)) { 2548 copy_reference(&(regs[REG_ECX]), low, high, to, what );2584 copy_reference(&(regs[REG_ECX]), low, high, to, what, false); 2549 2585 } 2550 2586 if (! (regs[REG_EFL] & EFL_DF)) { 2551 2587 if (node_regs_mask & (1<<2)) { 2552 copy_reference(&(regs[REG_EDX]), low, high, to, what );2588 copy_reference(&(regs[REG_EDX]), low, high, to, what, false); 2553 2589 } 2554 2590 } 2555 2591 if (node_regs_mask & (1<<3)) { 2556 copy_reference(&(regs[REG_EBX]), low, high, to, what );2592 copy_reference(&(regs[REG_EBX]), low, high, to, what, false); 2557 2593 } 2558 2594 if (node_regs_mask & (1<<4)) { 2559 copy_reference(&(regs[REG_ESP]), low, high, to, what );2595 copy_reference(&(regs[REG_ESP]), low, high, to, what, false); 2560 2596 } 2561 2597 if (node_regs_mask & (1<<5)) { 2562 copy_reference(&(regs[REG_EBP]), low, high, to, what );2598 copy_reference(&(regs[REG_EBP]), low, high, to, what, false); 2563 2599 } 2564 2600 if (node_regs_mask & (1<<6)) { 2565 copy_reference(&(regs[REG_ESI]), low, high, to, what );2601 copy_reference(&(regs[REG_ESI]), low, high, to, what, false); 2566 2602 } 2567 2603 if (node_regs_mask & (1<<7)) { 2568 copy_reference(&(regs[REG_EDI]), low, high, to, what );2604 copy_reference(&(regs[REG_EDI]), low, high, to, what, false); 2569 2605 } 2570 2606 purify_locref(®s[REG_EIP], low, high, to, what); … … 2578 2614 LispObj *start = tcr->tlb_pointer, *end = (LispObj *) ((BytePtr)start+n); 2579 2615 2580 purify_range(start, end, low, high, to, what );2616 purify_range(start, end, low, high, to, what, false); 2581 2617 } 2582 2618 … … 2596 2632 } 2597 2633 #ifdef X8632 2598 copy_reference(&tcr->save0, low, high, to, what );2599 copy_reference(&tcr->save1, low, high, to, what );2600 copy_reference(&tcr->save2, low, high, to, what );2601 copy_reference(&tcr->save3, low, high, to, what );2602 copy_reference(&tcr->next_method_context, low, high, to, what );2634 copy_reference(&tcr->save0, low, high, to, what, false); 2635 copy_reference(&tcr->save1, low, high, to, what, false); 2636 copy_reference(&tcr->save2, low, high, to, what, false); 2637 copy_reference(&tcr->save3, low, high, to, what, false); 2638 copy_reference(&tcr->next_method_context, low, high, to, what, false); 2603 2639 #endif 2604 2640 … … 2635 2671 case AREA_DYNAMIC: 2636 2672 case AREA_MANAGED_STATIC: 2637 purify_range((LispObj *) next_area->low, (LispObj *) next_area->active, low, high, target, what );2673 purify_range((LispObj *) next_area->low, (LispObj *) next_area->active, low, high, target, what, false); 2638 2674 break; 2639 2675 … … 2762 2798 LispObj package_list; 2763 2799 2764 copy_reference(&nrs_UDF.vcell,low,high,managed_static_area,PURIFY_ALL );2800 copy_reference(&nrs_UDF.vcell,low,high,managed_static_area,PURIFY_ALL, false); 2765 2801 for (package_list = nrs_ALL_PACKAGES.vcell; 2766 2802 package_list != lisp_nil; 2767 2803 package_list = deref(package_list,0)) { 2768 copy_reference(&(deref(package_list,1)),low,high,managed_static_area,PURIFY_ALL );2804 copy_reference(&(deref(package_list,1)),low,high,managed_static_area,PURIFY_ALL, false); 2769 2805 } 2770 2806 … … 2778 2814 high, 2779 2815 managed_static_area, 2780 PURIFY_ALL); 2816 PURIFY_ALL, 2817 true); 2781 2818 /* Go back through all areas, resolving forwarding pointers 2782 2819 (but without copying anything.) */
Note:
See TracChangeset
for help on using the changeset viewer.
