Commit Graph

222 Commits

Author SHA1 Message Date
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
Matthew Flatt
545a465cf4 Merge ../ChezScheme-vfasl
original commit: dbe15d6cae6f23c4e218974ac83f36a935292ad2
2018-12-24 05:28:16 -07:00
Matthew Flatt
c3ef889099 fix allocation: avoid malloc and free
original commit: 40da1e7c8820163b4532cc75b6ed3c4229e2c4db
2018-12-23 06:17:53 -07:00
Matthew Flatt
133e820723 simplify vfasl_header
original commit: dab5ea7f7ee761ab6799c242df07ef209657eb74
2018-12-23 05:55:02 -07:00
Matthew Flatt
14e910409c experiment with a different fasl format
Use `vfasl-convert-file` to convert to the vfasl format, something
like this:

 (vfasl-convert-file "orig/petite.boot" "new/petite.boot" '())
 (vfasl-convert-file "orig/scheme.boot" "new/scheme.boot" '("petite"))
 (vfasl-convert-file "orig/racket.boot" "new/racket.boot" '("petite" "scheme"))

original commit: a40886e2fba741ca8cfc5ebd16b902d6414da0ae
2018-12-21 21:06:08 -07:00
Matthew Flatt
f3bbf06ce3 direct to static
original commit: ca6b0890ebd1cdeeae31dc3f11daa7fa02af013e
2018-12-21 14:16:24 -07:00
Matthew Flatt
a993c9c11e combine multiple fasl to one vfasl when possible
original commit: d8d4400b42196088defac994b7f97a26446d8ed2
2018-12-21 08:58:28 -07:00
Matthew Flatt
f0376299a8 experiment with a different fasl format
original commit: e2c50bd7ae5b323fcc796eb78d892f4a2c487dfc
2018-12-20 20:27:41 -07:00
Matthew Flatt
5cace8bee3 repairs
original commit: a7c8036d40fc3c92b6b08ba8d1a62f76f2d5fab6
2018-12-20 20:24:35 -07:00
Matthew Flatt
ed1d5c982d Merge ../ChezScheme-vfasl
original commit: 78ba118cbde76dd42bc4275ccc76219e159e04d7
2018-12-20 17:51:38 -07:00
Matthew Flatt
c90bd7bb6d experiment with a different fasl format
original commit: 6e32ed2a43f6b3d8531e98dfa52a56594dd6a2f4
2018-12-20 17:47:01 -07:00
Matthew Flatt
efb93d2653 Merge branch 'gcbt' of github.com:mflatt/ChezScheme
original commit: 51c6b2a880000ce754e1595f4481957e9fc7f722
2018-12-16 07:00:22 -07:00
Matthew Flatt
7864a1f45e Merge branch 'arity-wrapper' of github.com:mflatt/ChezScheme
original commit: 1967e6fb2948ea59d9f3b403b7b6e20d228502b1
2018-12-16 06:51:39 -07:00
Matthew Flatt
5a27f6de14 Merge branch 'orderfnl' of github.com:mflatt/ChezScheme
original commit: 04618715b7b447877cd874715d78094befb0b988
2018-12-16 06:46:34 -07:00
R. Kent Dybvig
b7cca1a835 Minor tweak
original commit: d2b5ba5d5c45660e63b32fb501b6684d3d11036b
2018-12-05 15:30:40 -08:00
Christian Häggström
d9d0e94d95 Initialize more fields of seginfo
original commit: 48e93161f6ac2796d17a0f147f0dca1e1e195684
2018-12-05 23:36:57 +01:00
Matthew Flatt
31b7c8fd7a add --disable-curses option
To support a more minimal build enviornment, offer the possibility of
building without "curses.h" and "libcurses" (which disables the
expeditor, although the expeditor's code is still included).

original commit: 9a17f73e6fc5e117c19333e15c6afb797dd6b08f
2018-10-22 19:38:08 -06:00
dyb
19f3c85fe2 attempted partial fix for github issue 352
- when thread_get_room exhausts the local allocation area, it now
  goes through a common path with S_get_more_room to allocate a new
  local allocation area when appropriate.  this can greatly reduce
  the use of global allocation (and the number of tc mutex acquires
  in threaded builds) when a lot of small objects are allocated by
  C code with no intervening Scheme-side allocation or dirty writes.
    alloc.c, types.h, externs.h

original commit: 93dfa7674a95837e5a22bc622fecc50b0224f60d
2018-10-05 09:03:30 -07:00
Bob Burger
75a70547f8 use uuid_generate on unix-like systems for S_unique_id
original commit: 2fd3db68230d094a0d396348a8140a4d3693b120
2018-09-19 10:19:03 -04:00
Bob Burger
57b0163e93 add PDB files for Windows
original commit: 6d9bda11c1f8d31bf86c559892cf968d7f0c1595
2018-09-07 16:56:33 -04:00
Matthew Flatt
6e00dab37f bootfiles and fixup
original commit: a6c7f8851fd3996726f62f62e151ff76f0216f72
2018-07-25 18:15:09 -06:00
Matthew Flatt
95d3146c16 Merge branch 'cm' of github.com:mflatt/ChezScheme
original commit: 9d8e3e99e79c1a2fa2cd20849c99f05b91db70d9
2018-07-25 16:07:41 -06:00
Matthew Flatt
4b5daf4594 Merge branch 'arity-wrapper' of github.com:mflatt/ChezScheme
original commit: 23102af98ccd2dacd3529dd37c182d00f1d12490
2018-07-25 16:05:17 -06:00
Matthew Flatt
1860fec019 Merge branch 'gcbt' of github.com:mflatt/ChezScheme
original commit: 59bd17ca5713fbe913e9297e7cbb719b2c45ca7d
2018-07-25 16:01:11 -06:00
Matthew Flatt
b54495f58d Merge branch 'orderfnl' of github.com:mflatt/ChezScheme
original commit: abb84eb7b0dbb9824d0b32407143589ff309a0fb
2018-07-25 16:01:03 -06:00
Matthew Flatt
f919bbcab6 add support for continuation attachments
original commit: 32669b104ef1119aea21f8592cee09d55f696afa
2018-07-25 06:33:46 -06:00
Bob Burger
be2777e261 fix boot_call and the invoke code object to handle multiple values
original commit: 7fd080903d96a1ef9ab79780bf73aa1619f33894
2018-07-18 14:55:53 -04:00
Matthew Flatt
48228739fe add object-references to reflect GC's tracing of objects
The `object-references` function is intended to support debugging of
memory leaks by providing a mapping from each live object to the
object that retained it.

original commit: 61f6602b7e6c388c529f3c5995dcf71a7c42e005
2018-07-16 18:08:48 -06:00
Matthew Flatt
28c8ebaeff add make-arity-wrapper-procedure
A program can use `make-arity-wrapper-procedure` to synthesize a
function that reports a given arity mask (without calling `compile`).

In addition, `set-arity-wrapper-procedure!` suports modifying the
implementation of a synthesized procedure. Although similar
functionality could be achieved with `(lambda args (apply (unbox proc)
args))`, an arity wrapper procedure can dispatch to another procedure
without allocating a list for the arguments.

The interpreter now uses an internal variant of arity wrappers to
cooperate with `procedure-arity-mask`.

original commit: 5fede14302840b55edbeb7565e28d09350a4b2e9
2018-07-16 07:52:55 -06:00
Matthew Flatt
067555c251 add load-compiled-from-port and Sregister_boot_file_fd
original commit: a0adfa18af879f90d746b0b3541b036016957324
2018-07-15 20:44:34 -06:00
Matthew Flatt
2ca43d6c6f add ordered guardians
Also, avoid quadratic time in GC for guardian chains.

original commit: a07c7e14b61862989777909ee63a2ec120c2ea47
2018-07-15 19:12:43 -06:00
Andy Keep
c090b317bd allow s_ee_get_clipboard to use the pastebuffer on macOS even when X11 is not available.
expeditor.c

original commit: f8cf536720fe43d07ca83d284e5bd1733c97372a
2018-07-01 11:45:10 -04:00
d7dcda9637 add an option --disable-x11
original commit: ab43608f22dc68497577ab527c782507144ef0e4
2018-07-01 20:13:18 +08:00
Bob Burger
2f355b464e Avoid an occasional invalid memory violation on Windows in S_call_help
original commit: c2d2467d48eea145455124343c8819dfb683c39e
2018-06-15 16:42:09 -04:00
Bob Burger
8885445d6d Improved Unicode support for command-line arguments, environment variables, the C interface and error messages, and the Windows registry, DLL loading, and process creation
original commit: aa1c2c4ec95c286a12730ea75588a18dd9fb9d59
2018-06-14 14:24:15 -04:00
Andy Keep
b01e92fc4f Merge branch 'master' into gcc-8
original commit: 3fe77b72d97829294f9df3d87deae4649812885c
2018-05-22 23:50:11 -04:00
Bob Burger
486792e042 Use Windows path separator character when finding boot files on Windows.
original commit: 553ac1ae4df56d547051fff5dbbaf82b979ea5e1
2018-05-14 12:15:13 -04:00
Göran Weinholt
336fe9d344 - Double FMTBUFSIZE to fix compilation with gcc-8
c/prim5.c

original commit: 82a14c87aaa44ae004b9d76af42144155e426290
2018-05-04 19:10:44 +02:00
Andy Keep
1f0e42f0ec Merge branch 'pthread' of https://github.com/mflatt/ChezScheme into mflatt-pthread-2
original commit: 2230e5adcb61ac8b27c9deee682270f4e17fbafb
2018-04-21 22:09:05 -04:00
Oscar Waddell
8220ce2b32 handle compiled library code in boot files once base boot is loaded
original commit: 23788415327a5396d14e452fca410ba68431098b
2018-04-13 10:25:03 -04:00
Andy Keep
e79f9a66eb Fixes #273 (on master this time) with -Wno-implicit-fallthrough
Embarrassingly, I committed this change on the wrong branch initially.
Added -Wno-implicit-fallthrough flag to macOS C makefiles.
  c/Mf-a6osx, c/Mf-i3osx, c/Mf-ta6osx, c/Mf-ti3osx

original commit: 8eb8336a7d2870f8e592f060bab8321703e40b48
2018-04-08 12:22:25 -04:00
Matthew Flatt
9aa1fc4caa add collect-rendezvous
original commit: f7cb82d97e34b14bfbafe635b0d4a294527b02c3
2018-04-02 13:52:03 -04:00
Matthew Flatt
22d4fd9978 Add __thread foreign-call convention
See the `foreign-callable` docs for a good example use.

original commit: e3463c78c511ad861dfa49865bb447e9777f9eb8
2018-03-14 17:20:33 -06:00
dybvig
aa8bea9648 reworked the S_call_help/S_return CCHAIN handling to fix a bug in which
the signal handler could trip over the NULL jumpbuf in a CCHAIN record.
  schlib.c
remade boot files

original commit: d8c270403121547101cb523cc1f80a569dbb0378
2018-03-13 12:28:20 -04:00
Matthew Flatt
743800bbb5 support struct args to and results from foreign procedures
original commit: f0a94bdb9f57c1bf7ffbb66693fb5476a6f0e65b
2018-03-12 21:01:47 -06:00
Bob Burger
fb9d36e050 Use spin loop instead of Sleep for more robust race condition mitigation
original commit: fb9f854d449ee96cccb63a12629a729046f0bee1
2018-02-21 16:39:26 -05:00
Bob Burger
6b1259cfef Mitigate a race condition in Windows when deleting files and directories.
original commit: 1a13def8d6570babe378f4c63b5a488fac58ed3f
2018-02-21 16:05:21 -05:00
dybvig
f7c414bda3 Various updates, mostly to the compiler, including a new lambda
commonizatio pass and support for specifying default record
equal and hash procedures:

- more staid and consistent Mf-cross main target
    Mf-cross
- cpletrec now replaces the incoming prelexes with new ones so
  that it doesn't have to alter the flags on the incoming ones, since
  the same expander output is passed through the compiler twice while
  compiling a file with macro definitions or libraries.  we were
  getting away without this just by luck.
    cpletrec.ss
- pure? and ivory? now return #t for a primref only if the prim is
  declared to be a proc, since some non-proc prims are mutable, e.g.,
  $active-threads and $collect-request-pending.
    cp0.ss
- $error-handling-mode? and $eol-style? are now properly declared to
  be procs rather than system state variables.
    primdata.ss
- the new pass $check-prelex-flags verifies that prelex referenced,
  multiply-referenced, and assigned flags are set when they
  should be.  (it doesn't, however, complain if a flag is set
  when it need not be.)  when the new system parameter
  $enable-check-prelex-flags is set, $check-prelex-flags is
  called after each major pass that produces Lsrc forms to verify
  that the flags are set correctly in the output of the pass.
  this parameter is unset by default but set when running the
  mats.
    cprep.ss, back.ss, compile.ss, primdata.ss,
    mats/Mf-base
- removed the unnecessary set of prelex referenced flag from the
  build-ref routines when we've just established that it is set.
    syntax.ss, compile.ss
- equivalent-expansion? now prints differences to the current output
  port to aid in debugging.
    mat.ss
- the nanopass that patches calls to library globals into calls to
  their local counterparts during whole-program optimization now
  creates new prelexes and sets the prelex referenced, multiply
  referenced, and assigned flags on the new prelexes rather than
  destructively setting flags on the incoming prelexes.  The
  only known problems this fixes are (1) the multiply referenced
  flag was not previously being set for cross-library calls when
  it should have been, resulting in overly aggressive inlining
  of library exports during whole-program optimization, and (2)
  the referenced flag could sometimes be set for library exports
  that aren't actually used in the final program, which could
  prevent some unreachable code from being eliminated.
    compile.ss
- added support for specifying default record-equal and
  record-hash procedures.
    primdata.ss, cmacros.ss, cpnanopass.ss, prims.ss, newhash.ss,
    gc.c,
    record.ms
- added missing call to relocate for subset-mode tc field, which
  wasn't burning us because the only valid non-false value, the
  symbol system, is in the static generation after the initial heap
  compaction.
    gc.c
- added a lambda-commonization pass that runs after the other
  source optimizations, particularly inlining, and a new parameter
  that controls how hard it works.  the value of commonization-level
  ranges from 0 through 9, with 0 disabling commonization and 9
  maximizing it.  The default value is 0 (disabled).  At present,
  for non-zero level n, the commonizer attempts to commonize
  lambda expressions consisting of 2^(10-n) or more nodes.
  commonization of one or more lambda expressions requires that
  they have identical structure down to the leaf nodes for quote
  expressions, references to unassigned variables, and primitives.
  So that various downstream optimizations aren't disabled, there
  are some additional restrictions, the most important of which
  being that call-position expressions must be identical.  The
  commonizer works by abstracting the code into a helper that
  takes the values of the differing leaf nodes as arguments.
  the name of the helper is formed by concatenating the names of
  the original procedures, separated by '&', and this is the name
  that will show up in a stack trace.  The source location will
  be that of one of the original procedures.  Profiling inhibits
  commonization, because commonization requires profile source
  locations to be identical.
    cpcommonize.ss (new), compile.ss, interpret.ss, cprep.ss,
    primdata.ss, s/Mf-base,
    mats/Mf-base
- cpletrec now always produces a letrec rather than a let for
  single immutable lambda bindings, even when not recursive, for
  consistent expand/optimize output whether the commonizer is
  run or not.
    cpletrec.ss,
    record.ms
- trans-make-ftype-pointer no longer generates a call to
  $verify-ftype-address if the address expression is a call to
  ftype-pointer-address.
    ftype.ss

original commit: b6a3dcc814b64faacc9310fec4a4531fb3f18dcd
2018-01-29 09:20:07 -05:00
Bob Burger
74fa386d2d fix c/vs.bat to work on 32-bit Windows
original commit: 78f0caf0fbdfa8ff9fd8e4ac1f2b12ee21214fef
2018-01-03 10:06:17 -05:00
Bob Burger
350f87ba4d fix bug in date->time-utc caused by incorrect use of difftime in Windows
original commit: 4748dad50c7f0e9b3ba002c27990d4c88c0189fc
2017-12-29 16:48:30 -05:00
Bob Burger
1a8a6dee21 fix comment about Sscheme_program
original commit: abb991bcd87f64eeae9a3848959191a4da5d6542
2017-12-28 10:54:03 -05:00
Barak A. Pearlmutter
877bf5e25b spelling
original commit: bf67725d5538defc7e006b0fb7a2eb95993b6f34
2017-12-04 09:35:31 +00:00
dyb
3f79fa0c65 - ifdef'd out include of xlocale.h for glibc, since the glibc
locale.h includes xlocale.h or, in glibc 2.26, its replacement.
    expeditor.c

original commit: b04e9123a427034a39fc9084ba2a8b04608bbb3b
2017-10-13 16:59:16 -04:00