Ignore:
Timestamp:
Jun 17, 2013, 5:40:40 AM (6 years ago)
Author:
gb
Message:

(Finally) merge gb-egc branch. Changes:

  • area structure contains refidx slot, with one bit for every 256 bits in the area's refmap
  • write barrier code sets refidx bit when it sets refmap bit. (managed_static refmap - tracks refs from managed_static area to dynamic space - doesn't currently use a refidx.) Handle this in pc_luser_xp() and in check_refmap_consistency() on all architectures.
  • egc uses refidx to traverse (typically sparse) refmap
  • maintain heap_dirty_mark (highest heap address that's been written to since it was mapped, basically). Split new_heap_segment() into machine-dependent and -independent parts. Don't zero_dnodes in GC; zero them (if below heap_dirty_mark) in new_heap_segment().
  • try to ensure that pc_luser_xp() can reliablye find the effective address being written to in interrupted write barrier code. (In some cases, this involved ensuring that write barrier code observed constraints on register usage; in other cases, pc_luser_xp() was just wrong.)
File:
1 edited

Legend:

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

    r15826 r15842  
    225225     without extending the heap.
    226226  */
    227   if (new_heap_segment(xp, bytes_needed, false, tcr)) {
     227  if (new_heap_segment(xp, bytes_needed, false, tcr, NULL)) {
    228228    xpGPR(xp, allocptr) += disp_from_allocptr;
    229229    return true;
     
    240240 
    241241  /* Try again, growing the heap if necessary */
    242   if (new_heap_segment(xp, bytes_needed, true, tcr)) {
     242  if (new_heap_segment(xp, bytes_needed, true, tcr, NULL)) {
    243243    xpGPR(xp, allocptr) += disp_from_allocptr;
    244244    return true;
     
    622622}
    623623
    624 /*
    625   This doesn't GC; it returns true if it made enough room, false
    626   otherwise.
    627   If "extend" is true, it can try to extend the dynamic area to
    628   satisfy the request.
    629 */
    630 
    631 Boolean
    632 new_heap_segment(ExceptionInformation *xp, natural need, Boolean extend, TCR *tcr)
    633 {
    634   area *a;
    635   natural newlimit, oldlimit;
    636   natural log2_allocation_quantum = tcr->log2_allocation_quantum;
    637 
    638   a  = active_dynamic_area;
    639   oldlimit = (natural) a->active;
    640   newlimit = (align_to_power_of_2(oldlimit, log2_allocation_quantum) +
    641               align_to_power_of_2(need, log2_allocation_quantum));
    642   if (newlimit > (natural) (a->high)) {
    643     if (extend) {
    644       signed_natural inhibit = (signed_natural)(lisp_global(GC_INHIBIT_COUNT));
    645       natural extend_by = inhibit ? 0 : lisp_heap_gc_threshold;
    646       do {
    647         if (resize_dynamic_heap(a->active, (newlimit-oldlimit)+extend_by)) {
    648           break;
    649         }
    650         extend_by = align_to_power_of_2(extend_by>>1, log2_allocation_quantum);
    651         if (extend_by < 4<<20) {
    652           return false;
    653         }
    654       } while (1);
    655     } else {
    656       return false;
    657     }
    658   }
    659   a->active = (BytePtr) newlimit;
    660   tcr->last_allocptr = (void *)newlimit;
    661   xpGPR(xp,allocptr) = (LispObj) newlimit;
    662   tcr->save_allocbase = (void*) oldlimit;
    663 
    664   return true;
    665 }
    666 
     624
     625
     626void
     627platform_new_heap_segment(ExceptionInformation *xp, TCR *tcr, BytePtr low, BytePtr high)
     628{
     629  tcr->last_allocptr = (void *)high;
     630  xpGPR(xp,allocptr) = (LispObj) high;
     631  tcr->save_allocbase = (void*) low;
     632}
    667633 
    668634void
     
    16341600      }
    16351601      root = xpGPR(xp,arg_x);
    1636       ea = (LispObj *) (root+xpGPR(xp,arg_y)+misc_data_offset);
     1602      ea = (LispObj *) (root+unbox_fixnum(xpGPR(xp,temp2)));
    16371603      need_memoize_root = true;
    16381604    } else if (program_counter >= &egc_store_node_conditional) {
     
    16441610        return;
    16451611      }
    1646       ea = (LispObj*)(xpGPR(xp,arg_x) + xpGPR(xp,imm0));
     1612      ea = (LispObj*)(xpGPR(xp,arg_x) + unbox_fixnum(xpGPR(xp,temp2)));
    16471613      xpGPR(xp,arg_z) = t_value;
    16481614    } else if (program_counter >= &egc_set_hash_key) {
     
    16781644          ((LispObj)ea < val)) {
    16791645        atomic_set_bit(refbits, bitnumber);
     1646        atomic_set_bit(global_refidx, bitnumber>>8);
    16801647        if (need_memoize_root) {
    16811648          bitnumber = area_dnode(root, lisp_global(REF_BASE));
    16821649          atomic_set_bit(refbits, bitnumber);
     1650          atomic_set_bit(global_refidx,bitnumber>>8);
    16831651        }
    16841652      }
Note: See TracChangeset for help on using the changeset viewer.