mit-scheme.git
14 years agoBack out i386 rewriting rule to optimize OBJECT->FIXNUM operands.
Taylor R Campbell [Sun, 17 Oct 2010 02:01:19 +0000 (02:01 +0000)]
Back out i386 rewriting rule to optimize OBJECT->FIXNUM operands.

This causes conpar.scm, for example, to be miscompiled.

14 years agoNuke old Unix-specific I/O selection primitives.
Taylor R Campbell [Sun, 17 Oct 2010 01:43:56 +0000 (01:43 +0000)]
Nuke old Unix-specific I/O selection primitives.

These have been unused for a decade and broken for half that.

14 years agoSimplify and fix X-DISPLAY-PROCESS-EVENTS primitive.
Taylor R Campbell [Sat, 16 Oct 2010 06:13:43 +0000 (06:13 +0000)]
Simplify and fix X-DISPLAY-PROCESS-EVENTS primitive.

This primitive no longer supports options for blocking vs
non-blocking or selecting vs not selecting; these are now the
responsibility of the caller.

The cached event trick previously used the value of the
uninitialized variable `event', rather than the event that was
cached.  Now it correctly uses the event that was cached.

14 years agoFix and simplify recent change to xterm_dump_rectangle.
Taylor R Campbell [Fri, 15 Oct 2010 03:28:33 +0000 (03:28 +0000)]
Fix and simplify recent change to xterm_dump_rectangle.

14 years agoFinish fix in last change to entity unparsers.
Taylor R Campbell [Thu, 14 Oct 2010 05:32:03 +0000 (05:32 +0000)]
Finish fix in last change to entity unparsers.

14 years agoFix bug in recent change to entity unparsers.
Taylor R Campbell [Thu, 14 Oct 2010 05:17:20 +0000 (05:17 +0000)]
Fix bug in recent change to entity unparsers.

14 years agoFix uninitialized reference in xterm_dump_rectangle.
Taylor R Campbell [Thu, 14 Oct 2010 04:59:39 +0000 (04:59 +0000)]
Fix uninitialized reference in xterm_dump_rectangle.

14 years agoImplement user-defined unparser methods for entities.
Taylor R Campbell [Thu, 14 Oct 2010 04:50:52 +0000 (04:50 +0000)]
Implement user-defined unparser methods for entities.

New DEFINE-STRUCTURE option PRINT-ENTITY-PROCEDURE is like
PRINT-PROCEDURE, except that the second argument to the procedure
is not a structure instance itself but an entity whose extra is a
structure instance.

New procedure SET-RECORD-TYPE-ENTITY-UNPARSER-METHOD! is like
SET-RECORD-TYPE-UNPARSER-METHOD! with the same difference.

New optional argument to MAKE-RECORD-TYPE specifies an entity
unparser method.

Existing code should be unaffected by the changes, including
existing compiled code that used DEFINE-STRUCTURE.

14 years agoMake the debugger robust to errors while printing.
Taylor R Campbell [Thu, 14 Oct 2010 04:42:21 +0000 (04:42 +0000)]
Make the debugger robust to errors while printing.

14 years agoFix some signedness issues in the X11 primitives.
Taylor R Campbell [Thu, 14 Oct 2010 03:02:18 +0000 (03:02 +0000)]
Fix some signedness issues in the X11 primitives.

Times are always unsigned; reflect this.

Screen coordinates are signed, and not always nonnegative; project
negative ones onto the border.  Widths and heights are technically
signed too, according to my Xlib.h, but I haven't observed negative
values, and negative values can't possibly make sense, whereas I have
observed negative coordinates in the wild (button down in-window,
button up out-of-window).

14 years agoFix harmless typo in recent change to cache IMAIL message properties.
Taylor R Campbell [Tue, 12 Oct 2010 02:31:58 +0000 (02:31 +0000)]
Fix harmless typo in recent change to cache IMAIL message properties.

14 years agoRefuse to signal a subprocess that has terminated.
Taylor R Campbell [Mon, 11 Oct 2010 02:47:43 +0000 (02:47 +0000)]
Refuse to signal a subprocess that has terminated.

Once Scheme has called wait*(2) on a process that has terminated, its
pid may be recycled, so attempting to send a signal to it may cause a
signal to be sent to some random process!

New tests for subprocess support include a regression test for this.

14 years agoBack out accidentally committed changes to i386.m4 fenv routines.
Taylor R Campbell [Fri, 8 Oct 2010 04:48:27 +0000 (04:48 +0000)]
Back out accidentally committed changes to i386.m4 fenv routines.

14 years agoFix recent change to FLUID-LET to support unassigning.
Taylor R Campbell [Fri, 8 Oct 2010 04:13:46 +0000 (04:13 +0000)]
Fix recent change to FLUID-LET to support unassigning.

Fixes

(define x 0)
(fluid-let ((x)) ...)
;The object (), passed as an argument to safe-car, is not a pair.

14 years agoAdd hook in dynamically loaded modules for unloading actions.
Taylor R Campbell [Thu, 7 Oct 2010 15:26:15 +0000 (15:26 +0000)]
Add hook in dynamically loaded modules for unloading actions.

Dynamically loaded modules can't use reload cleanups, because they
may be unloaded by pruxdld's reload cleanup before their reload
cleanups get to run, causing DISK-RESTORE to attempt to execute
unmapped code.  Instead, pruxdld will now call dload_finalize_file
if it is defined in the file.

Use this mechanism in prx11.  Fixes DISK-RESTORE after launching
and exiting Edwin.  (Does not fix DISK-RESTORE of an image that was
saved while Edwin was running.  That is much harder.)

14 years agoFix comments in i386.m4 and x86-64.m4 about executable stack.
Taylor R Campbell [Thu, 7 Oct 2010 05:59:36 +0000 (05:59 +0000)]
Fix comments in i386.m4 and x86-64.m4 about executable stack.

14 years agoFix recent change to SHALLOW-FLUID-BIND.
Taylor R Campbell [Thu, 7 Oct 2010 05:47:30 +0000 (05:47 +0000)]
Fix recent change to SHALLOW-FLUID-BIND.

This works around lossage with unassigned variables:

   (define x)
   (fluid-let ((x 0)) ...)
   ;Unassigned variable: x

This relies on the deprecated semantics of SET! that returns the
variable's old value (or old reference trap, if unassigned).

14 years agoFix PC-in-builtin detection.
Taylor R Campbell [Thu, 7 Oct 2010 02:33:06 +0000 (02:33 +0000)]
Fix PC-in-builtin detection.

n_builtins must be incremented if it is ever to exceed 0...

14 years agoMinor hack to revive the 6.001 REPL.
Taylor R Campbell [Thu, 7 Oct 2010 00:42:26 +0000 (00:42 +0000)]
Minor hack to revive the 6.001 REPL.

14 years agoCache parsed date, subject, author, and recipient in memory in IMAIL.
Taylor R Campbell [Thu, 7 Oct 2010 00:36:52 +0000 (00:36 +0000)]
Cache parsed date, subject, author, and recipient in memory in IMAIL.

This is not really the right thing, but it substantially speeds up
sorting, and slightly speeds up summarization, without requiring the
memory overhead of keeping whole headers strongly in memory.

What IMAIL should really do is

(1) store headers (and bodies and body structures and so on) strongly
in memory, and use a secondary GC daemon to discard them when space is
short; and

(2) use a generic, compact, on-disk cache, for every folder, of the
important information for each message: date, subject, author,
recipient, message-id, thread-id.

14 years agoDon't invoke B-M for one-character patterns in SUBSTRING-SEARCH-ALL.
Taylor R Campbell [Thu, 7 Oct 2010 00:33:50 +0000 (00:33 +0000)]
Don't invoke B-M for one-character patterns in SUBSTRING-SEARCH-ALL.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Wed, 6 Oct 2010 04:57:39 +0000 (04:57 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoChange URI abstraction to handle percent encoding in the authority.
Chris Hanson [Thu, 30 Sep 2010 10:13:36 +0000 (03:13 -0700)]
Change URI abstraction to handle percent encoding in the authority.
Change terminology slightly to match RFC.

14 years agoApply patch from Eric Christopherson to allow calling mit-scheme.app/Contents/Resourc...
Chris Hanson [Thu, 30 Sep 2010 09:20:15 +0000 (02:20 -0700)]
Apply patch from Eric Christopherson to allow calling mit-scheme.app/Contents/Resources/mit-scheme from command line.

14 years agoSimplify idiom for implementing dynamic binding.
Taylor R Campbell [Mon, 13 Sep 2010 15:34:17 +0000 (15:34 +0000)]
Simplify idiom for implementing dynamic binding.

14 years agoNew macro BEGIN0.
Taylor R Campbell [Mon, 13 Sep 2010 15:28:31 +0000 (15:28 +0000)]
New macro BEGIN0.

(BEGIN0 <expression> <command> ...) evaluates <expression>, executes
<command> ..., and then returns the value of <expression>.

(Cf. Common Lisp's PROG1.)

14 years agoMoved declaration inside a block in order to conform to C89.
Arthur A. Gleckler [Thu, 9 Sep 2010 06:15:43 +0000 (23:15 -0700)]
Moved declaration inside a block in order to conform to C89.
(Thanks to Taylor for pointing out the need for this.)

14 years agoUse <error_unimplemented_primitive> in case uint64 is not available.
Arthur A. Gleckler [Tue, 7 Sep 2010 15:03:28 +0000 (08:03 -0700)]
Use <error_unimplemented_primitive> in case uint64 is not available.

14 years agoConditionalized compilation of the flonum casting primitives.
Arthur A. Gleckler [Tue, 7 Sep 2010 05:57:30 +0000 (22:57 -0700)]
Conditionalized compilation of the flonum casting primitives.
The primitives `cast-ieee754-double-to-integer' and
`cast-integer-to-ieee754-double' are omitted when the type
<uint64_t> is not available.

14 years agoAdded <AC_INT64_T> and <AC_UINT64_T> to "configure.ac". The latter is
Arthur A. Gleckler [Mon, 6 Sep 2010 05:32:55 +0000 (22:32 -0700)]
Added <AC_INT64_T> and <AC_UINT64_T> to "configure.ac".  The latter is
now required by "flonum.c" because of the new primitives I added, and
CPH asked me to include the former, too.

14 years agoShrink hashtb.{bin,com,bci} further with judicious use of syntax.
Taylor R Campbell [Sun, 5 Sep 2010 18:57:11 +0000 (18:57 +0000)]
Shrink hashtb.{bin,com,bci} further with judicious use of syntax.

14 years agoWork around bug that makes DECLARE and SYNTAX-RULES not mix.
Taylor R Campbell [Sun, 5 Sep 2010 18:23:04 +0000 (18:23 +0000)]
Work around bug that makes DECLARE and SYNTAX-RULES not mix.

14 years agoFix total botch of last commit.
Taylor R Campbell [Sun, 5 Sep 2010 05:04:47 +0000 (05:04 +0000)]
Fix total botch of last commit.

Make the GC cleverer about reallocating the ephemeron array, in order
to avoid potentially quadratic-time behaviour in MAKE-EPHEMERON and
fasloading files with ephemerons in them.

Now fasls and bands with ephemerons in them should really work, this
time with feeling...

14 years agoNew fasl version to support ephemerons.
Taylor R Campbell [Sat, 4 Sep 2010 05:10:17 +0000 (05:10 +0000)]
New fasl version to support ephemerons.

In the process, complete the transition to the STACK_END fasl format.

In the EPHEMERON fasl format, the fasl header has an extra field for
the number of ephemerons stored in the fasl, for which the fasloader
reserves space in ephemeron_array.

The fasdumper chooses between the C_CODE, STACK_END, or EPHEMERON
fasl format for maximum compatibility:

- If there are any ephemerons in the fasl, the fasdumper chooses the
  EPHEMERON format.  Older microcodes don't know about ephemerons and
  thus can't handle such fasls anyway.

- If dumping a band, the fasdumper chooses the STACK_END format,
  since the only differences between the C_CODE format and the
  STACK_END format matter only for bands.  Support for reading the
  STACK_END format was added in version 15 of the microcode; any
  newly created bands are not likely to be used in older microcodes
  than that anyway.

- Otherwise, the fasdumper chooses the C_CODE format, like before.

14 years agoRemoved NaN tests because they cause traps on Linux. (It turns out
Arthur A. Gleckler [Fri, 3 Sep 2010 03:57:08 +0000 (20:57 -0700)]
Removed NaN tests because they cause traps on Linux.  (It turns out
that they are supposed to on OS X, too, but a bug prevents that).
Taylor is considering adding support for controlling the
floating-point exception mask and flags, in which case we'll be able
to manipulate NaN values and I can add these tests back.

14 years agoAdded tests for infinities.
Arthur A. Gleckler [Thu, 2 Sep 2010 06:56:41 +0000 (23:56 -0700)]
Added tests for infinities.

14 years agoFixed typo in comments.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:57:36 +0000 (22:57 -0700)]
Fixed typo in comments.

14 years agoAdded trivial tests for conversion to floating-point infinities by
Arthur A. Gleckler [Thu, 2 Sep 2010 05:43:46 +0000 (22:43 -0700)]
Added trivial tests for conversion to floating-point infinities by
`cast-integer-to-ieee754-single' and `cast-integer-to-ieee754-double'.

