Changeset 11556


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.)

Location:
trunk/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/X8632/x8632-vinsns.lisp

    r11467 r11556  
    847847  (movl (:@ (:%seg :rcontext) x8632::tcr.save-allocptr) (:%l x8632::allocptr))
    848848  (rcmpl (:%l x8632::allocptr) (:@ (:%seg :rcontext) x8632::tcr.save-allocbase))
    849   (jg :no-trap)
     849  (ja :no-trap)
    850850  (uuo-alloc)
    851851  :no-trap
     
    11371137  (movl (:@ (:%seg :rcontext) x8632::tcr.save-allocptr) (:%l freeptr))
    11381138  (rcmpl (:%l freeptr) (:@ (:%seg :rcontext) x8632::tcr.save-allocbase))
    1139   (jg :no-trap)
     1139  (ja :no-trap)
    11401140  (uuo-alloc)
    11411141  :no-trap
  • trunk/source/compiler/X86/X8664/x8664-vinsns.lisp

    r11298 r11556  
    962962  (movq (:rcontext x8664::tcr.save-allocptr) (:%q x8664::allocptr))
    963963  (rcmpq (:%q x8664::allocptr) (:rcontext x8664::tcr.save-allocbase))
    964   (:byte #x7f) (:byte #x02) ;(jg :no-trap)
     964  (:byte #x77) (:byte #x02) ;(ja :no-trap)
    965965  (uuo-alloc)
    966966  :no-trap
     
    13101310  (movq (:rcontext x8664::tcr.save-allocptr) (:%q freeptr))
    13111311  (rcmpq (:%q freeptr) (:rcontext x8664::tcr.save-allocbase))
    1312   (:byte #x7f) (:byte #x02) ;(jg :no-trap)
     1312  (:byte #x77) (:byte #x02) ;(ja :no-trap)
    13131313  (uuo-alloc)
    13141314  :no-trap
  • trunk/source/level-0/X86/X8632/x8632-utils.lisp

    r11523 r11556  
    176176    (movl (:rcontext x8632::tcr.save-allocptr) (% allocptr)) ;aka temp0
    177177    (cmpl (:rcontext x8632::tcr.save-allocbase) (% allocptr))
    178     (jg @ok)
     178    (ja @ok)
    179179    (uuo-alloc)
    180180    @ok
  • trunk/source/level-0/X86/x86-utils.lisp

    r11523 r11556  
    211211    (movq (:rcontext x8664::tcr.save-allocptr) (% allocptr))
    212212    (cmpq (:rcontext x8664::tcr.save-allocbase) (% allocptr))
    213     (jg @ok)
     213    (ja @ok)
    214214    (uuo-alloc)
    215215    @ok
  • 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));
  • trunk/source/lisp-kernel/x86-macros.s

    r10499 r11556  
    274274        __(movl rcontext(tcr.save_allocptr),%allocptr)
    275275        __(rcmpl(%allocptr,rcontext(tcr.save_allocbase)))
    276         __(jg macro_label(no_trap))
     276        __(ja macro_label(no_trap))
    277277        uuo_alloc()
    278278macro_label(no_trap):
     
    294294        __(movq rcontext(tcr.save_allocptr),%allocptr)
    295295        __(rcmpq(%allocptr,rcontext(tcr.save_allocbase)))
    296         __(jg macro_label(no_trap))
     296        __(ja macro_label(no_trap))
    297297        uuo_alloc()
    298298macro_label(no_trap):   
     
    327327        __(movl rcontext(tcr.save_allocptr),%allocptr)
    328328        __(cmpl rcontext(tcr.save_allocbase),%allocptr)
    329         __(jg macro_label(no_trap))
     329        __(ja macro_label(no_trap))
    330330        uuo_alloc()
    331331macro_label(no_trap):   
     
    342342        __(movq rcontext(tcr.save_allocptr),%allocptr)
    343343        __(rcmpq(%allocptr,rcontext(tcr.save_allocbase)))
    344         __(jg macro_label(no_trap))
     344        __(ja macro_label(no_trap))
    345345        uuo_alloc()
    346346macro_label(no_trap):   
Note: See TracChangeset for help on using the changeset viewer.