Changeset 9466


Ignore:
Timestamp:
May 13, 2008, 7:00:27 PM (11 years ago)
Author:
rme
Message:

Add update_self_references() for x8632. Call it in compact_dynamic_heap().

Endian-related tweak to dnode_forwarding_address().

Trivia: there are 3 separate versions of update_self_references running
around. In addition to this one in C, there's one in LAP (used by the
compiler when creating functions) and another in Lisp, used by the cross-
dumper.

File:
1 edited

Legend:

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

    r9459 r9466  
    143143#ifdef X8632
    144144    {
    145       LispObj fun;
     145      LispObj fun = 0;
    146146
    147147      if (*(unsigned char *)n == RECOVER_FN_OPCODE)
     
    20782078  pagelet = dnode >> 5;
    20792079  nbits = dnode & 0x1f;
    2080   near_bits = ((unsigned short *)GCdynamic_markbits)[dnode>>4];
     2080  /* On little-endian x86, we have to flip the low bit of dnode>>4 to
     2081     get the near_bits from the appropriate half-word. */
     2082  near_bits = ((unsigned short *)GCdynamic_markbits)[(dnode>>4)^1];
    20812083
    20822084  if (nbits < 16) {
     
    24802482}
    24812483
     2484#ifdef X8632
     2485void
     2486update_self_references(LispObj *node)
     2487{
     2488  LispObj fn = fulltag_misc + (LispObj)node;
     2489  unsigned char *p = (unsigned char *)node;
     2490  natural i, offset;
     2491
     2492  i = ((unsigned short *)node)[2] - 2;
     2493  offset = node[i];
     2494  while (offset) {
     2495    *(LispObj *)(p + offset) = fn;
     2496    offset = node[--i];
     2497  }   
     2498}
     2499#endif
    24822500
    24832501/*
     
    25472565#ifdef X8632
    25482566            int skip = *((unsigned short *)src);
     2567            LispObj *f = dest;
    25492568#else
    25502569            int skip = *((int *)src);
     
    25552574              *dest++ = *src++;
    25562575            }
     2576            update_self_references(f);
    25572577            while(elements--) {
    25582578              *dest++ = node_forwarding_address(*src++);
Note: See TracChangeset for help on using the changeset viewer.