14 years agoFixed code formatting.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:29:34 +0000 (22:29 -0700)]
Fixed code formatting.

14 years ago* Renamed `cast-flonum-to-integer' to `cast-ieee754-double-to-integer'.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:23:39 +0000 (22:23 -0700)]
* Renamed `cast-flonum-to-integer' to `cast-ieee754-double-to-integer'.

* Renamed `cast-integer-to-flonum' to `cast-integer-to-ieee754-double'.

* Changed both to use <uint64_t> instead of <unsigned long> for
conversion.  That way, they should work on 32-bit systems.  (Thanks to
Taylor for pointing out that bug.)

* Added `cast-ieee754-single-to-integer' and `cast-integer-to-ieee754-single'.

* Updated existing tests.

* Added tests for casts to and from single-precision floating-point numbers.

14 years agoRemoved the divisions by zero that I had used to create floating-point
Arthur A. Gleckler [Thu, 2 Sep 2010 03:48:14 +0000 (20:48 -0700)]
Removed the divisions by zero that I had used to create floating-point
infinities since those are supposed to trap, not actually return
infinities.  On OS X, the trap doesn't happen, but I shouldn't depend
on a bug.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/mit-scheme
Arthur A. Gleckler [Wed, 1 Sep 2010 04:17:30 +0000 (21:17 -0700)]
Merge branch 'master' of git://git.savannah.gnu.org/mit-scheme

