racket/s
Andy Keep 18b12f21fd Fixes and small improvements for type recovery.
Removed counter field from prelex, using the operand field instead to
provide the index into the fxmap.  This follows other uses within the compiler
where we use the operand field as a little place for state that is used
within a single pass.  This has a few advantages.  First, it keeps the record a
little smaller.  Second, it means that the prelex numbering can start from 0
for each compilation unit, which should help keep the numbers for the fxmap a
bit smaller in longer running sessions with multiple calls to the compiler.
Finally, it avoids adding to the burden of the tc-mutex, since within the pass
it is safe for us to set the prelexes, since only the instance of the pass
holding this block of code has a handle on it.  As part of this change
prelex-counter is now defined in cptypes and the operand is cleared after the
variables go out of scope.
  base-lang.ss

Fixed the highest-set-bit function in fxmap so that it will work in the 32-bit
versions of Chez Scheme.  The fxsrl by 32 raises an exception, and was leading
to tests to fail in 32-bit mode.
  fxmap.ss

Restructured predicate-implies? so that it uses committed choice instead of
uncommitted choice in comparing x and y.  Basically, this means, instead of
doing:
(or
  (and (predicate-1? x) (predicate-1? y) ---)
  (and (predicate-2? x) (predicate-2? y) ---)
  ...)
we now do:
(cond
  [(predicate-1? x) (and (predicate-1? y) ---)]
  [(predicate-2? x) (and (predicate-2? y) ---)]
  ...)
This avoids running predicates on x that we know will fail because an earlier
predicate matches, generally getting out of the predicate faster.  This did
require a little restructuring, because in some cases x was dominant and in
other cases y was dominant.  This is now restructured with y dominate, after
the eq? and x 'bottom check.

Replaced let-values calls with cata-morphism syntax, including removal of maps
that built up a list of values that then needed to be separated out with
(map car ...) (map cadr ...) etc. calls.  This avoid building up structures we
don't need, since the nanopass framework will generate a mutltivalued let for
these situations.

The if clause in cptypes/raw now uses types1 (the result of the recursive call
on e1) in place of the incoming types clause when processing the e2 or e3
expressions in the cases where e1 is known statically to produce either a false
or non-false value.

