Changeset 11780 for release/1.3


Ignore:
Timestamp:
Feb 24, 2009, 3:01:54 AM (10 years ago)
Author:
rme
Message:

x8632 gc/runtime bugfixes from trunk (r11748, r11752, r11754)

Location:
release/1.3/source/lisp-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/1.3/source/lisp-kernel/x86-exceptions.c

    r11770 r11780  
    23392339#endif
    23402340#ifdef X8632
     2341/* The lisp assembler might use both a modrm byte and a sib byte to
     2342   encode a memory operand that contains a displacement but no
     2343   base or index.  Using the sib byte is necessary for 64-bit code,
     2344   since the sib-less form is used to indicate %rip-relative addressing
     2345   on x8664.  On x8632, it's not necessary, slightly suboptimal, and
     2346   doesn't match what we expect; until that's fixed, we may need to
     2347   account for this extra byte when adjusting the PC */
     2348#define LISP_ASSEMBLER_EXTRA_SIB_BYTE
    23412349#ifdef WIN32_ES_HACK
    23422350/* Win32 keeps the TCR in %es */
     
    23472355#endif
    23482356opcode load_allocptr_reg_from_tcr_save_allocptr_instruction[] =
    2349   {TCR_SEG_PREFIX,0x8b,0x0d,0x84,0x00,0x00,0x00};
     2357  {TCR_SEG_PREFIX,0x8b,0x0d,0x84,0x00,0x00,0x00};  /* may have extra SIB byte */
    23502358opcode compare_allocptr_reg_to_tcr_save_allocbase_instruction[] =
    2351   {TCR_SEG_PREFIX,0x3b,0x0d,0x88,0x00,0x00,0x00};
     2359  {TCR_SEG_PREFIX,0x3b,0x0d,0x88,0x00,0x00,0x00};  /* may have extra SIB byte */
    23522360opcode branch_around_alloc_trap_instruction[] =
    2353   {0x77,0x02};
     2361  {0x77,0x02};                  /* no SIB byte issue */
    23542362opcode alloc_trap_instruction[] =
    2355   {0xcd,0xc5};
     2363  {0xcd,0xc5};                  /* no SIB byte issue */
    23562364opcode clear_tcr_save_allocptr_tag_instruction[] =
    2357   {TCR_SEG_PREFIX,0x80,0x25,0x84,0x00,0x00,0x00,0xf8};
     2365  {TCR_SEG_PREFIX,0x80,0x25,0x84,0x00,0x00,0x00,0xf8}; /* maybe SIB byte */
    23582366opcode set_allocptr_header_instruction[] =
    2359   {0x0f,0x7e,0x41,0xfa};
     2367  {0x0f,0x7e,0x41,0xfa};        /* no SIB byte issue */
    23602368
    23612369alloc_instruction_id
     
    23912399      sizeof(cons) - fulltag_cons :
    23922400#ifdef X8664
    2393       xpGPR(xp,Iimm1);
    2394 #else
    2395       xpGPR(xp,Iimm0);
    2396 #endif
     2401      xpGPR(xp,Iimm1)
     2402#else
     2403      xpGPR(xp,Iimm0)
     2404#endif
     2405      ;
    23972406    LispObj new_vector;
    23982407
     
    24162425#endif
    24172426        ;
    2418 
     2427     
    24192428      xpPC(xp) += sizeof(set_allocptr_header_instruction);
     2429
    24202430      /* Fall thru */
    24212431    case ID_clear_tcr_save_allocptr_tag_instruction:
    24222432      tcr->save_allocptr = (void *)(((LispObj)tcr->save_allocptr) & ~fulltagmask);
     2433#ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
     2434      if (((pc)(xpPC(xp)))[2] == 0x24) {
     2435        xpPC(xp) += 1;
     2436      }
     2437#endif
    24232438      xpPC(xp) += sizeof(clear_tcr_save_allocptr_tag_instruction);
     2439
    24242440      break;
    24252441    case ID_alloc_trap_instruction:
     
    24372453        xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    24382454        tcr->save_allocptr += disp;
     2455#ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
     2456        /* This assumes that TCR_SEG_PREFIX can't appear
     2457           anywhere but at the beginning of one of these
     2458           magic allocation-sequence instructions. */
     2459        xpPC(xp) -= (sizeof(branch_around_alloc_trap_instruction)+
     2460                     sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction));
     2461        if (*((pc)(xpPC(xp))) == TCR_SEG_PREFIX) {
     2462          xpPC(xp) -= sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction);
     2463        } else {
     2464          xpPC(xp) -= (sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction) + 2);
     2465        }
     2466       
     2467#else
    24392468        xpPC(xp) -= (sizeof(branch_around_alloc_trap_instruction)+
    24402469                     sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction) +
    24412470                     sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction));
     2471#endif
    24422472      }
    24432473      break;
     
    24612491          }
    24622492          tcr->save_allocptr = (void *)(((LispObj)tcr->save_allocptr) & ~fulltagmask);
     2493#ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
     2494          if (((pc)xpPC(xp))[2] == 0x24) {
     2495            xpPC(xp) += 1;
     2496          }
     2497#endif
    24632498          xpPC(xp) += sizeof(clear_tcr_save_allocptr_tag_instruction);
    24642499        } else {
     
    24662501          xpPC(xp) -= (sizeof(compare_allocptr_reg_to_tcr_save_allocbase_instruction) +
    24672502                       sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction));
     2503#ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
     2504          if (*((pc)(xpPC(xp))) != TCR_SEG_PREFIX) {
     2505            /* skipped two instructions with extra SIB byte */
     2506            xpPC(xp) -= 2;
     2507          }
     2508#endif
    24682509          xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    24692510          if (interrupt_displacement) {
     
    24792520      xpGPR(xp,Iallocptr) = VOID_ALLOCPTR;
    24802521      xpPC(xp) -= sizeof(load_allocptr_reg_from_tcr_save_allocptr_instruction);
     2522#ifdef LISP_ASSEMBLER_EXTRA_SIB_BYTE
     2523      if (*((pc)xpPC(xp)) != TCR_SEG_PREFIX) {
     2524        xpPC(xp) -= 1;
     2525      }
     2526#endif
    24812527      /* Fall through */
    24822528    case ID_load_allocptr_reg_from_tcr_save_allocptr_instruction:
  • release/1.3/source/lisp-kernel/x86-gc.c

    r11623 r11780  
    18591859
    18601860  i = ((unsigned short *)node)[2];
    1861   offset = node[--i];
    1862   while (offset) {
    1863     *(LispObj *)(p + offset) = fn;
     1861  if (i) {
    18641862    offset = node[--i];
     1863    while (offset) {
     1864      *(LispObj *)(p + offset) = fn;
     1865      offset = node[--i];
     1866    }
    18651867  }   
    18661868}
     
    19351937#endif
    19361938            *dest++ = node;
    1937             elements -= skip;
    1938             while(skip--) {
    1939               *dest++ = *src++;
    1940             }
     1939            if (skip) {
     1940              elements -= skip;
     1941              while(skip--) {
     1942                *dest++ = *src++;
     1943              }
    19411944#ifdef X8632
    1942             update_self_references(f);
    1943 #endif
     1945              update_self_references(f);
     1946#endif
     1947            }
    19441948            while(elements--) {
    19451949              *dest++ = node_forwarding_address(*src++);
  • release/1.3/source/lisp-kernel/x86-spentry32.s

    r11590 r11780  
    17461746        __(cmpl lisp_global(oldspace_dnode_count),%imm0)
    17471747        __(jae 0b)
    1748         __(ref_global(refbits,%temp0))
     1748        __(ref_global(refbits,%temp1))
    17491749        __(xorb $31,%imm0_b)
    17501750        __(lock)
    1751         __(btsl %imm0,(%temp0))
     1751        __(btsl %imm0,(%temp1))
    17521752        __(ret)
    17531753_endsubp(gvset)
Note: See TracChangeset for help on using the changeset viewer.