Ignore:
Timestamp:
Dec 27, 2008, 7:19:26 AM (11 years ago)
Author:
rme
Message:

Change the x86 consing sequence to use ja (instead of jg) after comparing
tcr.save_allocptr and tcr.save_allocbase. (If we can manage to reserve
a bigger chunk of heap space, it might happen that these two values differ
in sign, i.e., tcr.save_allocptr might be above #x80000000 and
tcr.save_allocbase below. Of course, it may be a few years yet
before we have to start worrying about crossing #x8000000000000000 on
the x86-64 port...)

Update %ALLOCATE-UVECTOR and CONS vinsns, the Cons and Misc_Alloc_Internal
macros used in subprims, and the %WALK-DYNAMIC-AREA LAP function.

Also change pc_luser_xp() to recognize the ja instruction. (It still
recognizes the jg too, but treats it as ja when emulating it.)

File:
1 edited

Legend:

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

    r11551 r11556  
    22772277;
    22782278opcode branch_around_alloc_trap_instruction[] =
    2279   {0x7f,0x02};
     2279  {0x77,0x02};
    22802280opcode alloc_trap_instruction[] =
    22812281  {0xcd,0xc5};
     
    22962296  switch(program_counter[0]) {
    22972297  case 0xcd: return ID_alloc_trap_instruction;
    2298   case 0x7f: return ID_branch_around_alloc_trap_instruction;
     2298  /* 0x7f is jg, which we used to use here instead of ja */
     2299  case 0x7f:
     2300  case 0x77: return ID_branch_around_alloc_trap_instruction;
    22992301  case 0x48: return ID_set_allocptr_header_instruction;
    23002302#ifdef WINDOWS
     
    23272329  {0x64,0x3b,0x0d,0x88,0x00,0x00,0x00};
    23282330opcode branch_around_alloc_trap_instruction[] =
    2329   {0x7f,0x02};
     2331  {0x77,0x02};
    23302332opcode alloc_trap_instruction[] =
    23312333  {0xcd,0xc5};
     
    23402342  switch(program_counter[0]) {
    23412343  case 0xcd: return ID_alloc_trap_instruction;
    2342   case 0x7f: return ID_branch_around_alloc_trap_instruction;
     2344  /* 0x7f is jg, which we used to use here instead of ja */
     2345  case 0x7f:
     2346  case 0x77: return ID_branch_around_alloc_trap_instruction;
    23432347  case 0x0f: return ID_set_allocptr_header_instruction;
    23442348  case 0x64:
     
    24162420      break;
    24172421    case ID_branch_around_alloc_trap_instruction:
    2418       /* If we'd take the branch - which is a "jg" - around the alloc trap,
     2422      /* If we'd take the branch - which is a "ja" - around the alloc trap,
    24192423         we might as well finish the allocation.  Otherwise, back out of the
    24202424         attempt. */
     
    24232427       
    24242428        if ((!(flags & (1 << X86_ZERO_FLAG_BIT))) &&
    2425             ((flags & (1 << X86_SIGN_FLAG_BIT)) ==
    2426              (flags & (1 << X86_CARRY_FLAG_BIT)))) {
    2427           /* The branch (jg) would have been taken.  Emulate taking it. */
     2429            (!(flags & (1 << X86_CARRY_FLAG_BIT)))) {
     2430          /* The branch (ja) would have been taken.  Emulate taking it. */
    24282431          xpPC(xp) += (sizeof(branch_around_alloc_trap_instruction)+
    24292432                       sizeof(alloc_trap_instruction));
Note: See TracChangeset for help on using the changeset viewer.