Fixed a bug with directly-applied variable arity lambda.  The original code
marked all directly-applied variable arity lambda's as producing bottom,
because it was chacking for the interface to be equal to the number of
arguments.  However, variable arity functions are represented with a negative
number.  For instance, the original code would transform the expression:
(begin
  ((lambda (a . b) (set! t (cons* b a t))) 'a 'b 'c)
  t)
to
((lambda (a . b) (set! t (cons* b a t))) 'a 'b 'c)
anticipating that the call would raise an error, however, it is a perfectly
valid (if some what unusual) expression.  I tried to come up with a test for
this, however, without building something fairly complicated, it is difficult
to get past cp0 without cp0 turning it into something like:
(let ([b (list 'b 'c)])
  (set! t (cons* b 'a t))
  t)

Fixed make-time, time-second-set!, and time-second to indicate that second can
be an exact-integer, since it is not really restricted to the fixnum range (and
if fact we even test this fact in the mats on 32-bit machines).
  primdata.ss

Changed check of prelex-was-assigned (which is not reliably on the input to any
give pass) with prelex-assigned, which should always have an accurate, if
conservative, value in it.

Added enable-type-recovery parameter to allow the type recover to be turned on
and off, and added cptype to the cp0 not run path that runs cpletrec, so that
cptypes can be run independent of cp0.  This is helpful for testing and allows
us to benefit from type recovery, even in cases where we do not want cp0 to
perform any inlining.
  compile.ss, front.ss, primdata.ss

Stylistic changes, mostly for consistency with other parts of the compiler,
though I'm not married to these changes if you'd really prefer to keep things
the way the are.
1. clauses of define-record type now use parenthesis instead of square brackets.
2. indented by 2 spaces where things were only indented by one space
3. define, let, define-pass, nanopass pass productions clauses, now use
   parenthesis for outer markers instead of square brackets.
  fxmap.ss,

original commit: 5c6c5a534ff708d4bff23f6fd48fe6726a5c4e05
2018-04-12 21:54:01 -03:00
..
4.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
5_1.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
5_2.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
5_3.ss even? and odd?: reject exceptional flonums, since they're not integers 2017-12-28 17:00:04 -06:00
5_4.ss Fixing output of substring-fill! and vector-fill! 2017-12-12 08:43:01 -05:00
5_6.ss Fixing output of substring-fill! and vector-fill! 2017-12-12 08:43:01 -05:00
5_7.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
6.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
7.ss add collect-rendezvous 2018-04-02 13:52:03 -04:00
a6fb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6nb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6nt.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6ob.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6osx.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
a6s2.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
arm32.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00
arm32le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
back.ss Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
base-lang.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
bytevector.ss attempt to stabilize timing tests let-values source-caching 2017-10-29 17:48:43 -04:00
cafe.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
cback.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
cmacros.ss Add safeongoodargs flag to primref 2018-04-12 21:53:56 -03:00
compile.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
costctr.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
cp0.ss Remove special case for (#2%map p '()) in cp0 2018-02-13 17:47:43 -03:00
cpcheck.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
cpcommonize.ss Adding missing file cpcommonize.ss. 2018-01-29 16:01:25 -05:00
cpletrec.ss Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
cpnanopass.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
cprep.ss Add cptypes pass to cp0 to reduce expression using types 2018-04-12 21:53:33 -03:00
cptypes.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
cpvalid.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
date.ss attempt to stabilize timing tests let-values source-caching 2017-10-29 17:48:43 -04:00
debug.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
engine.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
enum.ss enum-set-indexer procedure now checks for a symbol, changed "isn't" to "is not" for consistency 2017-05-05 15:22:46 -04:00
env.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
event.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
exceptions.ss add locate-source cache and line+column components to source objects 2017-08-01 05:23:56 -06:00
expand-lang.ss committing @akeep library change with rebuilt boot files: 2018-04-05 21:28:33 -07:00
expeditor.ss - add unicode support to the expression editor. entry and display now work 2016-07-20 21:54:50 -04:00
fasl-helpers.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
fasl.ss add make-ephemeron-eq-hashtable, etc. 2017-07-06 16:27:23 -06:00
foreign.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
format.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
front.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
ftype.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00
fxmap.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
hashtable-types.ss add make-ephemeron-eq-hashtable, etc. 2017-07-06 16:27:23 -06:00
i3fb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3nb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3nt.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3ob.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3osx.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3qnx.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
i3s2.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
inspect.ss add locate-source cache and line+column components to source objects 2017-08-01 05:23:56 -06:00
interpret.ss Add cptypes pass to cp0 to reduce expression using types 2018-04-12 21:53:33 -03:00
io-types.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
io.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
layout.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
library.ss add make-ephemeron-eq-hashtable, etc. 2017-07-06 16:27:23 -06:00
mathprims.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6fb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6nb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6nt changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6ob changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6osx changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-a6s2 changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-arm32le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-base Add cptypes pass to cp0 to reduce expression using types 2018-04-12 21:53:33 -03:00
Mf-cross Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
Mf-i3fb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3nb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3nt changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3ob changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3osx changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3qnx changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-i3s2 changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ppc32le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6fb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6nb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6nt changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6ob changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6osx changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ta6s2 changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3fb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3nb changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3nt changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3ob changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3osx changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-ti3s2 changed copyright year to 2017 2017-04-06 11:41:33 -04:00
Mf-tppc32le changed copyright year to 2017 2017-04-06 11:41:33 -04:00
mkheader.ss add ephemerons 2017-05-24 09:38:24 -06:00
newhash.ss Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
np-languages.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00
patch.ss make bootfiles 2017-05-24 13:11:40 -06:00
pdhtml.ss fixed gather-filedata's sort of profile entries. for any two 2017-10-30 21:01:43 -04:00
ppc32.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00
ppc32le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
pretty.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
primdata.ss Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
priminfo.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
primref.ss Add signatures field to primref record 2018-04-12 21:53:16 -03:00
prims.ss Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
primvars.ss Add signatures field to primref record 2018-04-12 21:53:16 -03:00
print.ss add locate-source cache and line+column components to source objects 2017-08-01 05:23:56 -06:00
read.ss add locate-source cache and line+column components to source objects 2017-08-01 05:23:56 -06:00
record.ss removed a useless check in foreign-alloc 2017-09-15 09:49:00 -04:00
reloc.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
setup.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
strip.ss update test patch files 2017-07-06 20:45:18 -06:00
strnum.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
syntax.ss committing @akeep library change with rebuilt boot files: 2018-04-05 21:28:33 -07:00
ta6fb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6nb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6nt.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6ob.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6osx.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ta6s2.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3fb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3nb.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3nt.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3ob.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3osx.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
ti3s2.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
tppc32le.def changed copyright year to 2017 2017-04-06 11:41:33 -04:00
trace.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
types.ss add locate-source cache and line+column components to source objects 2017-08-01 05:23:56 -06:00
ubify.ss changed copyright year to 2017 2017-04-06 11:41:33 -04:00
x86_64.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00
x86.ss support struct args to and results from foreign procedures 2018-03-12 21:01:47 -06:00