Commit Graph

40268 Commits

Author SHA1 Message Date
Ryan Culpepper
7fb0250191 syntax/parse: update comments 2019-06-19 16:21:43 +02:00
Ryan Culpepper
6577791664 syntax/parse: improve minimatch on structs, vectors; delete dead code 2019-06-19 16:21:43 +02:00
Stephen De Gabrielle
38ef00fca3 raco pkg new changed to create APACHE and MIT license files 2019-06-19 09:17:53 -04:00
Ryan Culpepper
527048c319 update expobs regression test for change in syntax expansion 2019-06-19 15:03:17 +02:00
Ryan Culpepper
4cb37a1d8a template: improve ASTs, use smart constructors
Improvements include:
- less scattered handling of constant templates
- better recognition of constant templates, like (1 (... 2)), where
  the template syntax is not identical to its value
- better code for (x ... ...), where x is trusted
2019-06-19 14:48:28 +02:00
Ryan Culpepper
2915657c27 template: parse ellipses using stack of map environments
This is like the psyntax approach but frames are mutable
and track extra information.
2019-06-19 14:48:28 +02:00
Ben Greenman
7b4e757fe5
typo: impersonate-hash, 'filter' -> 'replace' & 'a the'
- change high-level summary of `key-proc` to say it replaces
   keys rather than filters; this matches the wording further down
- 'a the' -> 'the'
2019-06-18 20:17:47 -04:00
Matthew Flatt
6184de2389 ffi: fix use of struct malloc mode for function results
Relevant to #2702
2019-06-17 15:32:14 -06:00
Matthew Flatt
1824fe5e41 io: add shortcut to get semaphore on blocking fd read
When reading from an input fd blocks, instead of creating a general
event that creates a semaphore, use the semaphore directly (when
available). Also, treat a semaphore internally as an event that
always produces 0.

This change speeds up the "echo" shootout benchmark.

This change speeds up the "echo" shootout benchmark.
2019-06-17 10:08:40 -06:00
Matthew Flatt
97e61b5f25 thread: avoid repeated polls while scanning available threads
Poll for external events just once before starting a search for an
available thread, instead of polling every iteration in the search.
2019-06-17 10:08:27 -06:00
Matthew Flatt
6d200e6143 cs: remove compile-as-independent? mode
This slower mode hasn't turned out to be needed, and since it hasn't
been used, it probably doesn't work anymore.
2019-06-17 09:10:39 -06:00
Matthew Flatt
9d55443e23 cs: force inline of applicable-struct support
When the schemify pass cannot determine that a call is to a primitive
procedure, it generates an `#%app` form that expands to

  ((extract-procedure rator) rand ...)

Force `extract-procedure` to be inlined (by making it a macro), so the
expansion is

  (let ([tmp rator])
    ((if (#%procedure? tmp) tmp (slow-extract-procedure tmp)) rand ...))

which is usefully faster in the common case that `rator` turns out to
be a primitive procedure.
2019-06-17 09:10:08 -06:00
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