Parent Directory | Revision Log
|Links to HEAD:||(view) (annotate)|
|Links to double-double-reader-checkpoint-1:||(view) (annotate)|
Add basic support for kernel:double-double-float type. The primitive type is there, and basic arithmetic operations work as well as PRINT. But many things do not work: No reader, formatted output, many mixed type arithmetic operations, special functions are just double-float values, coerced to double-double-float. compiler/generic/interr.lisp: o Add new error compiler/generic/new-genesis.lisp: o Dump double-double-float objects (barely tested) compiler/generic/primtype.lisp: o Tell compiler about the new primitive type double-double-float. compiler/generic/vm-fndb.lisp: o Make double-double-float-p a known function. compiler/generic/vm-type.lisp: o Update FLOAT-FORMAT-NAME to include double-double-float compiler/generic/vm-typetran.lisp: o Tell compiler about double-double-float type predicate. compiler/sparc/float.lisp: o Add necessary vops to move double-double-float args, store and load double-double-floats to/from the double-double-stack, double-double-reg moves, box and unbox double-double-floats, move double-double-floats to and from args o Add necessary vops to create a double-double-float and to extract the high and low parts out of a double-double-float. compiler/sparc/parms.lisp: o Define double-double-float-digits compiler/sparc/type-vops.lisp: o Define double-double-float type vop o Adjust number hierarchy to include double-double-float compiler/sparc/vm.lisp: o Define the necessary storage class and storage base for the double-double-reg and double-double-stack. lisp/gencgc.c: o Tell GC about double-double-float objects. lisp/purify.c: o Tell purify about double-double-float objects. code/class.lisp: o Add the new double-double-float class. code/exports.lisp: o Add the necessary symbols to the various packages. (This is important to get right otherwise there's confusion on what symbol really represents double-double-float stuff.) code/float.lisp: o Implement some of the necessary functions to support double-double-float. code/hash-new.lisp: o Hash double-double-floats by xor'ing the hashes of each double-float part. (Is that good enough?) code/irrat.lisp: o Implement the special functions by calling the double-float versions and coercing the result to a double-double-float. This is needed to get type-derivation working, but the precise value isn't that important right now. We'll have to implement them later. code/kernel.lisp: o Make make-double-double-float, double-double-hi, and double-double-lo known functions. code/lispinit.lisp: o Register the :double-double float feature. code/load.lisp: o Add FOP for reading double-double-float values from fasls. (Barely tested, if at all.) code/numbers.lisp: o Implement basic arithmetic operations for double-double-floats. This needs quite a bit of work to clean up, but most things work. code/pred.lisp: o Tell the type system about double-double-float type. code/print.lisp: o Add very rudimentary printing for double-double-float. Basically copied from code written by Richard Fateman, with permission. code/seq.lisp: o Tell coerce how to coerce things to a double-double-float. code/type.lisp: o Tell type system about the new float format double-double-float and how numeric contagion works with double-double-float. code/dump.lisp: o Tell dumper how to dump double-double-float values to a fasl. compiler/float-tran.lisp: o Add appropriate deftransforms to handle conversion of things to double-double-float and from from double-double-float to other float types. o The basic implmentation of double-double-float arithmetic is also here. o Add deftransforms to tell the compiler how to do basic arithmetic and comparisions on double-double-float numbers. compiler/srctran.lisp: o Fix a bug in interval-range-info when :low is 0dd0 and :high is 0. We weren't returning the right value, which confuses interval-div, which caused an infinite loop because we couldn't split the numerator into positive and negative parts. o Tell other parts about double-double-float.
o Disable gencgc consistency checks for DARWIN (but leave asserts enabled). o I think we should call update_dynamic_space_free_pointer for sparc and ppc, at the very least to set last_free_page.
Oops. Fix a couple of typos (missing paren) and reindent scavenge_interrupt_context.
When scavenging interrupt contexts, we need to scavenge LR and CTR registers, in case they're pointing into our heap and what they're pointing to has moved. lisp/Darwin-os.c: o Add support for getting the LR and CTR registers from the context. lisp/gencgc.c: o Handle LR and CTR registers when scavenging the interrupt context. lisp/ppc-lispregs.h: o Define reg_LR and reg_CTR appropriately.
Merge ppc_gencgc_branch to HEAD.
Indent all source files using GNU indent using the config in .indent.pro.
Patch from Gerd Moellmann, cmucl-imp, 2005-05-21: The problem here is that a fixnum value gets stored in an unsigned-byte vector, which messes up the linked list.
From Gerd Moellman, cmucl-imp, 2005-05-15: Bruno reported an endless loop in the following test case: (let ((tab (make-hash-table :test 'eq :weak-p t))) (let ((a (list 'x))) (let ((b (list 'y))) (setf (gethash a tab) 'xxx) (setf (gethash b tab) (cons 'yyy b))) (gc) (list (hash-table-count tab) (gethash a tab) (let ((l nil)) (maphash #'(lambda (k v) (push k l)) tab) l)))) But we return (2 XXX ((Y) (X))) instead of (1 XXX ((X))).
Retire i586_bzero() in favor of memset(). The i586_bzero() routine is demonstrably slower than extant compiler intrinsics or C runtime memset() implementations for blocks of memory greater than or equal to an x86 VM page.
Get rid of fastcopy16 which is only used in cgc.c Get rid of i586_bzero but it may be a good optimization
After almost 1 year of gencgc on sparc without encountering a gc assertion, let's disable gc assertions on sparc now.
make amd64 the same as x86
Finish conversion from hardcoded sigcontext to os_context_t, as initiated by the commit of the NetBSD support, and needed by the upcoming merge of the OS X/Darwin port.
More compiler warning fixes: * gencgc.c: o fixup up fprintf warnings o generation_bytes_allocated() defined only when GC_ASSERTIONS is #defined. * x86-arch.c: fixup printf warnings.
Fix more compiler warnings: * alloc.c: Include gencgc.h to get declaration of alloc(). * gencgc.c: o Include string.h for memset. o Initialize some vars that gcc complains might be uninitialized (but they're not). o scav_fdefn isn't used on sparc, so comment it out. o valid_dynamic_space_pointer, maybe_adjust_large_object, and preserve_pointer are only used on x86, so comment #ifdef them for i386. * os-common.c: o Fix a few printf warnings. o Cast args to bcopy.
Changes from Robert Swindells to support NetBSD.
From Lynn Quam: adds the mark_bit slot to weak-pointers and eliminates the n-squared performance problem with scav_weak_pointer.
- fix syntax for C multiline strings
Clean up printing of generation info to handle the larger heaps we have now.
Remove some unused code that we don't need anymore.
Add comment from Douglas about what DIRECT_SCAV means.
Oops. It's i386, not x86.
Update to sparc gencgc so that alloc-tn holds the current-region-free-pointer. Cross compile may be needed, but I'm not sure. I only used cross-compiling to do this change. sparc/macros.lisp: o Update the allocation macro appropriately for alloc-tn holding the current-region-free-pointer. lisp/gencgc.c: o Define macros for setting and getting *current-region-free-oointer* and *current-region-end-addr* so sparc can use alloc-tn. *current-region-free-pointer* isn't used anymore, but is still a static symbol. It's been replaced by alloc-tn. o On sparc, set_alloc_pointer doesn't need to do anything anymore. o Don't need to call update_dynamic_space_free_pointer anymore. o The assertion that *current-region-free-pointer* is a fixnum is no longer valid on sparc because that is alloc-tn which contains the pseudo-atomic bits. lisp/sparc-arch.c: o The allocation trap instruction is now preceeded by a SUB instruction. Handle that correctly. Keep support for the OR instruction for now, but should be removed. o Set alloc-tn from current_dynamic_space_free_pointer.
Add support for catching heap overflows, similar to the control stack overflow checking. Enable with :heap-overflow-check. We reserve some number of pages on the heap. When the heap reaches the reserved pages, an overflow warning is signalled. The reserved pages are set 0. This allows some additional allocation to happen during debugging, if necessary. If another overflow happens, we throw to top-level. Sparc only right now. * lisp/sparc-assem.S (_do_dynamic_space_overflow_error): New function to handle a heap overflow error. (_do_dynamic_space_overflow_warning): New function to handle heap overflow warning. * lisp/sparc-arch.c (sigill_handler): Handle the two new traps caused by heap overflows. * lisp/interrupt.c (interrupt_handle_space_overflow): New function to handle interrupt caused by heap space overflows. * lisp/gencgc.c (handle_heap_overflow): New function to handle heap overflows. (gc_alloc_new_region): Use handle_heap_overflow. (gc_alloc_large): Use handle_heap_overflow * compiler/sparc/parms.lisp (static-symbols): Add new static symbols for heap overflow checking: dynamic-space-overflow-error-hit and dynamic-space-overflow-warning-hit. * compiler/generic/new-genesis.lisp (finish-symbols): Initialize the new dynamic-space-overflow-error-hit and dynamic-space-overflow-warning-hit static symbols. * code/lispinit.lisp (:heap-overflow-check): Add heap-overflow-check to *runtime-features*, if necessary. ("reserved_heap_pages"): Access to alien variable for heap overflow. (*reserved-heap-pages*): Default number of heap pages to reserve for heap overflow. (%top-level): Set reserved-heap-pages to the default. * code/interr.lisp (dynamic-space-overflow-warning-hit): Add function to handle heap overflow warnings. (dynamic-space-overflow-error-hit): Add function to handle heap overflow error. * code/error.lisp (heap-overflow): Add new condition type for heap overflow
Zap out any bits for pseudo-atomic stuff when getting the alloc-pointer.
It's lowtag_Mask, not lowtagMask.
Convert a few more void* to char*. Add a few casts as needed to get rid of some compiler warnings.
Changes so this will compile under Sun C: o Convert some void* objects to char* objects so we don't try to do pointer arithmetic on void* objects. o Change scavenge to take void* instead of lispobj*. Cast appropriately in the body. o Change uses of scavenge to match the new definition.
Use the new constants lowtagMask, pseudo_atomic_Value, and pseudo_atomic_InterruptedValue instead of the bare 7's, 4's, and 3's and 1's in the code.
o The Sparc port was not correctly scavenging the interrupt handlers. Use the same code as used for x86. o Clean up the code a bit, adding the functions scavenge_interrupt_handlers and scavenge_control_stack. Move some printing noise into those functions. There are still bugs here that are exercised by Eric Marsden's cl-bench with cpu performance counter library.
It's ok for stack references to come from stack objects, because that can happen when we scavenge the control stack on non-x86.
* src/lisp/gencgc.c (GC_ASSERTIONS): New define for activating GC assertions. Define it for sparc. (invalid_stack_start, invalid_stack_end) [GC_ASSERTIONS]: New variables. (garbage_collect_generation) [GC_ASSERTIONS]: Set them. (check_escaped_stack_object) [GC_ASSERTIONS]: New function. (scavenge) [GC_ASSERTIONS]: Call it.
Don't blindly set current_dynamic_space_free_pointer in the set_alloc_pointer macor. Instead, carefully merge the value with any pseudo-atomic bits that might have been set.
* src/lisp/gencgc.c (alloc_pseudo_atomic): Wrap alloc in pseudo-atomic only if not already in a pseudo-atomic section.
* src/lisp/alloc.c (alloc) [GENCGC]: Define as alloc_pseudo_atomic. * src/lisp/gencgc.c (set_pseudo_atomic_atomic) (clr_pseudo_atomic_atomic) [i386]: Reverse the values assigned to PSEUDO_ATOMIC_ATOMIC, remove semicolons. (alloc_pseudo_atomic): New function wrapping alloc in a pseudo-atomic section. (alloc): Remove code for the non-PA case, rewrite the rest to use a loop instead of goto.
Remove the fprintf's where the hash table invariant wasn't true during scavenging. It appears to be true before and after GC.
Merge sparc_gencgc_branch that adds support for gencgc for Solaris.
* code/hash-new.lisp (make-hash-table): Put warning about creating weak tables in #-gencgc. * lisp/gencgc.c (gc_assert): Ensure macro expansion is always a C statement. (struct hash_table): New struct. (HASH_TABLE_SIZE, EQ_HASH): New macros. (weak_hash_tables): New variable. (survives_gc, u32_vector, free_hash_entry, record_for_rehashing) (scav_hash_entries, scav_weak_entries, scan_weak_tables) (scav_hash_vector): New functions. (scav_vector): Removed. (scav_weak_pointer, trans_weak_pointer, scan_weak_pointers): Cleaned up. (gc_init_tables): Use scav_hash_vector instead of scav_vector. (garbage_collect_generation): Call scan_weak_tables. (everywhere): Add casts, change format strings, etc. to placate the compiler. * lisp/FreeBSD-os.h: Fix a function prototype.
Add a more informative error message to the stuff that is printed to the terminal when gencgc exhausts dynamic space.
Remove a #ifdef ITA which sneaked in with the profiler changes. No functional change for normal builds.
Make (time ...) and the profiler do precise measuring of space allocation. It will also not overflow or bomb out when consing amounts cross most-positive fixnum. The new profiler also has an interface to plug in your own print function (also dictates sorting or results). This is written on gencgc/x86 but tests indicated the fallsbacks for other platforms work. The dfixnum package included here is sketchy.
On x86 FreeBSD and Linux, change the way foreign symbol addresses are resolved. They now go through a table -- effectively a new space in the core file. Function references are resolved lazily, data references are resolved on startup and when a .so is loaded. The end result is that cores can be dumped that contain references to symbols in shared libraries. Also, the dependence of the core on addresses in the Lisp runtime is broken. The linkage table feature is controlled by :linkage-table and LINKAGE_TABLE in C runtime. Several foreign symbols are now Lisp static symbols, so a cross compile is required whether or not the new stuff is used. I've checked in boot4-cross-foreign-linkage.lisp that builds the compiler for linkage table; do whatever you usually do for the non-linkage table case:) Seriously, lets start a discussion on standardizing "cross compilation," not to mention the general build procedure.
Added specialised port to NetBSD (1.5.2) on x86. Since the code-base was already cleaned up with the OpenBSD port, this doesn't require massive changes. Since current NetBSD is ELF-based by default, we don't make use of the ELF feature, or in other words: The presence of the NetBSD feature implies ELF, since there is no support for non-ELF NetBSD. The page-protection feature of the generational GC had to be turned off, because currently NetBSD 1.5.2 doesn't provide access to the faulting memory address in SIGSEGV signal-handlers on the x86 platform. The memory is validated/mmapped in 64MB chunks in os-validate, in order to circumvent a restriction on NetBSD, that prevented me from mmapping 128MB or more apiece. It has been pointed out to me that this may be caused by the default ulimit on data segment sizes, which seems kind of strange, but might be true. In any case the current approach works OK, and doesn't require root interaction, so is probably the better approach.
Added specialised port to OpenBSD (2.9). Many parts of the original code which were previously conditionalized on :FreeBSD, are now conditionalized on :BSD instead, with the :BSD feature now implying a 4.4BSD(lite2) derived OS. This should make future BSD-ports easier. FreeBSD and OpenBSD are differentiated by having either :FreeBSD or :OpenBSD on the features list. Currently the OpenBSD port does not have working ELF support, because OpenBSD 2.9 is still non-ELF by default. So don't put ELF on the features list when building for OpenBSD, or fix the code to work correctly in this case instead.
Cleanup compiler warnings.
o Add the command line switch -dynamic-space-size for setting the size of the dynamic space. DYNAMIC_SPACE_SIZE now defines the maximum size, and when defined DEFAULT_DYNAMIC_SPACE_SIZE gives the default. o Increase the maximum dynamic space size for Linux x86 to 1.625GB, with the default remaining at 512MB. o Define the default dynamic space size for FreeBSD x86 to also be 512MB, with a maximum of 2GB.
Use the value 0xffffffff to represent auto_gc_trigger disabled rather than zero, simplifying the trigger test.
Minor source cleanups.
Misc source cleanup.
Flush a verbose debug message that occurred rarely during code fixups.
Flush references to zero_stack as this has been handled by scrub-control-stack for some time.
Replace the PAGE_BYTES define with PAGE_SIZE, and use it where appropriate rather than the constant 4096. Remove uses of the variable last_used_page.
Portability fix for the signal masked check in alloc.
Improve the packing of information into the page table, reducing the table size by 25%, and move to a fixed layout of the page flags to better support future atomic operations for threaded code.
Few fixes for the page zero check in gc_free_heap; work around a gcc problem, and limit the range of pages to be checked.
Fix a bug in the page zero checking code of gc_free_heap.
Save and reset FP state during the execution of print_generation_stats. This is necessary when this function is called directly from the allocation routines on a failure and the FP state is setup for Lisp.
Add verify_zero_fill to verify that the free memory is zero filled; helping detect heap corruption. The check can be enabled during a heap verify via gencgc_enable_verify_zero_fill, or it can be called from lisp via the alien function gencgc_verify_zero_fill.
Make search_dynamic_space an external as it is need by purify. Make valid_dynamic_space_pointer a static local as a similarly name function is used by purify.
Enhance scavenge_thread_stacks to only scavenge the live portion of the saved stack vectors.
Take more care when scavenging the Lisp functions of the interrupt handlers, taking care to avoid SIG_DFL, and SIG_IGN which is equal to 1 on FreeBSD and looks like a forwarding point which causes trouble.
Further cleanup of the interrupts masked check in alloc. Cleanup the verbose messages, making them all dependent on the verbose level, and disable them all by default.
Add some pointer coercions to reduce the number of compiler warnings.
Disable a test in alloc that tested that interrupts were disabled in non-pseudo-atomic allocations, because this code has been debugged now and the test may not have been very portable.
Improve the efficiency of gc_free_heap by having it assume free pages are zero filled and not write protected which should be the case. Make more of the consistency checks conditional and disable them all.
Comment out verbose message in maybe_adjust_large_object.
Conservative generational garbage collection for the x86 port.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|Powered by ViewVC 1.1.5|