Changeset 13243 for branches/purify


Ignore:
Timestamp:
Dec 1, 2009, 3:19:19 AM (10 years ago)
Author:
gb
Message:

PPC static-cons changes.

Location:
branches/purify/source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/purify/source/compiler/PPC/PPC64/ppc64-arch.lisp

    r12196 r13243  
    479479)
    480480
     481
     482(defconstant area.ndwords area.ndnodes)
    481483
    482484
  • branches/purify/source/compiler/PPC/ppc-arch.lisp

    r12127 r13243  
    230230    kernel-imports                      ; some things we need to have imported for us.
    231231    objc-2-personality
    232     emulator-registers                  ; Where the 68K registers are kept.
    233     appmain                             ; application's (c-runtime) main() function
     232    savetoc                  ; used to save TOC on some platforms
     233    saver13                             ; used to save r13 on some platforms
    234234    subprims-base                       ; start of dynamic subprims jump table
    235235    ret1valaddr                         ; magic multiple-values return address.
     
    251251    heap-end                            ; end of lisp heap
    252252    statically-linked                   ; true if the lisp kernel is statically linked
    253     stack-size                          ; weak gc policy/algorithm
     253    stack-size                          ; value of --stack-size arg
    254254    objc-2-begin-catch                  ; objc_begin_catch
    255255    kernel-path
     
    258258    lexpr-return1v                      ; single-value lexpr return address
    259259    in-gc                               ; non-zero when GC-ish thing active
    260     metering-info                       ; kernel metering structure
     260    free-static-conses                  ; fixnum
    261261    objc-2-end-catch                    ; _objc_end_catch
    262262    short-float-zero                    ; low half of 1.0d0
    263263    double-float-one                    ; high half of 1.0d0
    264     ffi-exception                       ; ffi fpscr[fex] bit
     264    static-cons-area                    ;
    265265    exception-saved-registers           ; saved registers from exception frame
    266266    oldest-ephemeral                    ; doublenode address of oldest ephemeral object or 0
     
    270270    host-platform                       ; 0 on MacOS, 1 on PPC Linux, 2 on VxWorks ...
    271271    batch-flag                          ; non-zero if --batch specified
    272     unwind-resume                       ; _Unwind_Resume
    273     weak-gc-method                      ; for gc
     272    unwind-resume                       ; _Unwind_Resume
     273    weak-gc-method                      ; weak gc algorithm.
    274274    image-name                          ; current image name
    275275    initial-tcr                         ; initial thread's context record
  • branches/purify/source/level-0/PPC/ppc-misc.lisp

    r11703 r13243  
    846846  (blr))
    847847
    848 (defppclapfunction %metering-info ((ptr arg_z))
    849   (ref-global imm0 metering-info)
    850   (stw imm0 target::macptr.address ptr)
    851   (blr))
     848
    852849
    853850(defppclapfunction %misc-address-fixnum ((misc-object arg_z))
     
    10241021  (%cdr arg_y arg_z)
    10251022  (strcx. arg_y rzero imm0)
     1023  (bne @again)
     1024  (li imm0 (+ (target-nil-value) (target::kernel-global free-static-conses)))
     1025  @decf
     1026  (lrarx imm1 rzero imm0)
     1027  (subi imm1 imm1 '1)
     1028  (strcx. imm1 rzero imm0)
     1029  (bne @decf)
    10261030  (isync)
    1027   (bne @again)
    10281031  (blr)
    10291032  @lose
     
    10321035  (blr))
    10331036
    1034 (defppclapfunction %augment-static-conses ((head arg_y) (tail arg_z))
    1035   (li imm0 (+ (target-nil-value) (target::kernel-global static-conses)))
    1036   @again
    1037   (lrarx temp0 rzero imm0)
    1038   (str temp0 target::cons.cdr tail)     ; static, no write-barrier issues
    1039   (strcx. head rzero imm0)
    1040   (bne @again)
    1041   (isync)
    1042   (li arg_z nil)
    1043   (blr))
     1037
    10441038
    10451039(defppclapfunction %staticp ((x arg_z))
    10461040  (check-nargs 1)
    1047   (ref-global temp0 tenured-area)
     1041  (ref-global temp0 static-cons-area)
    10481042  (ldr imm1 target::area.low temp0)
    10491043  (sub imm0 x imm1)
    1050   (ldr imm1 target::area.static-dnodes temp0)
     1044  (ldr imm1 target::area.ndnodes temp0)
    10511045  (srri imm0 imm0 target::dnode-shift)
    10521046  (li arg_z nil)
    1053   (cmplr imm0 imm1)
    1054   (bgelr)
    1055   (box-fixnum arg_z imm0)
     1047  (sub imm1 imm1 imm0)
     1048  (cmplri imm1 0)
     1049  (la imm1 128 imm1)
     1050  (blelr)
     1051  (box-fixnum arg_z imm1)
    10561052  (blr))
    10571053
    10581054(defppclapfunction %static-inverse-cons ((n arg_z))
    10591055  (check-nargs 1)
    1060   (ref-global temp0 tenured-area)
    1061   (ldr imm1 target::area.low temp0)
    1062   (add imm1 n imm1)
    1063   (add imm1 n imm1)
     1056  (ref-global temp0 static-cons-area)
     1057  (la n '-128 n)
     1058  (ldr imm1 target::area.high temp0)
     1059  (sub imm1 imm1 n)
     1060  (sub imm1 imm1 n)
    10641061  (la arg_z target::fulltag-cons imm1)
    10651062  (blr))
  • branches/purify/source/level-0/PPC/ppc-utils.lisp

    r12872 r13243  
    616616  (ba .SPnvalret))
    617617 
    618 
     618(defppclapfunction %ensure-static-conses ()
     619  (check-nargs 0)
     620  (li imm0 arch::gc-trap-function-ensure-static-conses)
     621  (trlgei allocptr 0)
     622  (li arg_z nil)
     623  (blr))
    619624
    620625;;; offset is a fixnum, one of the target::kernel-import-xxx constants.
  • branches/purify/source/lib/misc.lisp

    r13238 r13243  
    10061006
    10071007(defun reserved-static-conses ()
    1008   (%fixnum-ref-natural (%get-kernel-global static-cons-area) target::area.ndwords))
     1008  (%fixnum-ref-natural (%get-kernel-global static-cons-area) target::area.ndnodes))
    10091009       
    10101010
  • branches/purify/source/lisp-kernel/lisp.h

    r12665 r13243  
    128128#endif
    129129
     130void allocate_static_conses(natural);
     131
    130132#include <stdio.h>
    131133
  • branches/purify/source/lisp-kernel/pmcl-kernel.c

    r13238 r13243  
    24132413#endif
    24142414#endif
     2415
     2416void
     2417allocate_static_conses(natural n)
     2418{
     2419  BytePtr old_low = static_cons_area->low,
     2420    new_low = old_low - (n<<dnode_shift);
     2421  cons *c;
     2422  natural i;
     2423  LispObj prev;
     2424
     2425  CommitMemory(new_low,old_low-new_low);
     2426
     2427  static_cons_area->low = new_low;
     2428  lower_heap_start(new_low, tenured_area);
     2429  if (active_dynamic_area->low == old_low) {
     2430    active_dynamic_area->low = new_low;
     2431  }
     2432  for (i=0, prev=lisp_global(STATIC_CONSES), c=(cons *)new_low;
     2433       i < n;
     2434       i++, c++) {
     2435    c->cdr = prev;
     2436    prev = ((LispObj)c)+fulltag_cons;
     2437  }
     2438  lisp_global(STATIC_CONSES)=prev;
     2439  lisp_global(FREE_STATIC_CONSES)+=(n<<fixnumshift);
     2440}
  • branches/purify/source/lisp-kernel/ppc-exceptions.c

    r13238 r13243  
    467467    }
    468468    xpGPR(xp, imm0) = lisp_heap_gc_threshold;
     469    break;
     470
     471  case GC_TRAP_FUNCTION_ENSURE_STATIC_CONSES:
     472    allocate_static_conses(32768);
    469473    break;
    470474
     
    527531      }
    528532      switch (selector) {
    529       case GC_TRAP_FUNCTION_SET_HONS_AREA_SIZE:
    530         xpGPR(xp, imm0) = 0;
    531         break;
     533
    532534
    533535      case GC_TRAP_FUNCTION_FREEZE:
  • branches/purify/source/lisp-kernel/x86-exceptions.c

    r13238 r13243  
    164164}
    165165
    166 void
    167 allocate_static_conses(natural n)
    168 {
    169   BytePtr old_low = static_cons_area->low,
    170     new_low = old_low - (n<<dnode_shift);
    171   cons *c;
    172   natural i;
    173   LispObj prev;
    174 
    175   CommitMemory(new_low,old_low-new_low);
    176 
    177   static_cons_area->low = new_low;
    178   lower_heap_start(new_low, tenured_area);
    179   if (active_dynamic_area->low == old_low) {
    180     active_dynamic_area->low = new_low;
    181   }
    182   for (i=0, prev=lisp_global(STATIC_CONSES), c=(cons *)new_low;
    183        i < n;
    184        i++, c++) {
    185     c->cdr = prev;
    186     prev = ((LispObj)c)+fulltag_cons;
    187   }
    188   lisp_global(STATIC_CONSES)=prev;
    189   lisp_global(FREE_STATIC_CONSES)+=(n<<fixnumshift);
    190 }
    191166
    192167Boolean
Note: See TracChangeset for help on using the changeset viewer.