Commit Graph

40006 Commits

Author SHA1 Message Date
Matthew Flatt
ae1bf1b9fc cs: lock-free eq-hash-code
Chez Scheme doesn't provide `eq-hash-code`, so it's implemented with a
weak `eq?`-based hash table that maps values to fixnums (except for
numbers, symbols, and characters). The table had a lock to support
concurrent use in multiple places, and that became a major source of
contention in parallel builds. Change the implementation to use a new
`eq-hashtable-try-atomic-cell` operation, which effectively moves
contention from the hash table to individual buckets (where it should
be much rarer).
2019-06-17 09:09:30 -06:00
Fred Fu
8e38f1d5cb fix typos in the documentation of prop:convertible 2019-06-16 23:28:31 -04:00
Ben Greenman
0ced8ace34 doc: class, require for-label racket/serialize
class/derived uses `make-deserialize-info` and `make-serialize-info`
2019-06-16 23:31:56 -04:00
Matthew Flatt
f27dbb7951 cs: fix cross-module inlining for separate compilation
Commit fe708871bd broke cross-module inlining for modules that are
compiled in different Racket processes. The problem is that
cross-module information is represented by prefab structures, and the
change caused Chez Scheme's fasl for prefabs to generate a different
structure type on different runs.

To solve the problem, use `racket/fasl` for cross-module information,
instead. But cross-module information also has inlining information as
correlated objects, so make those supported by `racket/fasl`, too.
2019-06-15 10:05:05 -06:00
Ben Greenman
b40e247edd contract-out: struct, keep original struct id
The first time a struct is provided through `(contract-out (struct id ....))`,
 save `id` to access its transformer binding later.

On reprovides:
- hang on to the original `id`
- use its transformer to recover the original predicate/accessor/mutator names

Also, fix a bug where the order of the mutator ids reported by the
struct info was getting reversed

