- Timestamp:
- May 12, 2008, 7:05:33 PM (17 years ago)
- File:
-
- 1 edited
-
branches/ia32/lisp-kernel/x86-gc.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ia32/lisp-kernel/x86-gc.c
r9380 r9459 50 50 #endif 51 51 52 int53 function_code_words(LispObj *f)54 {55 #ifdef X866456 return (int)f[1];57 #else58 return (unsigned short)f[1];59 #endif60 }61 62 52 void 63 53 comma_output_decimal(char *buf, int len, natural n) … … 155 145 LispObj fun; 156 146 157 if (*((unsigned char *)n) == RECOVER_FN_OPCODE) { 158 fun = (LispObj)(*((natural *)(n + 1))); 159 } 147 if (*(unsigned char *)n == RECOVER_FN_OPCODE) 148 fun = *(LispObj *)(n + 1); 160 149 if (fun == 0 || 161 150 (header_subtag(header_of(fun)) != subtag_function) || … … 368 357 #ifdef X8632 369 358 if (tag_n == fulltag_tra) { 370 unsigned char *p = (unsigned char *)n; 371 372 if (*p == RECOVER_FN_OPCODE) { 373 n = *(LispObj *)(p + 1); 359 if (*(unsigned char *)n == RECOVER_FN_OPCODE) { 360 n = *(LispObj *)(n + 1); 374 361 tag_n = fulltag_misc; 375 362 } else … … 495 482 prefix_nodes = (natural) ((int) deref(base,1)); 496 483 #endif 497 prefix_nodes = (natural)function_code_words(base);498 484 if (prefix_nodes > element_count) { 499 485 Bug(NULL, "Function 0x%lx trashed",n); … … 575 561 #ifdef X8632 576 562 if (tag_n == fulltag_tra) { 577 unsigned char *p = (unsigned char *)n; 578 579 if (*p == RECOVER_FN_OPCODE) { 580 n = *(LispObj *)(p + 1); 563 if (*(unsigned char *)n == RECOVER_FN_OPCODE) { 564 n = *(LispObj *)(n + 1); 581 565 tag_n = fulltag_misc; 582 } else 566 } else { 583 567 return; 568 } 584 569 } 585 570 #endif … … 720 705 } 721 706 } else { 707 #ifdef X8632 708 fprintf(stderr, "probably in trouble here\n"); 709 #endif 722 710 /* This is all a bit more complicated than the PPC version: 723 711 … … 910 898 #else 911 899 if (tag_n == fulltag_tra) { 912 unsigned char *p = (unsigned char *)n; 913 LispObj fn = *(LispObj *)(p + 1); 900 LispObj fn = *(LispObj *)(n + 1); 914 901 915 902 base = (LispObj *)untag(fn); … … 1739 1726 int i; 1740 1727 1741 for (i = 0; i < 8; i ++) {1742 if (node_regs_mask & (1<<i)) {1728 for (i = 0; i < 8; i++) 1729 if (node_regs_mask & (1<<i)) 1743 1730 mark_root(regs[i]); 1744 } 1745 } 1731 1746 1732 /* If the EIP isn't pointing into a marked function, we're probably 1747 1733 in trouble. We can -maybe- recover from that if it's tagged as a … … 1755 1741 } else if ((fulltag_of(eip) == fulltag_misc) && 1756 1742 (header_subtag(header_of(eip)) == subtag_function) && 1757 (*( (unsigned char *)(eip))== RECOVER_FN_OPCODE) &&1758 ( (LispObj)(*((natural *)(eip + 1))) == eip)) {1743 (*(unsigned char *)eip == RECOVER_FN_OPCODE) && 1744 (*(LispObj *)(eip + 1)) == eip) { 1759 1745 mark_root(eip); 1760 1746 } else { 1761 Bug(NULL, "Can't find function for eip 0x% 8x", eip);1747 Bug(NULL, "Can't find function for eip 0x%4x", eip); 1762 1748 } 1763 1749 } … … 1803 1789 #endif 1804 1790 } 1791 #ifdef X8632 1792 mark_root(tcr->save0); 1793 mark_root(tcr->save1); 1794 mark_root(tcr->save2); 1795 mark_root(tcr->save3); 1796 mark_root(tcr->next_method_context); 1797 #endif 1805 1798 1806 1799 for (xframes = (xframe_list *) tcr->xframe; … … 1810 1803 mark_xp(xframes->curr); 1811 1804 #else 1812 mark_xp(xframes->curr, tcr->node_regs_mask); 1813 #endif 1814 } 1815 1816 #ifdef X8632 1817 mark_root(tcr->save0); 1818 mark_root(tcr->save1); 1819 mark_root(tcr->save2); 1820 mark_root(tcr->save3); 1821 mark_root(tcr->next_method_context); 1822 #endif 1805 mark_xp(xframes->curr, xframes->node_regs_mask); 1806 #endif 1807 } 1823 1808 } 1824 1809 … … 2050 2035 } 2051 2036 #else 2052 2037 #ifdef X8664 2053 2038 /* Quicker, dirtier */ 2054 2039 LispObj … … 2076 2061 return new; 2077 2062 } 2063 #endif 2064 #ifdef X8632 2065 LispObj 2066 dnode_forwarding_address(natural dnode, int tag_n) 2067 { 2068 natural pagelet, nbits; 2069 unsigned short near_bits; 2070 LispObj new; 2071 2072 if (GCDebug) { 2073 if (! ref_bit(GCdynamic_markbits, dnode)) { 2074 Bug(NULL, "unmarked object being forwarded!\n"); 2075 } 2076 } 2077 2078 pagelet = dnode >> 5; 2079 nbits = dnode & 0x1f; 2080 near_bits = ((unsigned short *)GCdynamic_markbits)[dnode>>4]; 2081 2082 if (nbits < 16) { 2083 new = GCrelocptr[pagelet] + tag_n;; 2084 /* Increment "new" by the count of 1 bits which precede the dnode */ 2085 if (near_bits == 0xffff) { 2086 return (new + (nbits << 3)); 2087 } else { 2088 near_bits &= (0xffff0000 >> nbits); 2089 if (nbits > 7) { 2090 new += one_bits(near_bits & 0xff); 2091 } 2092 return (new + (one_bits(near_bits >> 8))); 2093 } 2094 } else { 2095 new = GCrelocptr[pagelet+1] + tag_n; 2096 nbits = 32-nbits; 2097 2098 if (near_bits == 0xffff) { 2099 return (new - (nbits << 3)); 2100 } else { 2101 near_bits &= (1<<nbits)-1; 2102 if (nbits > 7) { 2103 new -= one_bits(near_bits >> 8); 2104 } 2105 return (new - one_bits(near_bits & 0xff)); 2106 } 2107 } 2108 } 2109 #endif 2078 2110 #endif 2079 2111 … … 2338 2370 } 2339 2371 2340 2341 2372 void 2342 2373 forward_xp(ExceptionInformation *xp) … … 2357 2388 update_noderef(&(regs[Itemp2])); 2358 2389 update_locref(&(regs[Iip])); 2359 #endif 2360 } 2390 #else 2391 update_noderef(&(regs[Iarg_z])); 2392 update_noderef(&(regs[Iarg_y])); 2393 update_noderef(&(regs[Ifn])); 2394 update_noderef(&(regs[Itemp0])); 2395 update_noderef(&(regs[Itemp1])); 2396 update_locref(&(regs[Iip])); 2397 #endif 2398 } 2399 2361 2400 2362 2401 void … … 2620 2659 } 2621 2660 } 2622 2623 } 2624 2661 } 2625 2662 } 2626 2663 return ptr_to_lispobj(dest); … … 3339 3376 if (header_subtag(header) == subtag_function) { 3340 3377 #ifdef X8632 3341 int skip = ( int)((unsigned short*)start[2]);3378 int skip = (unsigned short)(start[1]); 3342 3379 #else 3343 3380 int skip = (int)(start[1]);
Note:
See TracChangeset
for help on using the changeset viewer.
