Changeset 13260 for branches/purify


Ignore:
Timestamp:
Dec 8, 2009, 12:39:21 AM (10 years ago)
Author:
gb
Message:

Handle locatives (xpPC) and TRAs in purify(). (At least try to
pick up the case where the function has already been forwarded;
this can probably be fooled in some pathological cases.)

File:
1 edited

Legend:

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

    r13127 r13260  
    22562256
    22572257
    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 forwaring
    2261      pointers in, so we don't want garbage that we leave behind to
    2262      look like a header.
    2263      b) We'd like to be able to forward code-vector locatives, and
    2264      it's easiest to do so if we leave a {forward_marker, dnode_locative}
    2265      pair at every doubleword in the old vector.
    2266      */
    22672258  while(physbytes) {
    22682259    *old++ = (BytePtr) forward_marker;
     
    22812272
    22822273Boolean
    2283 copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what)
     2274purify_locref(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what)
    22842275{
    22852276  LispObj obj = *ref, header, new;
     
    22872278  Boolean changed = false;
    22882279
     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
     2303Boolean
     2304copy_reference(LispObj *ref, BytePtr low, BytePtr high, area *dest, int what)
     2305{
     2306  LispObj obj = *ref;
     2307  natural tag = fulltag_of(obj);
     2308
    22892309  if (
    22902310#ifdef X8664
    2291       (tag != fulltag_tra_0) && (tag != fulltag_tra_1)
     2311      (tag == fulltag_tra_0) || (tag == fulltag_tra_1)
    22922312#endif
    22932313#ifdef X8632
    2294       tag != fulltag_tra
     2314      tag == fulltag_tra
    22952315#endif
    22962316      ) {
    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
    23212325
    23222326
     
    24692473  copy_reference(&(regs[Itemp1]), low, high, to, what);
    24702474  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
    24742478#else
    24752479#endif
Note: See TracChangeset for help on using the changeset viewer.