Changeset 13497


Ignore:
Timestamp:
Mar 9, 2010, 2:27:13 AM (9 years ago)
Author:
gb
Message:

After copying a purified function constant to the managed static area,
scan the newly-copied object; if it's a CONS, SIMPLE-VECTOR, or STRUCTURE,
copy its components to the static area and scan those components recursively.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-gc.c

    r13466 r13497  
    23632363
    23642364Boolean
    2365 copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what)
    2366 {
    2367   LispObj obj = *ref;
     2365copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what, Boolean recursive)
     2366{
     2367  LispObj obj = *ref, *scan = NULL;
    23682368  natural tag = fulltag_of(obj);
     2369
     2370  if (recursive) {
     2371    scan = (LispObj *)(dest->active);
     2372  }
    23692373
    23702374  if (
     
    23792383  }
    23802384  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;
    23822416  }
    23832417  return false;
     
    23922426
    23932427  while ((*prev) != (LispObj)NULL) {
    2394     copy_reference(prev, low, high, to, what);
     2428    copy_reference(prev, low, high, to, what, false);
    23952429    next = *prev;
    23962430    prev = &(((xmacptr *)ptr_from_lispobj(untag(next)))->link);
     
    24022436{
    24032437  while (start < end) {
    2404     copy_reference(start, low, high, to, what);
     2438    copy_reference(start, low, high, to, what, false);
    24052439    start++;
    24062440  }
     
    24082442   
    24092443void
    2410 purify_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area *to, int what)
     2444purify_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area *to, int what, Boolean recursive)
    24112445{
    24122446  LispObj header;
     
    24352469          nwords -= skip;
    24362470          while(skip--) {
    2437             copy_reference(start, low, high, to, what);
     2471            copy_reference(start, low, high, to, what, recursive);
    24382472            start++;
    24392473          }
     
    24442478          nwords >>= 1;
    24452479          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) {
    24472483              hashp->flags |= nhash_key_moved_mask;
    24482484              hashp = NULL;
    24492485            }
    24502486            start++;
    2451             copy_reference(start, low, high, to, what);
     2487            copy_reference(start, low, high, to, what, recursive);
    24522488            start++;
    24532489          }
     
    24692505          start++;
    24702506          while(nwords--) {
    2471             copy_reference(start, low, high, to, what);
     2507            copy_reference(start, low, high, to, what, recursive);
    24722508            start++;
    24732509          }
     
    24752511      } else {
    24762512        /* Not a header, just a cons cell */
    2477         copy_reference(start, low, high, to, what);
     2513        copy_reference(start, low, high, to, what, recursive);
    24782514        start++;
    2479         copy_reference(start, low, high, to, what);
     2515        copy_reference(start, low, high, to, what, recursive);
    24802516        start++;
    24812517      }
     
    25002536    next = (LispObj *) ptr_from_lispobj(*current);
    25012537    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);
    25032539  }
    25042540}
     
    25272563
    25282564#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);
    25402576
    25412577  purify_locref(&(regs[Iip]), low, high, to, PURIFY_NOTHING);
     
    25432579#else
    25442580  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);
    25462582  }
    25472583  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);
    25492585  }
    25502586  if (! (regs[REG_EFL] & EFL_DF)) {
    25512587    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);
    25532589    }
    25542590  }
    25552591  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);
    25572593  }
    25582594  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);
    25602596  }
    25612597  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);
    25632599  }
    25642600  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);
    25662602  }
    25672603  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);
    25692605  }
    25702606  purify_locref(&regs[REG_EIP], low, high, to, what);
     
    25782614  LispObj *start = tcr->tlb_pointer, *end = (LispObj *) ((BytePtr)start+n);
    25792615
    2580   purify_range(start, end, low, high, to, what);
     2616  purify_range(start, end, low, high, to, what, false);
    25812617}
    25822618
     
    25962632  }
    25972633#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);
    26032639#endif
    26042640
     
    26352671    case AREA_DYNAMIC:
    26362672    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);
    26382674      break;
    26392675     
     
    27622798      LispObj package_list;
    27632799
    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);
    27652801      for (package_list = nrs_ALL_PACKAGES.vcell;
    27662802           package_list != lisp_nil;
    27672803           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);
    27692805      }
    27702806
     
    27782814                   high,
    27792815                   managed_static_area,
    2780                    PURIFY_ALL);
     2816                   PURIFY_ALL,
     2817                   true);
    27812818      /* Go back through all areas, resolving forwarding pointers
    27822819         (but without copying anything.) */
Note: See TracChangeset for help on using the changeset viewer.