Commit Graph

174 Commits

Author SHA1 Message Date
Matthew Flatt
e8bd9b83cd repair {Free,Open,Net}BSD build
Use OSSP UUID on {Free,Open}BSD and native UUID on NetBSD.

Building on OpenBSD requires a filesystem mounted with wxneeded.

original commit: e964d7d01a6d115e469c01626896b683d421d599
2019-06-11 09:34:09 -06:00
Matthew Flatt
81191397b5 Merge github.com:cisco/ChezScheme
original commit: bb65f1a8e429683e2925cf1678145efe0ade59bb
2019-06-07 08:56:14 -06:00
Paulo Matos
af63b73bad Update shift left that might cause ub
A few shift lefts cause ub because of `(1 << n)` where `n` is 31. 
The constant 1 is signed causing ub. Initially my fix was to do `(1U << n)` however, I have seen the pattern `((U32)1 << n)` elsewhere in the file so decided to follow this.

Caught by ubsan racketcs.
original commit: a902c9ab67010f521f786e2027d4e197d78975a4
2019-06-06 08:57:25 -06:00
Paulo Matos
4988a45c06 Make variables unsigned to avoid ub in calculation
According to ubsan we get several times into undefined behaviour due to signed overflow:
foreign.c:91:21: runtime error: signed integer overflow: 3291370622602663862 * 3 cannot be represented in type 'long int'

This happens only when the symbol name is relatively large like as for the call:
symhash (s=0x5555558caab8 "(cs)set_enable_object_backreferences")
original commit: 1e1c91869443d8a22beeebfcbe6fa14f9c3e2a6e
2019-06-05 22:49:55 +02: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
Matthew Flatt
2cf27c4727 Merge github.com:cisco/ChezScheme
original commit: 8118200e237d756f83be54e8bf3eabb4af2388ed
2019-05-22 10:46:59 -06: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
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
b9e43c6e78 add "scheme.h" dependency for "main.c" to Windows makefiles
original commit: 413cf148327345847aa3d1f6b839e77d74a8996e
2019-04-09 17:11:26 -06: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
ffc02a9877 improve hash mixing
original commit: d7469cedd67a950931a561ce14388fe7e628770d
2019-04-07 09:37:37 +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
Bob Burger
19b130e41c update Windows spin-loop count for deleting files and directories
original commit: b597e161fcb8c5ebb8f7f8e1aa27b2f136c13064
2019-03-26 14:16:54 -04:00
Matthew Flatt
c6d3a1dd69 make nul act as a stream terminator for LZ4 sequences
original commit: 06f4aab43a35b3a3f956cf510c76c0edb4f1a866
2019-03-22 13:52:53 -06:00
Matthew Flatt
605f8f5033 rename "compress.[ch]" to avoid a conflict
original commit: a4c635ae3da7853bbd2f63ffb25c3f16af33898b
2019-03-22 09:38:37 -06:00
Matthew Flatt
27536edb07 fix Windows library link
original commit: dc42cd93b5af29673f3357583dc81f9b104e7cb4
2019-03-22 09:11:01 -06: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
Matthew Flatt
c4c70e8533 adapt MinGW cross-build suport for LZ4
original commit: 959d2b03cf8a6261583d060cf1d37fbf3e233f82
2019-03-21 06:22:59 -06: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
194d1e71c1 partially sync with current Chez Scheme
original commit: ff0c8d157a551f9a9c16606ac2e052373c1ce4f9
2019-03-20 15:43:33 -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
Matthew Flatt
2f65d585b2 adjust Windows cross-compile to use zlib/win32/Makefile.gcc
original commit: b4c583ad7259eabad7344d5dedc297c8414140a4
2019-03-19 15:29:20 -06:00
Matthew Flatt
4d0090bf7b avoid case in MinGW library name
original commit: 3ce4efbf98e6960871f2477a8cc89e2020adb95b
2019-03-18 12:48:46 -06:00
Matthew Flatt
5392cfa506 repair time_t reference for 32-bit MinGW
original commit: a00db84bb2827669aac0a15d51b83c607df4b7b9
2019-03-05 15:13:36 -07:00
Matthew Flatt
79b8e097fe cross-compile support for ti3nt
original commit: 2b33dddfde1d41bf4ac53ff22f340ea44a7b96bf
2019-03-05 13:44:24 -07:00
Matthew Flatt
4030eae6a7 support cross-compile using MinGW
original commit: f36d5f8c0a4e31666e4332824d79279d9986e886
2019-03-02 05:30:08 -07:00
Matthew Flatt
60005f02d2 Merge github.com:cisco/ChezScheme
original commit: 629f8b653ff46afa64bffa1fcfbb8e7c94dd7451
2019-02-17 18:22:55 -07: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
1baa0da991 use opportunistic 1-shot continuations for attachments
An attachment continuation link can be a 1-shot continuation, but
the existing 1-short continuation implementation tends to work
less well than mutishot continuations. An opportunistic 1-shot
continuation is like a multi-shot continuation, but if it is
called from a stack that is adjacent to the continuation, then
the stack is merged with the continuation's stack.

