Commit Graph

39327 Commits

Author SHA1 Message Date
Matthew Flatt
e066bb44ea repair uninterrupted-exit on continuation application 2018-07-29 07:18:27 -06:00
Matthew Flatt
d0f73f5ea8 option for benchmark tabulate to tag R5RS benchmarks 2018-07-29 06:41:40 -06:00
Matthew Flatt
1b716d5d32 schemify: fix inlining issues
Make `map` inline again, which involves optimizing away

 (variable-reference-from-unsafe? (#%variable-reference))

early enough. Fix post-schemify optimization for `procedure?
by adding both forms of an import name to the `imports` table.
Fix a problem with inlining operations passed to an inlined
function (as reflected by the addition of `find-known+import`).
2018-07-28 15:07:37 -06:00
Matthew Flatt
fa93b55108 make benchmark driver work right with racketcs 2018-07-28 15:07:37 -06:00
yjqww6
759c71e158 fix a broken pattern-expander example (#2197)
pattern expanders shouldn't use `syntax-protect` on their results, and so they shouldn't use `syntax-rules`
2018-07-28 12:18:40 -04:00
Matthew Flatt
a447b5bf6b expander: improve some errors at phase >= 1
At phase 1 and higher, the expander tentatively allows an unbound
identifier so that, for example, `define-for-syntax` can define a
helper function syntactically after a compile-time expression that
uses the helper. While unbound references eventually trigger an error,
the reordering can be consuing, as in the example

  #lang racket

  (define-syntax (f stx)
    (syntax-parse stx
      [(_ oops) #'ok]))

which complains about `_` when the real problem is that `syntax-parse`
isn't imported.

To provide better errors, `raise-syntax-error` now implicitly extends
an error message to include a list of previously encountered unbound
identifiersin the current compilation unit. That list will be
non-empty only at phase >= 1. With that change, the error message for the
above example is

 bad.rkt:5:5: _: wildcard not allowed as an expression
  after encountering unbound identifier (which is possibly the real problem):
   syntax-parse
  in: (_ oops)
  ....

Closes #2167
2018-07-27 12:29:59 -06:00
Matthew Flatt
031564b28c expander extract: add --local-rename to minimize startup diffs
The expander's output normally uses a distinct symbolic name for every
distinct binding within a linklet. That property is useful for
consumers like schemify, but it's counterproductive for minimizing the
diff in changes to "startup.inc", since the traditional Racket
compiler doesn't need that guarantee. Use `--local-rename` to generate
"startup.inc", which should make future diffs smaller and more
composable after changes to the expander.
2018-07-27 12:29:59 -06:00
Alex Knauth
f4f22404b3
syntax-parse docs: small examples for #:with, #:attr, #:fail-when, and #:fail-unless (#2185)
* small examples for #:with, #:attr, #:fail-when, and #:fail-unless

* add pattern-directive keywords to doc-index
2018-07-27 11:45:46 -04:00
Leif Andersen
cb0d79a8ae
Ignore this PR (#2189)
Fix bug in serialize test

/ -> root dir

On windows `/` isn't enough to make a complete path.
2018-07-26 14:52:31 -04:00
Matthew Flatt
0b9a7587f6 expander/flatten: better help, error reporting, and - mode for ++knot 2018-07-25 21:27:36 -06:00
Matthew Flatt
a41f58f9d7 cs: use call-setting-continuation-attachment 2018-07-25 19:32:29 -06:00
Matthew Flatt
60977b36c7 cs: remove useless call in delimiting continuations 2018-07-25 16:28:07 -06:00
Ben Greenman
68a83680e0 doc: remove duplicate index entry
Remove the second index entry for `'not-free-identifier=?`
2018-07-24 17:28:28 -04:00
myfreeweb
c7c4efca95 Add FreeBSD/aarch64 platform 2018-07-24 13:14:22 -06:00
Ben Greenman
4c672a5b6a typo: 'orig-d' -> 'orig-id' 2018-07-23 22:56:18 -04:00
Ben Greenman
e97717ef2b pkg new: clarify 'module+ main' and 'module+ test' purpose
- edit the comments, thanks to John B Clements and Alex Gian and Alex McLin
  and Phil McGrath
- add simple example code
2018-07-22 00:23:33 -04:00
Leif Andersen
eaaede9c2c
Fix fasl bug in Racket 7.0 beta! (#2178)
* Fix fasl bug in Racket 7.0 beta

The following program causes racket to error in Racket 7.

(parameterize ([current-write-relative-directory (build-path "/" "a")])
  (s-exp->fasl (build-path "/")))

This bug appears to have been introduced in Racket 7, and not in
Racket 6.x.

* Fix another bug where 'same was put through path-element->bytes

* "/" => (car (root-paths-list))

This is for windows where simply "/" is not a complete path.

* Add similar tests to serialize library.

* Better error message when relative-directory is a bad pair

Before it would give an internal list-tail error, now it returns
a proper bad argument error.

* Better tests, and improved common case
2018-07-21 14:46:44 -04:00
Gustavo Massaccesi
ebb7c0ea82 cs: fix mark-table-prune
Fix the case when the list of marks to remove is empty,
and also change the order of the arguments.
2018-07-20 17:50:24 -03:00
Ben Greenman
859ead9cc3 fix random-ref error message
For an empty sequence, print a message in terms of random-ref

Also, change all error messages to show all arguments
2018-07-20 12:11:34 -04:00
Matthew Flatt
a1e928350b foreign-call lock: repair for use during place termination
Now that `ffi/unsafe/alloc` deallocations are triggered by a place
exit, it's more likely that an ffi-call lock can be contended during a
place's termination. When that happens, the place cannot cooperate as
usual. Accomodate this rare situation by spinning.
2018-07-20 08:34:12 -06:00
Matthew Flatt
b40fdb7dd7 rktio: fix signal mask for subprocesses
... by making `centralized_unblock_child_signal` actually unblock SIGCHLD.

Closes #2176
2018-07-20 06:50:45 -06:00
Matthew Flatt
e2435d7187 expander: different repair for race
The repair in 49a90ba75e reorders two lines in a way that, in
retrospect, seems worrying. I can't construct an example that goes
wrong, so maybe it's fine, but it seems possible (now or with some
future change) that attempting to visit available modules could lead
to the same attempt in the same thread and therefore a loop.

This commit changes the repair to just always take the lock instead of
fixing up the attempted shortcut. There's a tiny extra cost to always
taking the lock, but that extra cost seems like a better choice
overall.
2018-07-18 13:48:34 -06:00
Matthew Flatt
49a90ba75e expander: repair a race condition related to "available" modules
Fix a broken use of a lock intended to prevent threads from
conflicting while forcing "available" modules to "visited" module.
2018-07-18 10:42:27 -06:00
Matthew Flatt
d3a5006721 fix typos in configure help 2018-07-18 09:54:29 -06:00
Matthew Flatt
3c95034a90 thread: don't always convert end-atomic to a thread swap
If interrupts are disabled to prevent thread swaps, then don't react
to `end-atomic` by performing a deferred swap. That might happen
with logger callbacks after a GC where a deferred action was
overlooked due to a rare race condition.
2018-07-17 16:23:17 -06:00
Matthew Flatt
e1c2e5d4f4 cs: make "main.sps" work in script or boot mode
Now that Chez Scheme supports libraries in boot files, make
"racket.so" work when it is converted to a boot file. Loading it as a
boot file can save around 20ms on every major GC, since the
"racket.so" code will be in the static generation.

For now, however, `racketcs` is not set up to use "racket.so" in boot
form.
2018-07-17 09:51:20 -06:00
Matthew Flatt
d67cec6892 cs: switch to __collect_safe
Sync with current ChezScheme (plus PRs), which involves changing
`__thread` FFI directives to `__collect_safe`.
2018-07-17 09:18:56 -06:00
Matthew Flatt
bfa08e40b1 remove debugging output from test 2018-07-16 21:11:48 -06:00
Leif Andersen
91d059c817
Relative paths should still be readable. (#2172)
* Relative paths should still be readable.

The resent PR to enable relative serialization resulted in serialzed
objects that weren't actually readable (containing literal path
elements). This PR converts them to bytes.

* Move from serialize to relative path.

Also change path->bytes to path-element->bytes

* Path elements can also be 'up and 'same.

Also merge in the relevant code from racket/fasl.
2018-07-16 18:45:47 -04:00
Matthew Flatt
5fd23b18e5 repair no-executables assemble-distribution on Windows
Repairs a problem with `raco c-tool --c-mods <file> --runtime <dir>`
as reported by Dmitry Pavlov.
2018-07-16 15:59:31 -06:00
Matthew Flatt
652a0ad0d1 racket/serialize: refinements for relative paths
Allow selection of relative-path encoding for paths in data independent
of whether deserializer module paths are recorded as relative.
2018-07-15 12:22:16 -06:00
Matthew Flatt
c2c04711a3 cs: change continuation-frame marks table
Use an association list instead of an eq hashtable. This choice is
compatible with assumptions in traditional Racket (i.e., that the
number of mark keys per continuation frame will be small) and cuts
about 1/4 of the time in a benchmark like

 (define f
   ((contract (-> (-> integer? integer?))
              (λ () values)
              'pos 'neg)))

 (time
  (for ([x (in-range 1000000)])
    (f x)))
2018-07-15 06:26:40 -06:00
Leif Andersen
99fff46726
Add procedure? as an acceptable type for prop:serialize's deserialize binder. (#2168)
* Add allow the binder in prop:serialize to be a procedure.

This procedure is evaluated at serialize time, and is useful if
the deserializer is not known during object-type creation time,
but is during serialize time.

* Add docs+tests.

* Add a history note.
2018-07-13 13:49:29 -04:00
Tong-Kiat Tan
cc4daf074f Typo (#2169)
* Fix typo for style.scrbl

* Fix typo for scribble.scrbl
2018-07-13 13:49:00 -04:00
Leif Andersen
090eed4b28
Add option to create relative paths for 'serialize' (#2166)
* Add option to create relative paths for 'serialize'

Serialize would previously always create complete byte-string paths.
This adds an optional parameter to serialize (#:relative-to) to enable
relative path creation.

Now when deserialize finds a relative path, it resolves it with
respect to `current-load-relative-directory`.

* Moved fasl's path<->relative-path-elements functions

I moved it into the private/relative-path module, so that serialize
can make use of it.

* Update serialize to use relative-path.

* Add tests.

* And update docs.
2018-07-12 09:12:48 -04:00
Matthew Flatt
80e353c143 expander: fix order of unbound-identifier compilants at phase > 0
Closes #2167
2018-07-11 04:25:43 -06:00
Matthew Flatt
6bc8369af5 remove accidentally committed debugging in test 2018-07-11 04:17:42 -06:00
Sam Tobin-Hochstadt
738fe8a44f decompiler: print void in a read-able form except under quote. 2018-07-10 11:24:51 -04:00
Sam Tobin-Hochstadt
044359c53d decompiler: track primitives from #%linklet module. 2018-07-10 11:24:51 -04:00
Matthew Flatt
7bfe967e87 racket/fasl: repair for pair current-write-relative-directory 2018-07-09 15:54:55 -06:00
Matthew Flatt
8411b403e5 improve linklet performance-logging report 2018-07-09 15:54:55 -06:00
Matthew Flatt
41402ac783 expander: small code improvement 2018-07-09 15:54:55 -06:00
shuhung
4d158a8cb8 Fix build-[chaperone-]contract-property document
The keyword argument `#:late-neg-projection [get-late-neg-projection #f]` takes a curried function. The documentation is missing an arrow.
2018-07-05 23:25:37 -10:00
Matthew Flatt
b27ca8c6a9 expander: fix tracking of submodule base scopes
When expanding a `(module* _name #f ...)` submodule, accumulate all
module scopes on the `#f` and use the `#f` for a reexpansion.
Attempting to start each time from the enclosing module's scope loses
scopes that were generated from previous expansions. One consequence
of losind a scope is that an original definition may appear to be
macro-introduced, and the defined variable may become inaccessible
in the module's namespace.
2018-07-05 19:59:15 -06:00
Matthew Flatt
6a1232ee5a io: repairs 2018-07-03 17:26:38 -06:00
Matthew Flatt
d26517b49b thread: add missing end-atomic 2018-07-03 13:43:25 -06:00
Matthew Flatt
89db60abc9 cs: fix exit status on error
Also, fix some error messages in non-CS Racket, and add a
clarification on exit status in the Reference.
2018-07-03 10:56:23 -06:00
Matthew Flatt
0b022b2ef4 makefile: add cs-base and cs-in-place targets 2018-07-03 09:11:07 -06:00
Matthew Flatt
99cf003d98 cs: store code as uncompressed by default
Leaving code uncompressed makes it about 5 times as large on disk, but
it loads about twice as fast.
2018-07-02 18:29:44 -06:00
Robby Findler
ffc5720b51 fix default proc for contract generation
closes racket/typed-racket#751
2018-07-02 07:11:35 -10:00