14 years agoAdded primitives `cast-flonum-to-integer' and `cast-integer-to-flonum'
Arthur A. Gleckler [Wed, 1 Sep 2010 04:16:03 +0000 (21:16 -0700)]
Added primitives `cast-flonum-to-integer' and `cast-integer-to-flonum'
and tests.

14 years agoSofter landing for system-library-directory-pathname if sudirectory doesn't exist.
Joe Marshall [Tue, 31 Aug 2010 20:25:58 +0000 (13:25 -0700)]
Softer landing for system-library-directory-pathname if sudirectory doesn't exist.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Tue, 31 Aug 2010 15:26:30 +0000 (15:26 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoExploit OBJECT->FIXNUM's independence of tag on i386 and x86-64.
Taylor R Campbell [Tue, 31 Aug 2010 15:25:00 +0000 (15:25 +0000)]
Exploit OBJECT->FIXNUM's independence of tag on i386 and x86-64.

14 years agoKill infinite parsing loop by using + inside *, not * inside *.
Taylor R Campbell [Tue, 31 Aug 2010 15:24:00 +0000 (15:24 +0000)]
Kill infinite parsing loop by using + inside *, not * inside *.

14 years agoFixed comment in shadowing test.
Arthur A. Gleckler [Tue, 31 Aug 2010 05:15:15 +0000 (22:15 -0700)]
Fixed comment in shadowing test.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Mon, 30 Aug 2010 21:02:38 +0000 (21:02 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoFix missing -f in test.
Chris Hanson [Mon, 30 Aug 2010 09:10:55 +0000 (02:10 -0700)]
Fix missing -f in test.

14 years agoAdd unit test to confirm that shadowing fix worked.
Chris Hanson [Mon, 30 Aug 2010 06:25:17 +0000 (23:25 -0700)]
Add unit test to confirm that shadowing fix worked.

14 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme
Chris Hanson [Mon, 30 Aug 2010 05:52:55 +0000 (22:52 -0700)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme

14 years agoExtend hash table entry types to support ephemeral hash tables.
Taylor R Campbell [Sun, 29 Aug 2010 17:28:53 +0000 (17:28 +0000)]
Extend hash table entry types to support ephemeral hash tables.

Add some tests for correctness against red/black trees.

Still missing are tests for weak and ephemeral entries types.

14 years agoFix SVM's write_cc_entry_offset.
Taylor R Campbell [Sat, 28 Aug 2010 20:58:19 +0000 (20:58 +0000)]
Fix SVM's write_cc_entry_offset.

Since this is used only to initialize trampolines, the starting
instruction is irrelevant, and will be garbage anyway because the
trampoline blocks are always freshly allocated.

14 years agoFix SVM interpreter's INDEX-FIXNUM? predicate.
Taylor R Campbell [Sat, 28 Aug 2010 20:56:36 +0000 (20:56 +0000)]
Fix SVM interpreter's INDEX-FIXNUM? predicate.

14 years agoFix SVM machine's conditional floating-point jumps.
Taylor R Campbell [Sat, 28 Aug 2010 20:56:03 +0000 (20:56 +0000)]
Fix SVM machine's conditional floating-point jumps.

These want to use the float registers, not the word registers.

14 years agoFix SVM interpreter's decoding of doubles.
Taylor R Campbell [Sat, 28 Aug 2010 20:55:04 +0000 (20:55 +0000)]
Fix SVM interpreter's decoding of doubles.

They are encoded as 64-bit significand and 16-bit exponent, not as
machine (IEEE 754) doubles.

14 years agoIn FLO:VECTOR-LENGTH, coerce length to fixnum before OBJECT->FIXNUM.
Taylor R Campbell [Sat, 28 Aug 2010 20:52:26 +0000 (20:52 +0000)]
In FLO:VECTOR-LENGTH, coerce length to fixnum before OBJECT->FIXNUM.

The previous open-coding worked whenever OBJECT->FIXNUM merely
shifted left by the tag width, ignoring whatever tag was there
before.  The SVM does not do this, however.

14 years agoOmit continuation code words after interpreter cache references.
Taylor R Campbell [Sat, 28 Aug 2010 20:49:33 +0000 (20:49 +0000)]
Omit continuation code words after interpreter cache references.

The RTL already arranges their continuations to follow them; putting
an extra continuation code word causes the machine to try to execute
the real one as if it were an instruction.

14 years agoPRE-INCREMENT is only ever a memory reference, not address, in RTL.
Taylor R Campbell [Sat, 28 Aug 2010 20:48:47 +0000 (20:48 +0000)]
PRE-INCREMENT is only ever a memory reference, not address, in RTL.

14 years agoUse NON-POINTER-OBJECT? and CAREFUL-OBJECT-DATUM in the compiler.
Taylor R Campbell [Sat, 28 Aug 2010 20:47:08 +0000 (20:47 +0000)]
Use NON-POINTER-OBJECT? and CAREFUL-OBJECT-DATUM in the compiler.

Using OBJECT-NON-POINTER? causes primitives to be put into blocks as
non-marked constants, so that the fasloader fails to renumber them.

14 years agoUpdate `last update' dates on the reference and user manuals.
Taylor R Campbell [Mon, 23 Aug 2010 19:13:02 +0000 (19:13 +0000)]
Update `last update' dates on the reference and user manuals.

14 years agoDocument the stack sampler.
Taylor R Campbell [Mon, 23 Aug 2010 18:58:51 +0000 (18:58 +0000)]
Document the stack sampler.

14 years agoDraft fix for over-shadowing bug.
Chris Hanson [Mon, 23 Aug 2010 09:20:00 +0000 (02:20 -0700)]
Draft fix for over-shadowing bug.

14 years agoAdd tests for ephemerons with compiled entries for keys and data.
Taylor R Campbell [Fri, 20 Aug 2010 02:57:36 +0000 (02:57 +0000)]
Add tests for ephemerons with compiled entries for keys and data.

14 years agoFix bug in the GC's ephemeron scanning.
Taylor R Campbell [Fri, 20 Aug 2010 02:57:01 +0000 (02:57 +0000)]
Fix bug in the GC's ephemeron scanning.

When queueing ephemerons for the key stored at some address, compare
the address to the weak referent address of each ephemeron's key --
not to the object address of each ephemeron's key, which causes us to
miss ephemerons whose keys are compiled entries, because we pass the
addresses of compiled blocks, never those of the compiled entries
stored in them, to queue_ephemerons_for_key.

14 years agoMinor fixes to unit-testing.scm.
Taylor R Campbell [Fri, 20 Aug 2010 02:45:31 +0000 (02:45 +0000)]
Minor fixes to unit-testing.scm.

- Update copyright years.
- Ignore unused variable CONDITION in ASSERT-ERROR.
- Use RUN-SUB-TEST to run test procedures in RUN-SUB-TESTS

The last one is probably wrong, but without it, running unit tests
crashes in a bizarre way for me.  Example:

(run-unit-tests "runtime/test-ephemeron")
;Loading "runtime/test-ephemeron.com"... done
no-gc: failed 2 sub-tests out of 2 in .32 seconds:
    .0.0:
;Ill-formed failure: key

14 years agoOmit needless definition of REFERENCE-BARRIER in test-ephemeron.scm.
Taylor R Campbell [Fri, 20 Aug 2010 02:43:13 +0000 (02:43 +0000)]
Omit needless definition of REFERENCE-BARRIER in test-ephemeron.scm.

Due to a bug in the microcode's environment operations, this
definition, which should be harmless, actually renders the tests
unrunnable because it makes REFERENCE-BARRIER spin in an infinite
loop.

14 years agoEliminate losing bisection crock in find_block_address.
Taylor R Campbell [Thu, 19 Aug 2010 02:55:13 +0000 (02:55 +0000)]
Eliminate losing bisection crock in find_block_address.

This wasted several hours of my day in exchange for several
milliseconds of time (`on average') searching through the heap
after a trap that will trigger an interactive debugger anyway
and sit waiting for I/O.

14 years agoFix plausible_cc_block_p some more.
Taylor R Campbell [Thu, 19 Aug 2010 02:46:02 +0000 (02:46 +0000)]
Fix plausible_cc_block_p some more.

Now it detects COLUMN->Y in edwin/bufwmc.scm.

14 years agoAdd a couple more consts to debug.c.
Taylor R Campbell [Wed, 18 Aug 2010 16:30:25 +0000 (16:30 +0000)]
Add a couple more consts to debug.c.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Wed, 18 Aug 2010 16:19:14 +0000 (16:19 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Joe Marshall [Wed, 18 Aug 2010 00:02:48 +0000 (17:02 -0700)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoAdd appropriate const qualifiers for anal compiler.
Joe Marshall [Wed, 18 Aug 2010 00:02:05 +0000 (17:02 -0700)]
Add appropriate const qualifiers for anal compiler.

14 years agoRemove spurious ignore declaration in i386 GENERATE/CLOSURE-HEADER.
Taylor R Campbell [Tue, 17 Aug 2010 19:05:16 +0000 (19:05 +0000)]
Remove spurious ignore declaration in i386 GENERATE/CLOSURE-HEADER.

14 years agoImplement and document SET-EPHEMERON-KEY!.
Taylor R Campbell [Tue, 17 Aug 2010 18:46:26 +0000 (18:46 +0000)]
Implement and document SET-EPHEMERON-KEY!.

14 years agoNew procedure REFERENCE-BARRIER.
Taylor R Campbell [Mon, 16 Aug 2010 22:51:45 +0000 (22:51 +0000)]
New procedure REFERENCE-BARRIER.

(REFERENCE-BARRIER <x>) guarantees that the garbage collector will
assume <x> to be live at least until the call to REFERENCE-BARRIER,
if control can ever reach it.

This is implemented as an alias for the identity procedure currently,
but a more efficient implementation not involving a general procedure
call is conceivable for the future.

14 years agoIgnore out-of-date uncompressed debugging info files.
Taylor R Campbell [Fri, 13 Aug 2010 20:58:42 +0000 (20:58 +0000)]
Ignore out-of-date uncompressed debugging info files.

Fixes

(load "x")
(pp foo)
;Output: (named-lambda (foo x y z) ...)

;; Edit x.scm and recompile.

(load "x")
(pp foo)
;Output: #[compiled-procedure foo ...]

14 years agoNew stack-sampling profiler.
Taylor R Campbell [Fri, 13 Aug 2010 20:25:58 +0000 (20:25 +0000)]
New stack-sampling profiler.

For usage, see runtime/stack-sample.scm.  May be worthwhile to write
documentation in the user manual.

This is *not* a replacement for a PC-sampler, which can give
information that is more precise at one level and less precise at
another level.  See the comments for details.

14 years agoRework the hash table entry abstraction.
Taylor R Campbell [Fri, 13 Aug 2010 20:18:56 +0000 (20:18 +0000)]
Rework the hash table entry abstraction.

This simplifies some of the code (at the expense of a longer
definition for the abstraction leading to a longer hashtb.scm
altogether), and makes it less prone to mistakes with using the
keys and data of entries without checking their validity -- which
will matter especially for hash tables with ephemeron entries when
those are implemented.

Check the results of the key hash table function.  Sprinkle some
guarantees throughout the code.  Disable type and range checks in
the hash table methods, where it is safe to do so.

With type and range checks still enabled, performance on strong eq
and eqv hash tables is no different from what it was last week.
Performance on weak hash tables is ever so slightly worse, but that
is because weak hash tables were incorrect before.

New tests check for some regressions.

14 years agoProtect each use of ENTRY-{KEY,DATUM} in hashtb.scm by ENTRY-VALID?.
Taylor R Campbell [Fri, 13 Aug 2010 04:22:46 +0000 (04:22 +0000)]
Protect each use of ENTRY-{KEY,DATUM} in hashtb.scm by ENTRY-VALID?.

14 years agoFix SRFI 69 HASH-TABLE-FOLD.
Taylor R Campbell [Thu, 12 Aug 2010 22:29:28 +0000 (22:29 +0000)]
Fix SRFI 69 HASH-TABLE-FOLD.

The specification makes no mention of any constraint that the combine
procedure not update the hash table, so we must be prepared for that
case.  The old definition for HASH-TABLE-FOLD now has the new name
%HASH-TABLE-FOLD, used internally by the procedures that need to fold
but need not update the hash table while doing so.

14 years agoRestore warning as per Taylor.
Joe Marshall [Thu, 12 Aug 2010 22:00:06 +0000 (15:00 -0700)]
Restore warning as per Taylor.

14 years agoAdd declarations to silence warnings.
Joe Marshall [Wed, 11 Aug 2010 16:45:10 +0000 (09:45 -0700)]
Add declarations to silence warnings.

14 years agoAdd declaration to silence warning.
Joe Marshall [Wed, 11 Aug 2010 16:43:17 +0000 (09:43 -0700)]
Add declaration to silence warning.

14 years agoDocument ephemerons.
Taylor R Campbell [Tue, 10 Aug 2010 19:58:30 +0000 (19:58 +0000)]
Document ephemerons.

14 years agoImplement ephemerons.
Taylor R Campbell [Tue, 10 Aug 2010 18:43:44 +0000 (18:43 +0000)]
Implement ephemerons.

Ephemerons are like weak pairs, except the datum is dropped if the
key is dropped, and references to the key through the datum don't
count if the only references to the datum are through the ephemeron.
In other words, the weak references to the key and datum are dropped
iff the key can be proven dead; conversely, the references to the key
and datum are preserved iff somebody else cares about the key.

14 years agoDeclare IGNORABLE NB to silence warning.
Joe Marshall [Mon, 9 Aug 2010 19:55:47 +0000 (12:55 -0700)]
Declare IGNORABLE NB to silence warning.

14 years agoMissed some vestiges of archaic microcode state space support.
Taylor R Campbell [Mon, 9 Aug 2010 17:45:10 +0000 (17:45 +0000)]
Missed some vestiges of archaic microcode state space support.

14 years agoEliminate some unused return codes.
Taylor R Campbell [Mon, 9 Aug 2010 17:38:57 +0000 (17:38 +0000)]
Eliminate some unused return codes.

14 years agoEliminate all traces of the archaic microcode state space support.
Taylor R Campbell [Mon, 9 Aug 2010 16:47:03 +0000 (16:47 +0000)]
Eliminate all traces of the archaic microcode state space support.

14 years agoSet -u in the setup scripts and make them more robust to interrupts.
Taylor R Campbell [Mon, 9 Aug 2010 16:44:03 +0000 (16:44 +0000)]
Set -u in the setup scripts and make them more robust to interrupts.

14 years agoCheck for termcap.h too.
Taylor R Campbell [Mon, 9 Aug 2010 16:36:32 +0000 (16:36 +0000)]
Check for termcap.h too.

Assume that term.h or termcap.h defines BC, UP, PC, & ospeed.

Work around !*@#@^!*#%!^&$@!%# stupidity in NetBSD with ospeed.

14 years agoMove the check for termcap-related headers.
Taylor R Campbell [Sun, 8 Aug 2010 02:56:56 +0000 (02:56 +0000)]
Move the check for termcap-related headers.

This puts the warning messages about emulating termcap or tparm
closer to the checks, which makes configure's output make a trifle
more sense.

14 years agoAdd configure option `--with-termcap=LIB' to select termcap library.
Taylor R Campbell [Sun, 8 Aug 2010 01:53:07 +0000 (01:53 +0000)]
Add configure option `--with-termcap=LIB' to select termcap library.

LIB=no disables any termcap library (causing the use of the built-in
termcap emulation); LIB=yes, the default, makes configure choose
whatever termcap library looks best.

I wanted to go further and make the termcap primitives dynamically
loadable, so that the compile-time choice of termcap library can be
made just for some prtermcap.so module separately from the libraries
against which the microcode is linked, but uxtty.c uses termcap for
screen-clearing and window-sizing.

If ^L worked everywhere to clear the screen, and TIOCGWINSZ worked
everywhere to find the screen dimensions, then we could get rid of
those uses of termcap and move it off to a module.  But alas, that is
not the case.  E.g., ^L doesn't clear the screen in screen.

14 years agoFix i386 code generated for flonum rounding primitives.
Taylor R Campbell [Fri, 6 Aug 2010 01:36:09 +0000 (01:36 +0000)]
Fix i386 code generated for flonum rounding primitives.

The default has not been round-to-even since primitives were added to
change it, but the generated code assumed it was.

Remember to run at least a two-stage build so that the runtime is
compiled with the new compiler.

Before:

(flo:with-rounding-mode 'TOWARD-ZERO (lambda () (flo:ceiling 1.2)))
;Value: 1.

After:

(flo:with-rounding-mode 'TOWARD-ZERO (lambda () (flo:ceiling 1.2)))
;Value: 2.

14 years agoEmulate C99 fenv.h on amd64 through the MXCSR.
Taylor R Campbell [Fri, 6 Aug 2010 01:18:01 +0000 (01:18 +0000)]
Emulate C99 fenv.h on amd64 through the MXCSR.

14 years agoEmulate C99 fenv.h on i386 through the i387 control word.
Taylor R Campbell [Fri, 6 Aug 2010 01:17:07 +0000 (01:17 +0000)]
Emulate C99 fenv.h on i386 through the i387 control word.

14 years agoEmulate C99 fenv.h with BSD ieeefp.h if necessary.
Taylor R Campbell [Fri, 6 Aug 2010 01:15:30 +0000 (01:15 +0000)]
Emulate C99 fenv.h with BSD ieeefp.h if necessary.

14 years agoNew procedures FLO:EXPM1 and FLO:LOG1P just like libm's.
Taylor R Campbell [Fri, 6 Aug 2010 00:38:40 +0000 (00:38 +0000)]
New procedures FLO:EXPM1 and FLO:LOG1P just like libm's.

Defined only on an interval about 0 of radius 1/log 2 and 1/sqrt 2,
respectively; intended for computing (exp x) - 1 and log (1 + x) for
very small x with high precision, unlike FLO:EXP and FLO:LOG.