Changeset 14026
- Timestamp:
- Jul 23, 2010, 1:11:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/arm/lisp-kernel/arm-gc.c
r13991 r14026 174 174 175 175 176 176 LispObj 177 code_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 } 177 189 178 190 … … 328 340 if ((dnode < GCndnodes_in_area) && 329 341 !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)); 354 343 } 355 344 } … … 1487 1476 1488 1477 1489 1478 1490 1479 1491 1480 … … 1619 1608 loc = *locaddr, 1620 1609 *headerP; 1621 opcode1622 *p,1623 insn;1624 1610 natural 1625 1611 tag = fulltag_of(loc); … … 1632 1618 case fulltag_even_fixnum: 1633 1619 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); 1650 1626 break; 1651 1627 } … … 1900 1876 1901 1877 switch (fulltag_of(q)) { 1902 #ifdef PPC641903 case fulltag_cons:1904 #endif1905 1878 case fulltag_misc: 1906 1879 case fulltag_even_fixnum: … … 2004 1977 if (!nodeheader_tag_p(tag)) { 2005 1978 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); 2006 1991 } 2007 start++; 2008 impurify_noderef(start, low, high, delta); 2009 start++; 1992 start++; 1993 } 2010 1994 } 2011 1995 } … … 2104 2088 BytePtr ro_base = r->low, ro_limit = r->active, oldfree = a->active, 2105 2089 oldhigh = a->high, newhigh; 2106 unsignedn = ro_limit - ro_base;2107 intdelta = oldfree-ro_base;2090 natural n = ro_limit - ro_base; 2091 signed_natural delta = oldfree-ro_base; 2108 2092 TCR *other_tcr; 2109 2093 … … 2117 2101 a->active += n; 2118 2102 memmove(oldfree, ro_base, n); 2119 munmap(ro_base, n);2103 UnCommitMemory(ro_base, n); 2120 2104 a->ndnodes = area_dnode(a, a->active); 2121 2105 pure_space_active = r->active = r->low;
Note: See TracChangeset
for help on using the changeset viewer.