Changeset 14026 for branches


Ignore:
Timestamp:
Jul 23, 2010, 1:11:03 PM (9 years ago)
Author:
gb
Message:

About 7 years late: use the current (GC) thread's binding of *PACKAGE*
for GCTWA, not the static binding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/lisp-kernel/arm-gc.c

    r13991 r14026  
    174174
    175175
    176 
     176LispObj
     177code_vector_from_pc(LispObj *pcloc)
     178{
     179  /* Scan forward from pcloc until we find a 0 word (marking the start
     180     of a constant pool or the empty constant pool at the end of the
     181     code vector.  The word following the 0 contains the offset of that
     182     word from the code-vector header. */
     183  while (*pcloc) {
     184    pcloc++;
     185  }
     186  pcloc -= *pcloc;
     187  return (LispObj)pcloc+fulltag_misc;
     188}
    177189
    178190
     
    328340    if ((dnode < GCndnodes_in_area) &&
    329341        !ref_bit(GCmarkbits,dnode)) {
    330       LispObj
    331         *headerP,
    332         header;
    333 
    334       for(headerP = (LispObj*)(pc);
    335           gc_area_dnode(headerP) < GCndnodes_in_area;
    336           headerP++) {
    337         header = *headerP;
    338         if (header == 0) {      /* start of constant pool or end of function */
    339           headerP++;
    340           headerP -=  *headerP;
    341           header = *headerP;
    342           if (header_subtag(header) == subtag_code_vector) {
    343             set_n_bits(GCmarkbits, dnode, (2+header_element_count(header))>>1);
    344             return;
    345           }
    346           break;
    347         }
    348       }
    349       /*
    350         Expected to have found a header by now, but didn't.
    351         That's a bug.
    352         */
    353       Bug(NULL, "code_vector header not found!");
     342      mark_root(code_vector_from_pc((LispObj *)pc));
    354343    }
    355344  }
     
    14871476
    14881477
    1489 
     1478 
    14901479
    14911480     
     
    16191608    loc = *locaddr,
    16201609    *headerP;
    1621   opcode
    1622     *p,
    1623     insn;
    16241610  natural
    16251611    tag = fulltag_of(loc);
     
    16321618    case fulltag_even_fixnum:
    16331619    case fulltag_odd_fixnum:
    1634       if (*headerP == forward_marker) {
    1635         *locaddr = (headerP[1]+tag);
    1636       } else {
    1637         /* Grovel backwards until the header's found; copy
    1638            the code vector to to space, then treat it as if it
    1639            hasn't already been copied. */
    1640         p = (opcode *)headerP;
    1641         do {
    1642           p += 1;
    1643           insn = *p;
    1644         } while (insn);
    1645         p++;
    1646         p -= *p;
    1647         Bug(NULL, "funky code in purfiy_locref()");
    1648         *locaddr = purify_displaced_object(ptr_to_lispobj(p), to, tag);
    1649       }
     1620      if (*headerP != forward_marker) {
     1621        LispObj code_vector = code_vector_from_pc(headerP);
     1622       
     1623        copy_ivector_reference(&code_vector, low, high, to);
     1624      }
     1625      *locaddr = (headerP[1]+tag);
    16501626      break;
    16511627    }
     
    19001876 
    19011877  switch (fulltag_of(q)) {
    1902 #ifdef PPC64
    1903   case fulltag_cons:
    1904 #endif
    19051878  case fulltag_misc:
    19061879  case fulltag_even_fixnum:
     
    20041977      if (!nodeheader_tag_p(tag)) {
    20051978        impurify_noderef(start, low, high, delta);
     1979      }
     1980      start++;
     1981      if (header_subtag(header) == subtag_function) {
     1982        LispObj entrypt = *start;
     1983        if ((entrypt > (LispObj)low) &&
     1984            (entrypt < (LispObj)high) &&
     1985            (fulltag_of(entrypt) == fulltag_odd_fixnum)) {
     1986          *start = untag(entrypt) + fulltag_misc;
     1987          impurify_noderef(start, low, high, delta);
     1988          *start = untag(*start)+fulltag_odd_fixnum;
     1989        } else {
     1990          impurify_noderef(start, low, high, delta);
    20061991        }
    2007       start++;
    2008       impurify_noderef(start, low, high, delta);
    2009       start++;
     1992        start++;
     1993      }
    20101994    }
    20111995  }
     
    21042088    BytePtr ro_base = r->low, ro_limit = r->active, oldfree = a->active,
    21052089      oldhigh = a->high, newhigh;
    2106     unsigned n = ro_limit - ro_base;
    2107     int delta = oldfree-ro_base;
     2090    natural n = ro_limit - ro_base;
     2091    signed_natural delta = oldfree-ro_base;
    21082092    TCR *other_tcr;
    21092093
     
    21172101      a->active += n;
    21182102      memmove(oldfree, ro_base, n);
    2119       munmap(ro_base, n);
     2103      UnCommitMemory(ro_base, n);
    21202104      a->ndnodes = area_dnode(a, a->active);
    21212105      pure_space_active = r->active = r->low;
Note: See TracChangeset for help on using the changeset viewer.