Commit Graph

236 Commits

Author SHA1 Message Date
Gustavo Massaccesi
6789fd84c1 Use system flag of primitives to avoid check in primvars.ms
With this flag the primitive is not tested in primvars.ms but other
parts of the compiler can use the signature/flags.

Also, add a signature to every system boolean primitive.

  primvars.ms, primdata.ss

original commit: ee023c673bda6557bc223de7f8b0e732600619bc
2019-11-15 17:03:00 -03:00
Matthew Flatt
8c82d4e5b7 fix continuation-attachment optimization and non-single-value primitives
original commit: 6180395ad38887c6278e96a6cea9e0a4aad2453a
2019-11-05 17:49:50 -07:00
Matthew Flatt
9ae0e9b971 fix call/cc inside call-...-continuation-attachment
Can't simply use a continuation reified by an attachment
operation, because it is probably a 1-shot continuation
that needs to be promoted.

original commit: 8201aff06df8011ffbc41f217d50e4c430d75bb5
2019-10-24 05:40:55 -06:00
Matthew Flatt
bed6036b26 fix test for folding of mutable field access
original commit: e173ef6374751631dd16441dad3feadd7dcbfe1e
2019-10-16 09:08:13 -06:00
Matthew Flatt
b34084640b pseudo-random-generator-seed! should allow 0
original commit: 1802cca10ec6abfe4bc177a4d4d9fa0d9a201517
2019-10-07 20:08:41 -06:00
Matthew Flatt
18d18b7ff6 add pseudo-random generator API
The MRG32k3a generator is fast when using unboxed floating-point
arithemtic. Since the Scheme compiler doesn't yet support that,
build MRG32k3a into the kernel and provide access via
`pseudo-random-generator` functions.

original commit: 3dd74679a6c2705440488d8c07c47852eb50a94b
2019-10-07 10:58:39 -06:00
Matthew Flatt
174c416f9e repair for opportunistic 1-shot
If normal 1-shot continuations are mixed with opportunistic 1-shot
continuations created by `call-setting-continuation-attachment`, then
promoting an opportunistic 1-shot at a GC is wrong unless the whole
chain is promoted.

original commit: 2dfac475666763b60935e382386af4438f3029e0
2019-09-24 11:41:50 -06:00
Matthew Flatt
f1a839069d fix __collect_safe and arguments/results in x86_64 floating-point registers
original commit: d8cb953259faeb8cbab8f66c365ac87eb37ad0f6
2019-09-13 06:09:47 -06:00
Matthew Flatt
114a0c44ea sync experr
original commit: 8e84522597b67b5c046d7431da4b592332ce3785
2019-09-13 06:09:47 -06:00
Matthew Flatt
c57de26c1d add call-consuming-continuation-attachment
Also, rename `call-with-current-continuation-attachment` to
`call-getting-continuation-attachment`.

original commit: e2a00e6d641b92918c4911c27ba14949748fd291
2019-09-11 17:07:11 -06:00
Matthew Flatt
502b0b5f50 repair for locked-object handling and multiply-locked values
Weak pairs, ephemeron pairs, some symbols, and some ports were handled
incorerctly when locked multiple times.

original commit: 847fc1c84496f67cd363c8411d0023339f4d6246
2019-09-01 08:57:14 -06:00
Matthew Flatt
c195288251 scalable object locking
The `unlock-object` operation was O(N) with N currently locked objects
--- so, O(N^2) to lock N objects and then unlock them --- because
locked objects were stored in and searched in a global list. Also, GC
was O(N) at any generation with N locked objects across generations,
since every locked object was scanned.

Fix these poblems so that locking and unlocking is practically O(1)
and GC is not poportional to locked objects. More precisely, locking
and unlocking is now O(C) for locking an individual object C times to
be balanced by C unlocks. (Since multiple locks on a single object
is rare, this performance seems good enough.)

The implementation replaces the global list with segment-specific
lists. Backpointers are managed using the general generational
support, so that unmodified, old-generation locked objects do not
need to be swept duing a new-generation collection.

original commit: a57d256ca73a3d507792c471facb7e35afbe88b3
2019-09-01 07:03:16 -06:00
Jon Zeppieri
625c466ee7 Adds hashtable-ref-cell
... and eq-hashtable-cell and symbol-hashtable-ref-cell,
which are just like hashtable-cell, except that if the given
key isn't present, they return #f instead of mutating the table.

original commit: c1ab89fc2152ba41f50c0a5b0e5857fc48fc63c1
2019-07-26 16:02:55 -06:00
Matthew Flatt
ed8794d83d fix check for arity wrapper and non-fixnum-width arg count
Closes racket/racket#2746

original commit: 633cab4d38d8d22a0425f5554d80faba925dfdde
2019-07-17 16:43:32 -06:00
Matthew Flatt
71846161f9 Merge branch 'bsd' of github.com:mflatt/ChezScheme
original commit: 198477a40c2c580924d95491e63d80e1f9a39c0d
2019-07-05 07:30:37 -06:00
Matthew Flatt
c38194c0ca adjust build for BSDs, MinGW cross-compile, and more configuration
Includes joint work with @abmclin, @pmatos, and @jessealama.