Probably, nobody noticed that bug. They'd have to work around the renaming
issue in #2572 first.
2019-06-14 13:54:47 -05:00
Paulo Matos
ddaf3f5022
Regenerate exports (#2697)
This should have been done after e13fac3ccf, where schemef.h was changed.
2019-06-14 17:05:21 +02:00
Matthew Flatt
4c01f60d56 module name resolver: adjust resolver cache
The default module name resolver uses a cache to map module names to
resolved-path information. The cache was weak in a way that turns out
to be much weaker on Racket CS, essentially because Chez Scheme is
tuned to fire a minor GC more frequently.

The new cache cuts 45 minutes(!) from a 2h15m single-process
distribution build of Racket CS on Linux. That brings it under a factor
of 1.5 of the non-CS build time, instead of over a factor of 2.

Thanks to Caner and Sam for pointing out LONG ago (maybe a year ago)
that the cache works badly for Pycket. Since the cache doesn't make a
big difference for `racketcs -cl racket`, though, it took me this long
to understand that it can be such a big deal for Racket CS when
performing a distribution build.
2019-06-14 06:24:06 -06:00
Matthew Flatt
61bf75962c raco exe: make generated name for embedded module deterministic
Help avoid problems with serialization by making the generation of
embedded module symbolic names deterministic and relatively
insensitive to module order. The generated name is based on a
combination of `path->module-path` and paths relative to the
main module of the executable.

Related to #2693
2019-06-13 07:50:39 -06:00
Matthew Flatt
1a7d881aba raco exe: add ++named-lib and ++named-file flags
The new flags can be used to make an embedded module's name
predicatable, which is useful for making a deserialization format
stable (i.e., `serializable-struct` creates a serializer that uses the
embedded module name). This functionality was already available from
`create-embedding-executable`, but there was no way to reach it via
`raco exe`.
2019-06-12 15:15:57 -06:00
Alexander B. McLin
9c95e31d26 cs: get_self_path implementation for FreeBSD 2019-06-12 12:46:21 -06:00
Matthew Flatt
85a9bdaaee unbreak Windows non-CS build 2019-06-12 07:32:51 -06:00
Matthew Flatt
9c4519628c cs: enable strip on install for FreeBSD 2019-06-12 07:01:05 -06:00
Matthew Flatt
1b729d157b cs: sync LDFLAGS for racketcs on BSDs 2019-06-12 06:52:15 -06:00
Matthew Flatt
0423ec9841 Windows: fix setup/winstrip for different variants
For the normal 3m Racket builds in non-cross mode, CGC DLLs have been
incorrectly left behind (e.g., in the Utah snapshot distributions).
2019-06-12 06:07:34 -06:00
Matthew Flatt
e51c44fa3d Use 3m to build CS on Windows
The extra time to build 3m via CGC seems worth it, especially when
building Chez Scheme's boot files.
2019-06-11 20:01:41 -06:00
Matthew Flatt
204b5cb52e remove use of tests/racket/maybe-single in a module
The `tests/racket/maybe-single` reader should be used only in ".rktl"
test files, but I had used it in a ".rkt" test file.
2019-06-11 20:01:25 -06:00
Matthew Flatt
d8c3edd3e1 io: tiny performance tweak for path-element checking 2019-06-11 18:38:19 -06:00
Matthew Flatt
b1632232ca cs: reduce PLT_LINKLET_TIMES overhead 2019-06-11 16:44:15 -06:00
Matthew Flatt
41dc6f1335 measure resolver time instead of resolve calls in instantiate
The total time of module name resolver calls is more useful, because
each one takes longer, there should be many fewer, and there are
tasks that end up resolving module paths.
2019-06-11 15:53:37 -06:00
Matthew Flatt
a0ce64c5c4 rktio: add missing header
NetBSD needs <sys/time.h>.
2019-06-11 08:06:29 -06:00
Ben Greenman
bcd10a9114 file/tar: add #:timestamp parameter
Add a keyword argument that matches the arg. to `zip`

Fixes an "unbound" id in the docs
2019-06-10 13:24:11 -04:00
Paulo Matos
451a535fc6
Upgrade to Z3 4.8.5 for static analysis 2019-06-10 17:21:33 +02:00
Matthew Flatt
d75b525170 adjust some error tests that should run only once
The change to `err/rt-test` exposed several compiler bugs by putting
error expressions in multiple contexts, but some error tests depend on
trying to run just once.
2019-06-10 07:25:24 -06:00
Gustavo Massaccesi
845dada257 add some check to err/rt-test 2019-06-10 07:23:24 -06:00
Gustavo Massaccesi
589bd920a9 more tests for (inexact->exact +inf.0)
Add test where the expression is not in tail position, to ensure that the optimizer doesn't remove it.
2019-06-10 07:23:18 -06:00
Matthew Flatt
d136245e3b expander as pkg: repair source mode
When support for machine-independent bytecode was added, the bootstrap
implementation of linklets ended up being slightly uncooperative.
Source terms from the bootstrap became wrapped as machine-independent
form. For various reasons, things worked anyway, except that
`--linklets` mode prints bytecode instead of S-expressions. Fix the
bootstrap implementation to cooperate correctly.

Related to #2688
2019-06-10 07:22:55 -06:00
Matthew Flatt
c020bd4feb racket/fasl: repair for +nan.f
The `racket/fasl` implementation wasn't updated with the change
to disable reading for lfoating-point literals.
2019-06-10 07:22:55 -06:00
Sorawee Porncharoenwase
53da8f2bc8 Add parameters that are incompatible with prefab 2019-06-09 10:27:31 -06:00
Matthew Flatt
2f47629f74 optimize: repair some make-struct-type[-property] handling
Don't discard expressions that will fail due to trying to make a
prefab struct type from a parent that isn't a prefab. Similarly, don't
discard a `make-struct-type` with a built-in property that has a
guard. Don't discard a `make-struct-type-property` with a literal
guard procedure that has the wrong arity.

Related to #2685
2019-06-09 07:27:35 -06:00
Matthew Flatt
07e35566e2 optimizer: repair unsafe-mutable-hash-iterate-next and similar
Related to #2685
2019-06-09 07:27:35 -06:00
Matthew Flatt
b133bea92e optimizer: abs expects and produces reals, not numbers
Related to #2685
2019-06-09 07:27:35 -06:00
Matthew Flatt
34cd1e2a2b optimizer: don't discard potential hash errors
If `hasheq` is given an odd number of arguments or if `make-hasheq` is
given a bad argument, then the error should be preserved.

Related to #2685
2019-06-09 07:27:35 -06:00
Paulo Matos
2cd3679d8b
Fix typo s/assuptions/assumptions/ 2019-06-08 22:46:42 +02:00
Ben Greenman
4530a39db8 doc: fasl, add for-label require for serialize 2019-06-07 17:59:34 -04:00
Matthew Flatt
b2e95542d8 io and expander: performance tweaks 2019-06-05 17:52:37 -06:00
Matthew Flatt
a72220a3ac bytecode optimizer: remove exact->inexact on known flonum
And similar for `real->double-flonum`. Also, convert those to
`unsafe-fx->fl` when the argument is known to be a fixnum.
2019-06-05 15:21:49 -06:00
Andreas Düring
3b4cff1bfd Change which values are shown after the copying example
This fixes a possible typing error, as it doesn't make much sense to show
the same value twice.
Show the elements of both structs instead.
2019-06-05 17:19:50 -04:00
Robby Findler
a51231ffa2 use regular old append when possible 2019-06-05 12:52:51 -05:00
Matthew Flatt
c8e9083f0e repair for JIT-inlined unsafe-make-flrectangular 2019-06-05 10:07:04 -06:00
Matthew Flatt
32542de937 doc clarification for syntax-source-module 2019-06-05 08:03:27 -06:00
Matthew Flatt
edd74d6ecf makefile: configure with --enable-racket => no 3m dependency CS
Adjust the makefile that ends up in <builddir> with `--enable-cs` or
`--enable-csdefault` (as opposed to `--enable-csonly`) so that `make
racketcs` doesn't imply `make racket3m` if `--enable-racket` has
supplied an existing Racket.

Also fix `make install-cs` related to GRacket for the case that Racket
3m/CGC isn't built.

Relevant to #2683
2019-06-05 07:07:32 -06:00
Paulo Matos
eec118f4fb
Do not memcpy with null pointer as 2nd arg (#2682)
Caught by test:ubsan:cs
2019-06-05 14:40:23 +02:00
Gustavo Massaccesi
4cf03b7dcd fix typo in reference/read.scrbl 2019-06-05 09:37:08 -03:00
Paulo Matos
c40b24d0d3 Remove stray right paren from configure docs for ubsan 2019-06-04 23:51:27 +02:00
Matthew Flatt
0ca19cfa08 avoid retaining unneeded runstacks in continuations
While a continuation is set up to avoid retaining runstacks, partly by
storing a prompt ID instead of a prompt record, prompt records can
remain on the C stack and get captured anyway. Mitigate that problem
by making the runstack link weak in some prompt record.

Racket CS doesn't have this problem, of course.

Relevant to jeapostrophe/lux#10
2019-06-04 13:53:15 -06:00
Paulo Matos
6eb2175f7a
Fix UNSAFE_FX use of type for v, instead of intptr_t (#2653) 2019-06-04 20:56:10 +02:00
Matthew Flatt
b8617c24e9 unbreak cify build 2019-06-04 09:27:44 -06:00
Matthew Flatt
758e02fa39 schemify: fix bad check on mutated state 2019-06-04 07:34:13 -06:00
Paulo Matos
bcac9682f1
Increase memory limit 10 fold for sandbox test (#2679)
CI tests which run with ubsan enabled and under emulation can intermittently fail due to timeout when there is actually no problem with them.
2019-06-04 15:29:35 +02:00
Matthew Flatt
03710757ef io: fix newline on custom output port
Closes #2677
2019-06-04 07:24:31 -06:00