Changeset 15815


Ignore:
Timestamp:
May 23, 2013, 6:29:18 AM (8 years ago)
Author:
gb
Message:

Indeed, discard last idea: good when applicable, but not always
applicable. Start to implement new idea.

Location:
trunk/source/lisp-kernel
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/area.h

    r15369 r15815  
    7676  natural static_dnodes;        /* for hash consing, maybe other things. */
    7777  natural *static_used;         /* bitvector */
     78  natural *refidx;              /* compressed refbits */
     79  natural first_indexed_ref;    /* area's first bit in refidx */
    7880} area;
    7981
  • trunk/source/lisp-kernel/arm-exceptions.c

    r15814 r15815  
    16781678          ((LispObj)ea < val)) {
    16791679        atomic_set_bit(refbits, bitnumber);
    1680         ephemeral_ref = 1;
    16811680        if (need_memoize_root) {
    16821681          bitnumber = area_dnode(root, lisp_global(REF_BASE));
  • trunk/source/lisp-kernel/arm-spentry.s

    r15812 r15815  
    743743        .globl C(egc_write_barrier_start)
    744744        .globl C(egc_rplaca_did_store)
    745         .globl C(ephemeral_ref)
    746745_spentry(rplaca)
    747746C(egc_write_barrier_start):     
     
    769768        __(strex imm0,imm2,[temp0])
    770769        __(cmp imm0,#0)
    771         __(bne 0b) 
    772         __(ldr imm0,1f)
    773         __(str sp,[imm0,#0])     
    774         __(bx lr)
    775 1:      .word C(ephemeral_ref)
     770        __(bne 0b)       
     771        __(bx lr)
     772
    776773
    777774        .globl C(egc_rplacd)
     
    802799        __(strex imm0,imm2,[temp0])
    803800        __(cmp imm0,#0)
    804         __(bne 0b)
    805         __(ldr imm0,1f)
    806         __(str sp,[imm0,#0])
    807         __(bx lr)
    808 1:      .word C(ephemeral_ref)
     801        __(bne 0b)       
     802        __(bx lr)
    809803       
    810804
     
    840834        __(strex imm0,imm2,[temp0])
    841835        __(cmp imm0,#0)
    842         __(bne 0b)
    843         __(ldr imm0,1f)
    844         __(str sp,[imm0,#0])
    845         __(bx lr)
    846 1:      .word C(ephemeral_ref)
     836        __(bne 0b)       
     837        __(bx lr)
    847838
    848839       
     
    894885        __(tst imm2,imm1)
    895886        __(bxne lr)
    896         __(ldr imm0,2f)
    897         __(str sp,[imm0,#0])
    8988871:      __(ldrex imm2,[temp0])
    899888        __(orr imm2,imm2,imm1)
     
    902891        __(bne 1b)       
    903892        __(bx lr)
    904 2:      .word C(ephemeral_ref)
    905893       
    906894
     
    964952        __(cmp imm0,#0)
    965953        __(bne 2b)
    966         __(ldr imm0,3f)
    967         __(str sp,[imm0,#0])
    968954        __(b 4f)
    969 3:      .word C(ephemeral_ref)
    970 
     955 
    971956/* arg_z = new value, arg_y = expected old value, arg_x = hash-vector,
    972957    vsp`0' = (boxed) byte-offset
     
    10251010        __(strex imm0,imm2,[temp0])
    10261011        __(cmp imm0,#0)
    1027         __(bne 1b)
    1028         __(ldr imm0,6f)
    1029         __(str sp,[imm0,#0])       
     1012        __(bne 1b)       
    10301013C(egc_write_barrier_end):
    103110144:      __(mov arg_z,#nil_value)
     
    10351018        __(mov arg_z,#nil_value)
    10361019        __(bx lr)
    1037 6:      .word C(ephemeral_ref)
     1020
    10381021
    10391022
  • trunk/source/lisp-kernel/constants.h

    r14144 r15815  
    179179#define gc_postgc_pending fixnum_bitmask(26)
    180180
     181typedef struct {
     182  natural w0;
     183  natural w1;
     184} dnode;
  • trunk/source/lisp-kernel/gc-common.c

    r15814 r15815  
    11041104
    11051105
    1106   if (num_memo_dnodes && ephemeral_ref) {
     1106  if (num_memo_dnodes) {
    11071107    if (GCDebug) {
    11081108      check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits);
     
    13531353}
    13541354
    1355 natural
    1356 ephemeral_ref=0;
    1357 
    1358 Boolean
     1355void
    13591356mark_memoized_area(area *a, natural num_memo_dnodes)
    13601357{
     
    13621359  LispObj *p = (LispObj *) a->low, x1, x2;
    13631360  natural inbits, outbits, bits, bitidx, *bitsp, nextbit, diff, memo_dnode = 0;
    1364   Boolean keep_x1, keep_x2, have_ref = false;
     1361  Boolean keep_x1, keep_x2;
    13651362  natural hash_dnode_limit = 0;
    13661363  hash_table_vector_header *hashp = NULL;
    13671364  int mark_method = 3;
    13681365
    1369   if (num_memo_dnodes && ephemeral_ref) {
     1366  if (num_memo_dnodes) {
    13701367    if (GCDebug) {
    13711368      check_refmap_consistency(p, p+(num_memo_dnodes << 1), refbits);
     
    14801477            (hashp == NULL)) {
    14811478          outbits &= ~(BIT0_MASK >> bitidx);
    1482         } else {
    1483           have_ref = true;
    14841479        }
    14851480        memo_dnode++;
     
    14921487    }
    14931488  }
    1494   return have_ref;
    14951489}
    14961490
     
    16921686
    16931687    if (GCephemeral_low) {
    1694       Boolean have_tenured_ref =
    1695         mark_memoized_area(tenured_area, area_dnode(a->low,tenured_area->low));
    1696       Boolean have_managed_static_ref =
    1697         mark_memoized_area(managed_static_area,managed_static_area->ndnodes);
    1698 
    1699       if (!have_tenured_ref && !have_managed_static_ref) {
    1700         ephemeral_ref = 0; /* Otherwise, keep loooking in both places */
    1701       }
     1688      mark_memoized_area(tenured_area, area_dnode(a->low,tenured_area->low));
     1689      mark_memoized_area(managed_static_area,managed_static_area->ndnodes);
    17021690    } else {
    17031691      mark_managed_static_refs(managed_static_area,low_markable_address,area_dnode(a->active,low_markable_address));
  • trunk/source/lisp-kernel/gc.h

    r15814 r15815  
    8787Boolean egc_control(Boolean, BytePtr);
    8888Boolean free_segments_zero_filled_by_OS;
    89 natural ephemeral_ref;
    9089
    9190/* an type representing 1/4 of a natural word */
     
    221220void mark_cstack_area(area *);
    222221void mark_simple_area_range(LispObj *, LispObj *);
    223 Boolean mark_memoized_area(area *, natural);
     222void mark_memoized_area(area *, natural);
    224223LispObj calculate_relocation(void);
    225224void forward_range(LispObj *, LispObj *);
  • trunk/source/lisp-kernel/lisp_globals.h

    r15372 r15815  
    7878#define MANAGED_STATIC_REFBITS (-50) /* refs from managed_static to dynamic */
    7979#define MANAGED_STATIC_DNODES (-51) /* ndnodes in managed_static_area */
     80#define EPHEMERAL_REFIDX      (-52) /* compressed refmap to ephmeral space */
    8081
    8182
    82 
    83 #define MIN_KERNEL_GLOBAL MANAGED_STATIC_DNODES
     83#define MIN_KERNEL_GLOBAL EPHEMERAL_REFIDX
    8484
    8585/* These are only non-zero when an image is being saved or loaded */
  • trunk/source/lisp-kernel/lisp_globals.s

    r15425 r15815  
    212212         _rnode(managed_static_refbits) /* refs from managed_static to dynamic */
    213213         _rnode(managed_static_dnodes) /* ndnodes in managed_static_area */
     214         _rnode(ephemeral_refidx) /* index of refbits */
    214215        _ends
    215216
  • trunk/source/lisp-kernel/memory.c

    r15814 r15815  
    656656    zero_bits(refbits, new_tenured_dnodes);
    657657    lisp_global(OLDEST_EPHEMERAL) = ptr_to_lispobj(curfree);
    658     if (managed_static_area->ndnodes == 0) {
    659       ephemeral_ref = 0;
    660     }
    661658  } else {
    662659    /* Need more (zeroed) refbits & fewer markbits */
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r15802 r15815  
    290290    a->hardlimit = base+hardsize;
    291291    a->softlimit = base+hardsize+softsize;
    292     a->h = h;
    293292    a->softprot = soft_area;
    294293    a->hardprot = hard_area;
     
    722721  add_area_holding_area_lock(a);
    723722  CommitMemory(start, end-start);
    724   a->h = start;
    725723  a->softprot = NULL;
    726724  a->hardprot = NULL;
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r15814 r15815  
    19991999          ((LispObj)ea < val)) {
    20002000        atomic_set_bit(refbits, bitnumber);
    2001         ephemeral_ref = 1;
    20022001        if (need_memoize_root) {
    20032002          bitnumber = area_dnode(root, lisp_global(REF_BASE));
  • trunk/source/lisp-kernel/ppc-spentry.s

    r15813 r15815  
    472472        .globl C(egc_write_barrier_start)
    473473        .globl C(egc_rplaca_did_store)
    474         .globl C(ephemeral_ref)
    475 
    476474_spentry(rplaca)
    477475C(egc_write_barrier_start):
     
    500498        __(bne- 1b)
    501499        __(isync)
    502         __(lis imm0,C(ephemeral_ref)@ha)
    503         __(str sp,C(ephemeral_ref)@l(imm0))
    504500        __(blr)
    505501
     
    532528        __(bne- 1b)
    533529        __(isync)
    534         __(lis imm0,C(ephemeral_ref)@ha)
    535         __(str sp,C(ephemeral_ref)@l(imm0))
    536530        __(blr)
    537531
     
    568562        __(bne- 1b)
    569563        __(isync)
    570         __(lis imm0,C(ephemeral_ref)@ha)
    571         __(str sp,C(ephemeral_ref)@l(imm0))
    572564        __(blr)
    573565
     
    605597        __(bne- 1b)
    606598        __(isync)
    607         __(lis imm0,C(ephemeral_ref)@ha)
    608         __(str sp,C(ephemeral_ref)@l(imm0))
    6095992:             
    610600        __(ref_global(imm1,ref_base))
     
    677667        __(bne- 2b)
    678668        __(isync)
    679         __(lis imm0,C(ephemeral_ref)@ha)
    680         __(str sp,C(ephemeral_ref)@l(imm0))
    681669        __(b 4f)
    682670
     
    716704        __(strcx(imm1,imm2,imm0))
    717705        __(bne- 2b)
    718         __(lis imm0,C(ephemeral_ref)@ha)
    719         __(str sp,C(ephemeral_ref)@l(imm0))
    720706        __(isync)
    721707        /* Memoize hash table header */         
  • trunk/source/lisp-kernel/x86-exceptions.c

    r15814 r15815  
    27602760        if ((bitnumber < lisp_global(OLDSPACE_DNODE_COUNT))) {
    27612761          atomic_set_bit(refbits, bitnumber);
    2762           ephemeral_ref = 1;
    27632762          if (need_memoize_root) {
    27642763            atomic_set_bit(refbits, rootbitnumber);
  • trunk/source/lisp-kernel/x86-spentry32.s

    r15811 r15815  
    17211721_spentry(rplaca)
    17221722        .globl C(egc_rplaca)
    1723         .globl C(ephemeral_ref)
    17241723C(egc_rplaca):
    17251724        /* pc_luser_xp() expects the store to be the first instruction here */
     
    17371736        __(lock)
    17381737        __(btsl %imm0,(%temp0))
    1739         __(movb $1,C(ephemeral_ref))
    17401738        __(xorb $31,%imm0_b)
    174117392:      __(cmpl lisp_global(managed_static_dnodes),%imm0)
     
    17651763        __(lock)
    17661764        __(btsl %imm0,(%temp0))
    1767         __(movb $1,C(ephemeral_ref))
    17681765        __(xorb $31,%imm0_b)       
    176917662:      __(cmpl lisp_global(managed_static_dnodes),%imm0)
     
    17951792        __(lock)
    17961793        __(btsl %imm0,(%temp1))
    1797         __(movb $1,C(ephemeral_ref))
    17981794        __(xorb $31,%imm0_b)
    179917952:      __(cmpl lisp_global(managed_static_dnodes),%imm0)
     
    18271823        __(lock)
    18281824        __(btsl %imm0,(%temp1))
    1829         __(movb $1,C(ephemeral_ref))
    18301825        /* Now memoize the address of the hash vector */
    18311826        __(movl %temp0,%imm0)
     
    18841879        __(lock)
    18851880        __(btsl %imm0,(%arg_y))
    1886         __(movb $1,C(ephemeral_ref))
    18871881        __(xorb $31,%imm0_b)
    188818822:      __(cmpl lisp_global(managed_static_dnodes),%imm0)
     
    19231917        __(lock)
    19241918        __(btsl %imm0,(%arg_y))
    1925         __(movb $1,C(ephemeral_ref))
    19261919        /* Now memoize the address of the hash vector */
    19271920        __(movl %temp1,%imm0)
  • trunk/source/lisp-kernel/x86-spentry64.s

    r15811 r15815  
    17611761       
    17621762_spentry(rplaca)
    1763         .globl C(ephemeral_ref)
    17641763        .globl C(egc_rplaca)
    17651764C(egc_rplaca):
     
    17791778        __(lock)
    17801779        __(btsq %imm0,(%temp0))
    1781         __(movb $1,C(ephemeral_ref)(%rip))
    178217802:      __(cmpq lisp_global(managed_static_dnodes),%imm1)
    17831781        __(jae 0b)
     
    18071805        __(lock)
    18081806        __(btsq %imm0,(%temp0))
    1809         __(movb $1,C(ephemeral_ref)(%rip))
     1807        __(ret)
    181018082:      __(cmpq lisp_global(managed_static_dnodes),%imm1)
    18111809        __(jae 0b)
     
    18381836        __(lock)
    18391837        __(btsq %imm0,(%temp0))
    1840         __(movb $1,C(ephemeral_ref)(%rip))
    184118382:      __(cmpq lisp_global(managed_static_dnodes),%imm1)
    18421839        __(jae 0b)
     
    18711868        __(lock)
    18721869        __(btsq %imm0,(%temp0))
    1873         __(movb $1,C(ephemeral_ref)(%rip))
    18741870        /* Now memoize the address of the hash vector   */
    18751871        __(movq %arg_x,%imm0)
     
    19291925        __(lock)
    19301926        __(btsq %imm1,(%temp1))       
    1931         __(movb $1,C(ephemeral_ref)(%rip))
    19321927        .globl C(egc_store_node_conditional_success_end)
    19331928C(egc_store_node_conditional_success_end):
     
    19601955        __(lock)
    19611956        __(btsq %imm0,(%temp1))
    1962         __(movb $1,C(ephemeral_ref)(%rip))
    19631957        /* Now memoize the address of the hash vector   */
    19641958        __(movq %arg_x,%imm0)
Note: See TracChangeset for help on using the changeset viewer.