original commit: 70559d074f70dcadec5cea3619f75f91fcda77eb
2019-07-03 18:54:04 -06:00
Matthew Flatt
91ba34b886 fix open-string-input-port on immutable strings
original commit: 58663d92a353969e3b27de2e1a44df571036e1b2
2019-07-02 13:17:39 -04:00
Matthew Flatt
98381f0206 Merge branch 'strport' of github.com:mflatt/ChezScheme
original commit: 4ae71d2bac241154aad565a6006454fb394fc9fb
2019-07-01 16:56:05 -06:00
Matthew Flatt
5053fbb98d fix open-string-input-port on immutable strings
original commit: 48b0ace8b6fba756d8573698db4244472c64255f
2019-07-01 16:44:45 -06:00
Matthew Flatt
5f92ffa3c4 improve asin acos on +inf.0 and -inf.0
Avoid tripping into +nan.0 by using 0 instead of 0.0
for the imaginary part of a real number and by using
`atan` with two arguments instead of one.

original commit: e3f499adfbcbe94726fe11869ca23176fa2c3b78
2019-06-28 15:58:17 -06:00
Matthew Flatt
d31368fc09 improve expt on exact non-integer second argument
Correct the case that converting the second argument to an inexact
numbe produces an integer by losing precision.

original commit: 467db7fa1f1d068e9bad250b93044d157cd3806d
2019-06-28 14:33:18 -06:00
Matthew Flatt
35a0dfcafe improve precision of complex-number divide
original commit: 4c9a7f6abb1258158d48fcdb656de300902cf3c7
2019-06-28 10:42:57 -06:00
Matthew Flatt
1116287328 adjust sqrt and log on -0.0
original commit: 098fdb7d197bda4cd1ecc9b68407ee72fcce9311
2019-06-21 12:48:42 -06:00
Matthew Flatt
e11d9c846e fix flround on [-0.5, 0.0)
original commit: 9679b21d99477a077b226bc279a6d68ebbd7ce5b
2019-06-21 12:26:00 -06:00
Matthew Flatt
8479c4bebf print positive flonum exponents with "+"
original commit: bcf4dd26d268e25a89f24edc4ae7c75c97411c6d
2019-06-21 12:19:59 -06:00
Gustavo Massaccesi
d56e01edc9 rename who -> maybe-who
original commit: d03334caa7cfe429b5ea0d4ed245524fcf787cab
2019-06-20 12:33:51 -03:00
Gustavo Massaccesi
2a20927ac2 use more specific signatures to imply true
original commit: 7d1ad70840d85912ff08cb2d3ec0c685fc134661
2019-06-20 12:33:50 -03:00
Gustavo Massaccesi
85ef2ef788 use signatures with eof/something
original commit: 9785012847db7e6bae35ce9cef83559ca8ae7632
2019-06-18 17:49:18 -03:00
Matthew Flatt
034927b44f add eq-hashtable-try-atomic-cell
original commit: 8af6533643eaaa1b22f5724c52b6b26f4a81d7c4
2019-06-16 10:35:31 -06:00
Matthew Flatt
81191397b5 Merge github.com:cisco/ChezScheme
original commit: bb65f1a8e429683e2925cf1678145efe0ade59bb
2019-06-07 08:56:14 -06: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
Matthew Flatt
6cd6071c3a update test case for number->string changes
Should have been part of 1976cd57b6.

original commit: a48f3525d764938cfc1a343d810b5f0f0b14dbbb
2019-05-22 13:41:50 -06: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
Matthew Flatt
8ec5457627 sync expected test output
original commit: 10a95153007ff5ae850b65b686705bb23be349d8
2019-04-27 06:01:10 -05:00
Matthew Flatt
c069bbf219 adjust compute-size-increments test for interpreter
original commit: 7b64c7701664d11cd5ab6a777dc0993456513c82
2019-04-26 22:37:06 -05:00
Matthew Flatt
a585c64390 adjust object-backreferences test for interpreter
original commit: 5a80683a60189b096e2edc6c45afdbc0e49e97c3
2019-04-26 22:36:55 -05:00
Gustavo Massaccesi
03214b9bdb cp0: reductions for $record-ref
original commit: 8a04158ef995388ffcdfb369d6cfaf4ec384408d
2019-04-20 23:10:46 -03: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
Gustavo Massaccesi
dd67d22b95 cptypes: reduce (if t <error> x) ==> (begin (if t <error> (void)) x)
so the surrounding code can be reduced, for example

(+ 2 (if t <error> 3)) ==> (begin (if t <error> (void)) 5)

original commit: c1993e7c707b3528c6de5e1d4b36005655d22aff
2019-04-04 18:31:00 +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
Matthew Flatt
e5cd2ec27a Revert "cptypes: reduce (if t <error> x) ==> (begin (if t <error> (void)) x)"
This reverts commit 79f23f2ddb858aa6c69bd1e9314e745145ad2b15.

original commit: 83377ac5f916dc4848536f204f49645829007f4a
2019-03-31 11:13:19 -06:00
Gustavo Massaccesi
6d0780488c cptypes: reduce (if t <error> x) ==> (begin (if t <error> (void)) x)
so the surrounding code can be reduced, for example

(+ 2 (if t <error> 3)) ==> (begin (if t <error> (void)) 5)

original commit: 79f23f2ddb858aa6c69bd1e9314e745145ad2b15
2019-03-29 18:45:58 -03:00
Gustavo Massaccesi
405d774fcf fix use of equal-entries? in hash.ms
original commit: 8a7976820077e657fad3e4829d3706bf40f03753
2019-03-27 21:47:41 -03:00
Gustavo Massaccesi
7f4a4b6c05 fix record.ms
original commit: 1e83737283252ce7ac2d48c2bf8640bfb60fc932
2019-03-27 21:47:41 -03:00