Changeset 11522


Ignore:
Timestamp:
Dec 15, 2008, 9:26:35 AM (11 years ago)
Author:
gb
Message:

PPC support for FLASH-FREEZE, which is like FREEZE without forcing
GC.

Incidentally, ensure that GC-related functions (things called via
the gc_like_from_xp() mechanism) return signed_natural results, not
just ints. (I think that in most cases the return values are currently
ignored, but they shouldn't be truncated to 32 bits, just in case something
uses them.)

Location:
trunk/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/arch.lisp

    r11520 r11522  
    331331(defconstant gc-trap-function-purify 1)
    332332(defconstant gc-trap-function-impurify 2)
     333(defconstant gc-trap-function-flash-freeze 4)
    333334(defconstant gc-trap-function-save-application 8)
    334335(defconstant gc-trap-function-get-lisp-heap-threshold 16)
  • trunk/source/level-0/PPC/ppc-utils.lisp

    r11520 r11522  
    586586  (ba .SPmakeu32))
    587587
     588(defppclapfunction flash-freeze ()
     589  "Like FREEZE, but don't GC first."
     590  (check-nargs 0)
     591  (li imm0 arch::gc-trap-function-flash-freeze)
     592  (trlgei allocptr 0)
     593  #+64-bit-target
     594  (ba .SPmakeu64)
     595  #+32-bit-target
     596  (ba .SPmakeu32))
     597
    588598;;; Make a list.  This can be faster than doing so by doing CONS
    589599;;; repeatedly, since the latter strategy might triger the GC several
  • trunk/source/lisp-kernel/gc.h

    r11166 r11522  
    7878void note_memoized_references(ExceptionInformation *,LogicalAddress, LogicalAddress, BytePtr *, BytePtr *);
    7979void gc(TCR *, signed_natural);
    80 int  purify(TCR *, signed_natural);
    81 int impurify(TCR *, signed_natural);
    8280int change_hons_area_size(TCR *, signed_natural);
    8381void delete_protected_area(protected_area_ptr);
     
    138136#define GC_TRAP_FUNCTION_PURIFY 1
    139137#define GC_TRAP_FUNCTION_IMPURIFY 2
     138#define GC_TRAP_FUNCTION_FLASH_FREEZE 4
    140139#define GC_TRAP_FUNCTION_SAVE_APPLICATION 8
    141140
     
    222221void forward_cstack_area(area *);
    223222LispObj compact_dynamic_heap(void);
    224 int purify(TCR *, signed_natural);
    225 int impurify(TCR *, signed_natural);
     223signed_natural purify(TCR *, signed_natural);
     224signed_natural impurify(TCR *, signed_natural);
     225signed_natural gc_like_from_xp(ExceptionInformation *, signed_natural(*fun)(TCR *, signed_natural), signed_natural);
     226
    226227
    227228#endif                          /* __GC_H__ */
  • trunk/source/lisp-kernel/lisp-exceptions.h

    r10385 r11522  
    124124void Bug(ExceptionInformation *, const char *format_string, ...);
    125125void FBug(ExceptionInformation *, const char *format_string, ...);
    126 int gc_from_xp(ExceptionInformation *, signed_natural);
    127 int purify_from_xp(ExceptionInformation *, signed_natural);
    128 int impurify_from_xp(ExceptionInformation *, signed_natural);
    129 int change_hons_area_size_from_xp(ExceptionInformation *, signed_natural);
     126signed_natural gc_from_xp(ExceptionInformation *, signed_natural);
     127signed_natural purify_from_xp(ExceptionInformation *, signed_natural);
     128signed_natural impurify_from_xp(ExceptionInformation *, signed_natural);
     129
    130130
    131131
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r11520 r11522  
    414414natural gc_deferred = 0, full_gc_deferred = 0;
    415415
     416signed_natural
     417flash_freeze(TCR *tcr, signed_natural param)
     418{
     419  return 0;
     420}
     421
    416422OSStatus
    417423handle_gc_trap(ExceptionInformation *xp, TCR *tcr)
     
    461467    }
    462468    xpGPR(xp, imm0) = lisp_heap_gc_threshold;
     469    break;
     470
     471  case GC_TRAP_FUNCTION_FLASH_FREEZE:
     472    untenure_from_area(tenured_area);
     473    gc_like_from_xp(xp,flash_freeze,0);
     474    a->active = (BytePtr) align_to_power_of_2(a->active, log2_page_size);
     475    tenured_area->static_dnodes = area_dnode(a->active, a->low);
     476    if (egc_was_enabled) {
     477      tenure_to_area(tenured_area);
     478    }
     479    xpGPR(xp, imm0) = tenured_area->static_dnodes << dnode_shift;
    463480    break;
    464481
     
    734751   function returned */
    735752
    736 int
     753signed_natural
    737754gc_like_from_xp(ExceptionInformation *xp,
    738                 int(*fun)(TCR *, signed_natural),
     755                signed_natural(*fun)(TCR *, signed_natural),
    739756                signed_natural param)
    740757{
     
    796813
    797814
     815
    798816/* Returns #bytes freed by invoking GC */
    799817
    800 int
     818signed_natural
    801819gc_from_tcr(TCR *tcr, signed_natural param)
    802820{
     
    820838}
    821839
    822 int
     840signed_natural
    823841gc_from_xp(ExceptionInformation *xp, signed_natural param)
    824842{
     
    829847}
    830848
    831 int
     849signed_natural
    832850purify_from_xp(ExceptionInformation *xp, signed_natural param)
    833851{
     
    835853}
    836854
    837 int
     855signed_natural
    838856impurify_from_xp(ExceptionInformation *xp, signed_natural param)
    839857{
  • trunk/source/lisp-kernel/ppc-gc.c

    r11167 r11522  
    20642064
    20652065
    2066 int
     2066signed_natural
    20672067purify(TCR *tcr, signed_natural param)
    20682068{
     
    23242324}
    23252325
    2326 int
     2326signed_natural
    23272327impurify(TCR *tcr, signed_natural param)
    23282328{
Note: See TracChangeset for help on using the changeset viewer.