Chris Hanson [Mon, 30 Sep 1996 18:31:14 +0000 (18:31 +0000)]
In x-window-set-input-focus, flush the display queue right away.
Otherwise, the error-catching code from the previous revision will
have no effect since the command will be sent later.
Chris Hanson [Sat, 28 Sep 1996 18:29:33 +0000 (18:29 +0000)]
Change defaults for configuration directories: the course material
goes under "~u6001" but the working directory is in the user's home
directory. The directories are now all chosen when the editor is
started rather than when the band is built.
Chris Hanson [Fri, 27 Sep 1996 23:06:22 +0000 (23:06 +0000)]
Change 6.001 package to put the student root directory in the user's
home directory, rather than using an absolute pathname that might not
exist on a given system.
Stephen Adams [Tue, 30 Jul 1996 19:29:57 +0000 (19:29 +0000)]
Typerew uses checking operations (e.g. CAR with type checks enabled,
or explicit calls to ERROR:WRONG-TYPE-ARGUMENT, etc) to deduce type
information about values in the program. The assumption is that the
error signalling code never returns.
This set of changes makes these operations bulletproof by arranging
that the continuations of the error signalling procedures cannot
resume the code that was compiled under the types deduced from the
assumption. The error continuations now `trap' by jumping to an
appropriate handler.
fakeprim.scm
New operator %halt.
New operator %reference.
errcont.scm
Edits a program to replace continuations to error procedures
(which typically merge back with the non-error case) with
continuations that just call %halt.
laterew.scm
Eliminate %reference.
rtlgen.scm
Recognise continuations containing %halt and produce terse code to
`trap' to the appropriate support procedure.
simplify.scm
Tweak to LETREC case for recognizing dead procedures earlier.
This allows `diamond' code to be linearized in one pass rather than
two.
typerew.scm
Changed to generate code to signal errors calling global procedure
%COMPILED-CODE-SUPPORT:SIGNAL-ERROR-IN-PRIMITIVE
Stephen Adams [Fri, 26 Jul 1996 14:38:26 +0000 (14:38 +0000)]
Initial cut at writing COERCE-TO-COMPILED-PROCEDURE in Scheme. The
next change will be to make the compiler generate calls to this
procedure rather than the primitive COERCE-TO-COMPILED-PROCEDURE,
which should result in both faster generation and invocation of
trampolines.
Eventually we might make the linker use this code too.
The code is a bit hairy and needs special initialization, hence the
changes in make.scm.
Stephen Adams [Fri, 26 Jul 1996 00:36:11 +0000 (00:36 +0000)]
Added new stack frame type for preservation frames (restore-regs).
Added a debugging-info method.
Changed the illegal-arg error handler for primitive procedures to
avoid using retry restarts when the primitive signalled a type or
range error when called from compiled code. This is necessary because
the compiler assumes that if it calls a primitive just to raise an
error then teh primitive will not return. This assumption allows type
inference to eliminate furthur checks.
In order to stop the debugger returning a value, the primitive should
be called `indirectly' via another compiler procedure which refuses to
return. I.e instead of compiling the error CAR operation as
INVOKE:PRIMITIVE
Stephen Adams [Wed, 24 Jul 1996 22:32:30 +0000 (22:32 +0000)]
Fixed a bug with constant folding binary operators: the continuation
was being ignored.
Added a whole bunch of code to rewrite return (and calls with few
arguments) sequences that are passing an inlined predicate or
conditional expression.
For limited cases, for example, returning (null? x) or tail-calling, e.g.
(f (if (pair? x) (car x) #F))
there is small benefit.
Stephen Adams [Wed, 24 Jul 1996 03:45:18 +0000 (03:45 +0000)]
. Fixed bug that was preventing CSE of flonums.
. Changed `CSE avoiding' rewrites to use CONSTANT-REGISTER-EXPRESSION, thus
including #F and '() in the games we play with `0'.
. Punted the `is-rtl-zero?' predicate as no longer used.
. Simplified REGISTER-KNOWN-FIXNUM-CONSTANT
. Added `CSE avoiding' rewrites for comparison operators.
Stephen Adams [Tue, 23 Jul 1996 19:11:20 +0000 (19:11 +0000)]
Removed lots (500 lines) of tagged-fixnum code. If you want it, use
RCS. Changed the comments to reflect the current code.
Made things more robust:
. Changed FITS-IN-nn-BITS? predicates to test for fixnum arguments.
. Changed all the register*constant and constant*register predicates
to be true only if the constant is a *fixnum* in the correct range.
. Punted the GUARANTEE-SIGNED-FIXNUM (as the predicates now guarantee it).
The net effect is that the compiler now compiles code like (fix:+ x
1.2) or (fix:* 'a n) to the obvious, albeit meaningless, instructions
rather than signalling a confusing error. Note that the midend
typerew phase can generate error messages for any of these conditions.
Stephen Adams [Tue, 23 Jul 1996 15:41:23 +0000 (15:41 +0000)]
Removed old (mostly unused) method of reporting type errors via bogus
re-writes that issue the warning and leave the program unchanged.
Replaced with type-checks based on the typedb information. All
operators with typedb information are checked (not just those with
rewrites). Checking (and thus warnings) are disabled by setting
COMPILER:TYPE-ERROR-WARNINGS? to false.
Stephen Adams [Mon, 22 Jul 1996 18:48:32 +0000 (18:48 +0000)]
Removed suggestion mechanism for rewrites. It was no longer used and
might be a problem because it couples type analysis to the use of the
information.
Stephen Adams [Fri, 19 Jul 1996 23:32:03 +0000 (23:32 +0000)]
Added rewrite code to replace an expression with a literal if the type
system tells us what the value must be. Most useful for
IF-predicates, as replacing <pred> by, e.g., (BEGIN <pred> '#T) allows
the dead code to be removed.
Added predicate code to yield a #T or #F value. Previously the
predicate information was being used only in the branches of an if.
Obviously, it is nice to know when the predicate is always true or
false.
Tweaked with inference rules for EQ?/EQV?/EQUAL?. This could be
better, for example, if (eq? x y) then we know the types must be in
the intersection. This would require work in TYPEREW/PRED.