Commit Graph

278 Commits

Author SHA1 Message Date
Matthew Flatt
81191397b5 Merge github.com:cisco/ChezScheme
original commit: bb65f1a8e429683e2925cf1678145efe0ade59bb
2019-06-07 08:56:14 -06:00
Steven Watson
21c7dd839d Added support for building chez with VS2019. (#435)
added support for Microsoft Visual Studio 2019 on Windows
original commit: 549b4468b619a9377332509472a4346ac223b5ae
2019-06-04 16:37:57 -04:00
Gustavo Massaccesi
40d33fc72e make test for relop-length more sensitive
5_2.ms

original commit: b34695bb3faa28c3e55d65cc659f6a9f2c3b1547
2019-05-24 10:33:52 -04:00
Gustavo Massaccesi
3c53b8b940 small fix in relop-length to enable the optimization
original commit: 587e0f4c01bf6bc187fc4e829fba9cc8ca7c38dd
2019-05-23 14:34:54 -04:00
Matthew Flatt
2cf27c4727 Merge github.com:cisco/ChezScheme
original commit: 8118200e237d756f83be54e8bf3eabb4af2388ed
2019-05-22 10:46:59 -06:00
gus-massa
58ee63722a Fix signatures of $file-options and friends (#429)
They were defined inside a block with the `proc` flag, but they are `enum-set`s.
  primdata.ss
original commit: 3fce8333e3856573292b97b9a2d47827216f9097
2019-05-22 10:52:24 -04:00
Taekyung
e9feda26f8 Correct typo in description of case macro
original commit: b9ad8fc8db91218fcf81044af84ddc0773b221b5
2019-05-22 10:42:41 -04:00
Bob Burger
62ddec8b4b fixed typo & improved wording
original commit: ecb540fec3b3933040a4f8ee98929ae289f4e22d
2019-05-02 15:29:16 -04:00
Bob Burger
62907754b4 fix multiply of -2^30 to itself on 64-bit platforms
original commit: 566c7a98ec4e070a26450781ffc2b9054860e4ed
2019-05-02 15:19:58 -04:00
Matthew Flatt
40ced8629e repair multiply of (- (expt 2 30)) to itself
On a 64-bit platform, the test for "short" arguments to
avoid overflow was incorrect, because `(- (expt 2 30))`
counted as short.

original commit: 6d05b70e86987c0e7a07f221ba5def492300aaaf
2019-05-01 09:20:35 -06:00
Bob Burger
897e53b430 add Windows builds and update Linux dist to xenial
original commit: e44a209f27f8670c23a1d402b3f968eaa10cad29
2019-04-24 13:21:03 -04:00
Matthew Flatt
8850655e7d fix uses of fxzero? on a 32-bit immediate in 32-bit mode
original commit: 01808c6187319174ce519d788d05319585bf8eb0
2019-04-22 10:53:32 -04:00
dyb
7e4ed70f72 minor relop-length and assertion-violationf improvements
- zero?, fxzero?, positive?, fxpositive?, etc., now go through
  (a suitably modified) relop-length so that, for example,
  (zero? (length x)) results in the same code as (null? x).  added
  correctness tests for these and all of the other predicates that
  go through relop-length.
    cpnanopass.ss, 5_2.ms
- assertion-violationf and friends now show the who, message, and
  irritants in the original call when who or message is found not to
  be of the right type.
    exceptions.ss

original commit: 9cdc8733cbde4046fd404eefbca6433aabebcef9
2019-04-19 20:22:09 -07:00
Gustavo Massaccesi
51dd12788b Fix record-ref reduction in cp0
In expressions like
  (record-ref ... (begin (newline) (record ...)))
the reduction was dropping the possible side effect expressions
in this case the (newline).

 cp0.ss

original commit: 5c50c5d1c520c79035065b4bd977eadd8e4cb800
2019-04-19 00:33:04 -03:00
dyb
82b2cda639 compress-level parameter, improvement in lz4 compression, and various other related improvements
- added compress-level parameter to select a compression level for
  file writing and changed the default for lz4 compression to do a
  better job compressing.  finished splitting glz input routines
  apart from glz output routines and did a bit of other restructuring.
  removed gzxfile struct-as-bytevector wrapper and moved its fd
  into glzFile.  moved DEACTIVATE to before glzdopen_input calls
  in S_new_open_input_fd and S_compress_input_fd, since glzdopen_input
  reads from the file and could block.  the compress format and now
  level are now recorded directly the thread context.  replaced
  as-gz? flag bit in compressed bytevector header word with a small
  number of bits recording the compression format at the bottom of
  the header word.  flushed a couple of bytevector compression mats
  that depended on the old representation.  (these last few changes
  should make adding new compression formats easier.)  added
  s-directory build options to choose whether to compress and, if
  so, the format and level.
    compress-io.h, compress-io.c, new-io.c, equates.h, system.h,
    scheme.c, gc.c,
    io.ss, cmacros.ss, back.ss, bytevector.ss, primdata.ss, s/Mf-base,
    io.ms, mat.ss, bytevector.ms, root-experr*,
    release_notes.stex, io.stex, system.stex, objects.stex
- improved the effectiveness of LZ4 boot-file compression to within
  15% of gzip by increasing the lz4 output-port in_buffer size to
  1<<18.  With the previous size (1<<14) LZ4-compressed boot files
  were about 50% larger.  set the lz4 input-port in_buffer and
  out_buffer sizes to 1<<12 and 1<<14.  there's no clear win at
  present for larger input-port buffer sizes.
    compress-io.c
- To reduce the memory hit for the increased output-port in_buffer
  size and the corresponding increase in computed out_buffer size,
  one output-side out_buffer is now allocated (lazily) per thread
  and stored in the thread context.  The other buffers are now
  directly a part of the lz4File_out and lz4File_in structures
  rather than allocated separately.
    compress-io.c, scheme.c, gc.c,
    cmacros.ss
- split out the buffer emit code from glzwrite_lz4 into a
  separate glzemit_lz4 helper that is now also used by gzclose
  so we can avoid dealing with a NULL buffer in glzwrite_lz4.
  glzwrite_lz4 also uses it to writing large buffers directly and
  avoid the memcpy.
    compress-io.c
- replaced lz4File_out and lz4File_in mode enumeration with the
  compress format and inputp boolean.  using switch to check and
  raising exceptions for unexpected values to further simplify
  adding new compression formats in the future.
    compress-io.c
- replaced the never-defined struct lz4File pointer in glzFile
  union with the more specific struct lz4File_in_r and Lz4File_out_r
  pointers.
    compress-io.h, compress-io.c
- added free of lz4 structures to gzclose.  also changed file-close
  logic generally so that (1) port is marked closed before anything is
  freed to avoid dangling pointers in the case of an interrupt or
  error, and (2) structures are freed even in the case of a write
  or close error, before the error is reported.  also now mallocing
  glz and lz4 structures after possibility of errors have passed where
  possible and freeing them when not.
    compress-io.c,
    io.ss
- added return-value checks to malloc calls and to a couple of other
  C-library calls.
    compress-io.c
- corrected EINTR checks to look at errno rather than return codes.
    compress-io.c
- added S_ prefixes to the glz* exports
    externs.h, compress-io.c, new-io.c, scheme.c, fasl.c
- added entries for mutex-name and mutex-thread
    threads.stex

original commit: 722ffabef4c938bc92c0fe07f789a9ba350dc6c6
2019-04-18 05:47:19 -07:00
Matthew Flatt
2da5fd740e Merge branch 'hashmix' of github.com:mflatt/ChezScheme
original commit: b620bd23a962989db5f5b489eb67a1fa45ee123d
2019-04-07 10:14:10 +02:00
Matthew Flatt
e622a495b6 Add LZ4 support and use it by default for compressing files
original commit: 8858b34bd92ac8d2b6511dc9ca17ebfa06a1bd93
2019-04-06 07:32:37 +02:00
Jéssica Milaré
bcf25a17fb Mutexes and condition variables with names (#380)
add name fields for mutexes and condition variables, now `make-mutex` and `make-condition` accept an optional argument `name`, which must be a symbol or #f.  The name, if not #f, is printed every time the object is printed, which is useful for debugging.
original commit: 1397e173200d1697ed714d24fc2eb4767421b976
2019-04-03 09:36:54 -04:00
Oscar Waddell
b8d6d649bc ignore multiple-value return from interleaved init expressions in top-level-program
original commit: f5fd9d144b68af26244855c7c2f34be97298deea
2019-03-27 13:00:38 -04:00
Oscar Waddell
bb67d6ff01 install a file containing revision control information alongside boot files
original commit: ed4ca6123eae4c347e9ee240a34e42dbc695aea2
2019-03-27 12:42:28 -04:00
Bob Burger
19b130e41c update Windows spin-loop count for deleting files and directories
original commit: b597e161fcb8c5ebb8f7f8e1aa27b2f136c13064
2019-03-26 14:16:54 -04:00
Bob Burger
21043fb950 fixed welcome text and copyright year in macOS package
original commit: 30076521c9216a8978f0b3c1369c74d28404418a
2019-03-25 11:54:24 -04:00
dyb
46608ff1f1 Now opening 9.5.3 release. Intent is to formally release 9.5.2
(and possibly all and only even-numbered releases going forward)
and use 9.5.3 (and possibly all and only odd-numbered releases going
forward) for development.

original commit: 47110f36cea47a44078b3144c82d212de79774ce
2019-03-21 15:07:39 -07:00
dyb
b2cecd2c0f 9.5.2 changes:
- updated version to 9.5.2
    bintar/Makefile rpm/Makefile pkg/Makefile BUILDING NOTICE
    makefiles/Mf-install.in makefiles/Makefile-csug.in scheme.1.in
    c/Makefile.a6nt c/Makefile.i3nt c/Makefile.ta6nt c/Makefile.ti3nt
    mats/Mf-a6nt mats/Mf-i3nt mats/Mf-ta6nt mats/Mf-ti3nt workarea
    c/scheme.rc s/7.ss s/cmacros.ss release_notes/release_notes.stex
    csug/copyright.stex csug/csug.stex rpm/Makefile pkg/Makefile
    wininstall/Makefile wininstall/a6nt.wxs wininstall/i3nt.wxs
    wininstall/ta6nt.wxs wininstall/ti3nt.wxs
- fixed handling of bintar, rpm, pkg make files
    newrelease
- fixed a bug in the fasl representation and reading of mutually
  recursive ftypes where one of the members of the cycle is the
  parent of another, which manifested in the fasl reader raising
  bogus "incompatible record type" exceptions.  (The bug could also
  affect other record-type descriptors with cycles involving parent
  rtds and "extra" fields.)  object files created before this fix
  are incompatible with builds with this fix, and objects files
  created after this fix are incompatible builds without this fix.
    fasl.ss, strip.ss,
    fasl.c,
    ftype.ms,
    release_notes.stex

original commit: 766d591c18c2779866d1a059700e6ff1c02cb3c5
2019-03-21 14:30:49 -07:00
Andy Keep
bae0681d2b Start on release notes.
- added library-search-handler, compile-whole-library, and improved
  packaging to the release notes.
    release_notes/release_notes.stex

original commit: 4740211242cf7f010fd66a7c15cf71aea098956c
2019-03-20 22:26:29 -04:00
Matthew Flatt
8b68320dcb Merge branch 'lz4' of https://github.com/mflatt/ChezScheme
original commit: f74329a3254dbdfda1c4f86585a2d5028bbe03a3
2019-03-20 15:49:49 -06:00
Matthew Flatt
7264663e3c Merge https://github.com/cisco/ChezScheme
original commit: c2621183748c7f90d1cbf2d482f0bdb9ecda12e4
2019-03-20 15:45:15 -06:00
Matthew Flatt
8ab973300d Add LZ4 support and use it by default for compressing files
original commit: bbcd7fc2188e798ce53b765db0808e9ea6510350
2019-03-20 13:35:04 -06:00
dyb
84ec3f8704 minor build and new-release updates
checkin, newrelease, Makefile.in, Makefile-workarea.in

original commit: 4a4e1c40b611e56260c4751f1e16d0f9d78d2a35
2019-03-19 23:23:10 -07:00
Andy Keep
e3d64728e9 Small fix to wpo error message.
improved error message for compile-whole-program and
compile-whole-library when a top-level expression is discovered while
processing a wpo file.
  compile.ss

original commit: 11cee34502470d720d611ffd0799353e8663a7f1
2019-03-19 22:21:27 -04:00
dyb
0b89f4fe82 better packaging support
- fixed failure to install examples for tarball installs
    Mf-install.in
- improved packaging support:
  replaced bintar script with bintar directory and make file;
  tarballs are created via "make create-tarball" and are placed in
  the workarea's bintar directory.  added rpm directory and make
  file for creating RPMs via "make create-rpm".  added pkg directory
  and make file for creating OSX packages via "make create-pkg".
    bintar (removed), bintar/Makefile (new), rpm/Makefile (new),
    pkg/Makefile (new), pkg/rmpkg (new), workarea, checkin, newrelease,
    Makefile.in, Makefile-workarea.in.

original commit: fdff97d15cd827eb8fbef200c0f495a4bfaefff3
2019-03-18 22:51:26 -07:00
Andy Keep
38d1000f70 Added fix for wpo bug from issue 386.
added fix for whole program/library compilation bug with help from
@owaddell who originally reported the problem in issue 386.  this bug
arises from the way the parts of the combined library, and their
binary dependencies, are invoked when one of the constituent libraries
is invoked.  consider, for example, a combined library that contains
(A) and (B), where (B) depends on a binary library (C).  depending on
the sort order of (A) and (B), which may be unconstrained in the
partial ordering established by library dependencies, invoking (A) may
result in the invoke code for (B) being run first, without (B) ever
being explicitly invoked.  this can result in bindings required from
(C) by the invoke code in (B) to be unbound.  even in the case where
(A) comes before (B) in the topological sort, if they are combined
into the same cluster, (B)'s invoke code will be run as part of
invoking (A).  the solution is two part: first we extend the invoke
requirements of the first library in the cluster to include the binary
libraries that precede it in the topological sort and add a dependency
on the first library in the cluster to all of the other libraries in
the cluster.  this means no matter which library in the cluster is
invoked first, it will cause the first library to be invoked, in turn
ensuring the binary libraries that precede it are invoked.  when there
are multiple clusters, a dependency is added from each cluster to the
first library in the cluster that precedes it.  this ensures that
invoking a library in a later cluster first, will still cause all of
the dependencies of the previous clusters to be invoked.  ultimately,
these extra dependencies enforce an ordering on the invocation of the
source and binary libraries that matches the topological sort, even if
the topological sort was under constrained.  to maintain the property
that import requirements are a superset of the invoke and visit
requirements, we also extend the import requirements to include the
extended invoke requirements.  the import requirements are also added
to the dependency graph to further constrain the topological sort and
ensure that we do not introduce artificial cycles in the import graph.
  compile.ss,
  7.ms,
  root-experr*, patch*

original commit: 09bba001a33a5ee9268f1e5cf0cc118e8a2eec7f
2019-03-17 14:18:42 -04:00
Oscar Waddell
78c3993817 expose default-library-search-handler and library-search-handler parameter
exposed the default-library-search-handler and a library-search-handler
parameter to permit more control over the search for libraries during
import, compile-whole-library, and compile-whole-program

original commit: 7b4fdd374f9cb973de1143bfcc830194b36befda
2019-03-14 14:31:02 -04:00
dyb
70c9ce65fb - fixed bug in inline-lists: wasn't setting multiply-referenced flag
on p to account for the procedure? check at optimize-level 2.
    cpletrec.ss
- fixed bug in check-prelex-flags: was hardwiring $cpcheck-prelex-flags
  "after" argument to 'uncprep rather than passing along its argument.
    compile.ss
- commented out local definition of sorry! so that problems detected
  by $cpcheck-prelex-flags actually result in a raised exception.
    cprep.ss

original commit: 674e2180d6893000446590038dcacf0ef661e564
2019-02-27 16:05:29 -08:00
Matthew Flatt
60005f02d2 Merge github.com:cisco/ChezScheme
original commit: 629f8b653ff46afa64bffa1fcfbb8e7c94dd7451
2019-02-17 18:22:55 -07:00
dyb
9a7068220d - reverted the earlier change to restore indirection through
InstallPrefix, since it didn't and can't play well with the
  generated config.h.  Instead removed InstallPrefix entirely so
  it isn't an attractive hazzard.
    configure, makefiles/Mf-install.in

original commit: 21c8b40bbe4431795824e48042112820872a1fe5
2019-02-12 09:21:03 -08:00
dyb
2daf225cab committing a handful of changes, none of which should be particularly
controversial, unless I damaged something in the process of integrating
them with other recent changes.  the user's guide and release notes
have been updated as well to reflect the changes of interest to end
users.
- the body of load-library is now wrapped in a $pass-time with
  to show the time spent loading libraries separately from the time
  spent in expand.
    syntax.ss
- interpret now plays the pass-time game
    interpret.ss
- added compile-time-value? predicate and
  compile-time-value-value accessor
    syntax.ss, primdata.ss,
    8.ms, primvars.ms, root-experr*
- $pass-stats now returns accurrate stats for the currently timed
  pass.
    7.ss
- compile-whole-program and compile-whole-library now propagate
  recompile info from the named wpo file to the object file
  to support maybe-compile-program and maybe-compile-library in
  the case where compile-whole-{program,library} overwrites the
  original object file.
    compile.ss,
    7.ms, mat.ss, primvars.ms
- replaced the ancient and unusable bintar with one that creates
  a useful tarball for binary installs
    bintar
- generated Mf-install InstallBin (InstallLib, InstallMan) now
  correctly indirects through InstallPrefix if the --installbin
  (--installlib, --installman) configure flag is not present.
    src/configure
- removed definition of generate-procedure-source-information
    patch.ss
- guardian tconc cells are now allocated in generation 0 in the hope
  that they can be released more quickly.
    gc.c
- added ftype-guardian syntax: (ftype-guardian A) creates a new
  guardian for ftype pointers of type A, the first base field (or
  one of the first base fields in the case of unions) of which must
  be a word-sized integer with native endianness representing a
  reference count.  ftype pointers are registered with and retrieved
  from the guardian just like objects are registered with and
  retrieved from any guardian.  the difference is that the garbage
  collector decrements the reference count before resurrecting an
  ftype pointer and resurrects only those whose reference counts
  become zero, i.e., are ready for deallocation.
    ftype.ss, cp0.ss, cmacros.ss, cpnanopass.ss, prims.ss, primdata.ss,
    gc.c,
    4.ms, root-experr*
- fixed a bug in automatic recompilation handling of missing include
  files specified with absolute pathnames or pathnames starting with
  "./" or "..": was erroring out in file-modification-time with a
  file-not-found or other exception rather than recompiling.
    syntax.ss,
    7.ms, root-experr*, patch*
- changed inline vector-for-each and string-for-each code to
  put the last call to the procedure in tail position, as was
  already done for the library definitions and for the inline
  code for for-each.
    cp0.ss,
    5_4.ms, 5_6.ms
- the compiler now generates better inline code for the bytevector
  procedure.  instead of one byte memory write for each argument,
  it writes up to 4 (32-bit machines) or 8 (64-bit machines) bytes
  at a time, which almost always results in fewer instructions and
  fewer writes.
    cpnanopass.ss,
    bytevector.ms
- packaged unchanging implicit reader arguments into a single record
  to reduce the number of arguments.
    read.ss
- recoded run-vector to handle zero-length vectors.  it appears
  we're not presently generating empty vectors (representing empty
  groups), but the fasl format permits them.
    7.ss

original commit: 7be1d190de7171f74a1ee71e348d3e6310392686
2019-02-11 20:06:42 -08:00
Matthew Flatt
13b6b6943b committing @mflatt hashtable-cells pull request
original commit: 1900a7ef534366a4311a714cf56b9c60657ba0a1
2019-02-07 13:54:14 -08:00
dyb
a1195b7f7e addressed foreign-callable / boot file invalid memory reference:
- fixed a bug in which instantiating a static foreign-callable code object
  fails with an invalid memory reference because the collector has
  discarded its relocation information.  foreign-callable code objects
  are now flagged as "templates", and the collector now refuses to
  discard relocation information for code objects marked as templates
  when copying them to the static generation.
    cmacros.ss, cpnanopass.ss,
    gc.c,
    7.ms
- committing updated boot/*/equates.h (without the boot files, which are
  still usable for bootstrapping)
    boot/*/*.h
- updated release notes
    release_notes.stex

original commit: 71d3abba684e04b134720ea1bd9a8c847c38ac5f
2019-02-06 22:22:21 -08:00
R. Kent Dybvig
4bd603231a Merge branch 'master' into fpstr
original commit: 216139066e8ba8dc510fc7a1ee32f48bce2e5742
2019-02-05 15:03:40 -08:00
Oscar Waddell
a58dfb690a make cp0 heed app-convention when folding primitive calls
fix #389 (apply doesn't throw exception when last argument isn't a list)

fold-primref and fold-primref2 ignored app-convention when
attempting to fold certain primitive calls in 'test and 'effect
context and when falling back on the default primitive handler.

We now residualize primitive references if the app-convention
is not 'call.  The original fold-primref2 already bypassed the
inline handler when the app-convention was not 'call.

original commit: f9d10c4cf2e6cd184ad7429f251360a738600959
2019-02-05 12:24:07 -05:00
Matthew Flatt
627c809de4 Merge branch 'fpstr' of github.com:mflatt/ChezScheme
original commit: 871ccfa8688baa865731e047c59677b652d808f3
2019-02-01 05:26:06 -07:00
Matthew Flatt
7027a71f01 fix string allocation for callable argument or foreign-call return
The `dofretu...*` intrinsics used %ac1 without declaring it as a used
registers, which effectively broke register allocation for handling
string/bytevector foreign-call results or callable arguments.

original commit: 993fb9036acad5445319f458fd971b1a1d8e9f84
2019-01-27 13:01:57 -07:00
Matthew Flatt
8070a7b910 Merge branch 'eqfl' of github.com:mflatt/ChezScheme
original commit: 8b36396eacb139e0fff70efcd2c9dc842815324f
2019-01-22 05:57:17 -07:00
Matthew Flatt
6e999d02c3 add ordered guardians
Also, avoid quadratic time in GC for guardian chains.

original commit: 273f79a7be5c04370c399e6b1d8af799efc8b33f
2019-01-22 05:19:38 -07:00
Matthew Flatt
67a0b0948f Merge branch 'leftassoc' of github.com:mflatt/ChezScheme
original commit: 19d0cb77e6b6dd32fa4a7a26505ee952b4efa756
2019-01-21 10:54:19 -07:00
Matthew Flatt
ae71f7472d add enable-arithmetic-left-associative
Add a parameter to constrain the compiler (off by default) to
implement `+`, `*`, and variants as left-associative when given
multiple arguments.

original commit: d126ba3364893e66263c65af1cd6dbdd8b021439
2019-01-21 10:51:16 -07:00
Matthew Flatt
c647fd031d Merge branch 'titlecase' of github.com:mflatt/ChezScheme
original commit: 244185f858a01b4679d2add4f0f6dc90c9f92c3d
2019-01-20 16:35:27 -07:00
Matthew Flatt
4752199578 fix string-titlecase on special-casing characters
original commit: 0ae58f75bcf76fb41e571579a81ab2080379455c
2019-01-20 16:34:25 -07:00
Matthew Flatt
b27f3c0a94 Merge branch 'phantom' of github.com:mflatt/ChezScheme
original commit: 743a56d8f1920620e8f6e14edca7984101425e14
2019-01-20 07:56:59 -07:00