Changeset 13352


Ignore:
Timestamp:
Jan 3, 2010, 7:32:37 PM (10 years ago)
Author:
gb
Message:

When allocating/freeing static-conses in the kernel, set the CAR of
each free static-cons to #<Unbound>.

In %STATIC-INVERSE-CONS, return NIL if the argument's not a fixnum
in the correct range or if it denotes a free static cons.

Location:
trunk/source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/ppc-misc.lisp

    r13279 r13352  
    10551055(defppclapfunction %static-inverse-cons ((n arg_z))
    10561056  (check-nargs 1)
     1057  (extract-lisptag. imm0 arg_z)
     1058  (bne @fail)
    10571059  (ref-global temp0 static-cons-area)
    10581060  (la n '-128 n)
     1061  (ldr imm0 target::area.ndwords temp0)
    10591062  (ldr imm1 target::area.high temp0)
     1063  (box-fixnum arg_y imm0)
    10601064  (sub imm1 imm1 n)
     1065  (cmplr arg_z arg_y)
    10611066  (sub imm1 imm1 n)
     1067  (bgt @fail)
    10621068  (la arg_z target::fulltag-cons imm1)
     1069  (ldr arg_y target::cons.car arg_z)
     1070  (cmpri arg_y target::unbound)
     1071  (bnelr)
     1072  @fail
     1073  (li arg_z nil)
    10631074  (blr))
    10641075 
  • trunk/source/level-0/X86/X8632/x8632-misc.lisp

    r13279 r13352  
    826826(defx8632lapfunction %static-inverse-cons ((n arg_z))
    827827  (check-nargs 1)
     828  (testl ($ target::tagmask) (% arg_z))
     829  (jne @fail)
    828830  (subl ($ '128) (% arg_z))
    829831  (ref-global static-cons-area temp0)
     832  (movl (@ target::area.ndnodes (% temp0)) (% imm0))
     833  (box-fixnum imm0 arg_y)
     834  (rcmpl (% arg_z) (% arg_y))
     835  (ja @fail)
    830836  (movl (@ target::area.high (% temp0)) (% imm0))
    831837  (subl (% arg_z) (% imm0))
    832838  (subl (% arg_z) (% imm0))
    833839  (lea (@ x8632::fulltag-cons (% imm0)) (% arg_z))
     840  (cmpl ($ x8632::unbound)  (@ x8632::cons.car (% arg_z)))
     841  (je @fail)
     842  (single-value-return)
     843  @fail
     844  (movl ($ (target-nil-value)) (% arg_z))
    834845  (single-value-return))
    835846
  • trunk/source/level-0/X86/x86-misc.lisp

    r13279 r13352  
    910910(defx86lapfunction %static-inverse-cons ((n arg_z))
    911911  (check-nargs 1)
     912  (testl ($ target::tagmask) (% arg_z.l))
     913  (jne @fail)
    912914  (subq ($ '128) (% arg_z))
    913915  (ref-global static-cons-area temp0)
     916  (movq (@ target::area.ndnodes (% temp0)) (% imm0))
     917  (box-fixnum imm0 arg_y)
     918  (rcmpq (% arg_z) (% arg_y))
     919  (ja @fail)
    914920  (movq (@ target::area.high (% temp0)) (% imm0))
    915921  (subq (% arg_z) (% imm0))
    916922  (subq (% arg_z) (% imm0))
    917923  (lea (@ x8664::fulltag-cons (% imm0)) (% arg_z))
    918   (single-value-return))
     924  (cmpb ($ target::unbound-marker) (@ target::cons.car (% arg_z)))
     925  (je @fail)
     926  (single-value-return)
     927  @fail
     928  (movl ($ (target-nil-value)) (% arg_z.l))
     929  (single-value-return)
    919930
    920931
  • trunk/source/lisp-kernel/gc-common.c

    r13346 r13352  
    12301230        if (! (bits & (BIT0_MASK>>bitnum))) {
    12311231          d = c + bitnum;
    1232           d->car = 0;
    12331232          if (i < nstatic_conses) {               
     1233            d->car = unbound;
    12341234            d->cdr = head;
    12351235            head = ((LispObj)d)+fulltag_cons;
    12361236            nfree++;
    12371237          } else {
     1238            d->car = 0;
    12381239            d->cdr = 0;
    12391240          }
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r13297 r13352  
    24532453       i < n;
    24542454       i++, c++) {
     2455    c->car = unbound;
    24552456    c->cdr = prev;
    24562457    prev = ((LispObj)c)+fulltag_cons;
Note: See TracChangeset for help on using the changeset viewer.