original commit: ea1eb3c5192d644ad4c4cbf755bcb6fd438cc364
2019-02-08 13:59:28 -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
Matthew Flatt
8070a7b910 Merge branch 'eqfl' of github.com:mflatt/ChezScheme
original commit: 8b36396eacb139e0fff70efcd2c9dc842815324f
2019-01-22 05:57:17 -07:00
Matthew Flatt
21fc705234 adjust GC to preserve eq? on flonums
original commit: d405416eb2ec6d5dd147afc7a2af5a6c2f0a8130
2019-01-22 05:24:05 -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
b27f3c0a94 Merge branch 'phantom' of github.com:mflatt/ChezScheme
original commit: 743a56d8f1920620e8f6e14edca7984101425e14
2019-01-20 07:56:59 -07:00
Matthew Flatt
538def47de add phantom bytevectors
original commit: 001917fd98ac6a0f13ccab902e15b9d2169c4b9c
2019-01-20 07:41:09 -07:00
dyb
ee9a4b3f59 profile counts are now maintained even for code that has been
reclaimed by the collector and must be released explicitly by the
programmer via (profile-release-counters).
  pdhtml.ss, primdata.ss,
  globals.h, externs.h, fasl.c, prim5.c, prim.c, alloc.c, scheme.c,
  misc.ms,
  release_notes.stex, system.stex

original commit: 68e20f721618dbaf4c1634067c2bee24a493a750
2019-01-17 09:43:18 -08:00
Matthew Flatt
3e297e025e adjust make-arity-wrapper to enforce the supplied arity mask
original commit: a9ec7da3ea3b8edc665b060bcba675248119d260
2019-01-15 11:56:03 -07:00
Matthew Flatt
3658fad6b7 Merge branch 'count' of github.com:mflatt/ChezScheme
original commit: 9d0a647e87089c91195cc49480d848212025a7ed
2019-01-05 09:55:07 -07:00
Matthew Flatt
aaaa5fefa1 add compute-size-increments
Also adds `get-initial-thread`, since threa values are useful with
`compute-size[-increments]`.

Changes the compiler to inline `weak-pair?` and `ephemeron-pair?`,
since that provides better performance for `compute-size-increments`.

original commit: 57d0cc13f8e932972cba3837b4f54e9c86786091
2019-01-05 09:49:12 -07:00
Matthew Flatt
0ac2f40d18 vfasl: save relocations if flag is set
original commit: 23ba508373fbcbe1fcba367bce86f60a54bbf4f1
2019-01-02 15:33:04 -07:00
Matthew Flatt
2b090ef32c vfasl repair: terminate segments as needed
When starting a new segment to keep an object on a single segment,
terminate the old one with e forwarding marker.

original commit: 1f1db6d3d2cd930455a3592f2d76a465b30a5592
2019-01-01 15:40:09 -07:00
Matthew Flatt
e97b763478 update Windows makefiles for vfasl
original commit: c5af59e0b5e6e635d25ca5d6e0b2d7f61d2d2bb6
2018-12-31 10:07:15 -07:00
Matthew Flatt
8b5d7ba02e vfasl repair
original commit: ee6a5df5d180ea1c9487ceb1d565d61120e69168
2018-12-31 08:01:47 -07:00
Matthew Flatt
69b92a0ca4 sync vfasl repair
original commit: b234ef2f5cb8352b9755b2cc908d562a25d18c62
2018-12-29 06:16:55 -06:00
Matthew Flatt
a0e9eed93f Merge dfasl branch of mflatt/ChezScheme
original commit: c6168b2d0b1b97e9822bc8eae2e08900cebb7152
2018-12-28 08:45:06 -06:00
Matthew Flatt
7c548bb3a1 update vfasl merge
original commit: 99dac3f53f4a7d2b2c373489135e5d270c256726
2018-12-28 08:39:21 -06:00
Matthew Flatt
6d3fc30233 avoid fasl overflow of C stack
When writing a fasl stream, add extra graph points as needed
to limit recursive reading to about 500 non-tail recursions.

original commit: a6759efdc6ac68e45ec8755a5fe9b75038e173a5
2018-12-28 08:26:50 -06:00
Matthew Flatt
d8dc4c71cc Merge branch 'separate' of ../ChezScheme-vfasl
original commit: 84734ded0f503f6604e7461a8be5e1e795a92efa
2018-12-24 05:32:24 -07:00