Commit Graph

39039 Commits

Author SHA1 Message Date
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
Matthew Flatt
a2f1f11f9b cs: fix PLT_LINKLET_TIMES mode Racket-thread safety 2018-07-02 07:20:44 -06:00
Matthew Flatt
eea40a6350 cs: cache foriegn call and callable wrappers
Generating the code for a `_fun` type takes hundreds ot thousands
of times as long as in the traditional Racket VM, to cache results
to reduce the cost.
2018-07-01 20:53:59 -06:00
Matthew Flatt
a1098bdb46 cs: repairs to variable-reference-constant?
Further correct the implementation of `variable-reference-constant?`
on bindings to primitive variable.

This repair affects method-call ctype caching in `ffi/unsafe/objc`.
Add some logging there to make problems easier to detect. Also,
add and improve linklet-evel performance logging for comparing
the traditional Racket VM to Racket-on-Chez.
2018-07-01 17:03:47 -06:00
Matthew Flatt
0f32765fe4 expander: fix variable-reference-constant? on primitive
When setting up the namespaces that imitate primitive instances,
the "constant" annotation wasn't set. The v6.x expander gets this
wrong, too, for different reasons.
2018-07-01 07:40:52 -06:00
Matthew Flatt
d5bb22c2d9 cs: improve #%variable-reference-constant?
Repair constant detection for unmodified imports.
2018-06-30 20:32:01 -06:00
Matthew Flatt
64b2694986 jitify: reduce unnecessary variable indirections 2018-06-30 14:11:45 -06:00
Matthew Flatt
bff5989cde cs: inline struct accessors/mutators across compilation units
Make schemify inline structure accessors and mutators across linklet
boundaries --- or, in JIT mode, across function boundaries --- by
replacing an accessor or mutator with a `#%record?` test and
`unsafe-struct*-{ref,set!}` operation.
2018-06-30 13:02:35 -06:00
Matthew Flatt
0f1088a150 cs: add cache for JIT mode
When linklets are compiled in JIT mode and a called procedure is to be
compiled on demand, consult a cache of compiled fragments (by default,
"jit.sqlite" in the addons directory) and either use an existing
compiled fragment or add to the cache after compiling.

Results for this initial implementation suggests that the idea is
workable. With the cache, starting a JIT-mode program a second time is
almost as fast as non-JIT mode (i.e., directly loading machine code).

Some refinements are needed: limiting the size of the JIT-fragment
cache, better contention handling, and better inlining of structure
operations in JIT mode (which may be useful to cross-linklet
optimization in non-JIT mode, too).
2018-06-29 11:04:16 -06:00
Matthew Flatt
9c104a8ea4 improve zo-{parse,marshal} test
After a RacketCS build, a random ".zo" file may not work for the
current Racket variant, so only try ".zo" files that can work.
2018-06-27 17:21:54 -06:00
Matthew Flatt
fc7c4bb42c repairs for srcloc-marshaling change
Handle "." and ".." as one of the last two elements of a path.
2018-06-27 17:21:03 -06:00
Matthew Flatt
caf1b2e275 avoid a compiler warning 2018-06-27 16:08:14 -06:00
Matthew Flatt
9e6f450005 unbreak startup cifiy
Should have been part of ec036a0f5f.
2018-06-27 07:23:51 -06:00
Matthew Flatt
5b8aa67ea4 Windows: project and other repairs for rktio changes
Should have been part of cda4e5befe.
2018-06-27 06:48:22 -06:00
Matthew Flatt
b13f723ac6 serialize srclocs in bytecode; change expander to keep srclocs
To avoid recording absolute paths from a build environment in bytecode
files, the bytecode writer converts paths to relative form based on
`current-write-relative-directory`. For paths that cannot be made
relative in that way and that are in source locations in syntax
objects, the printer in v6.x converted those paths to strings that
drop most of the path.

The v7 expander serializes syntax objects as part of `compile` instead
of `write`, so it can't truncate paths in the traditional way. To help
out the expander, the core `write` function for compiled code now
allows `srcloc` values --- as long as the source field is a path,
string, byte string, symbol, or #f. (Constraining the source field
avoids various problems, including problems that could be created by
cyclic values.) As the core `write` for compiled code prints a path,
it truncates a source path in the traditional way.

The expander doesn't constrain source locations in syntax objects to
have path, string, etc., source values. It can serialize syntax
objects with non-path source values at `compile` time, so there's no
loss of functionality.

The end result is to fix abolute paths that were getting stored in the
bytecode for compiled packages, since that's no good for installing
packages in built form (which happens, for example, during a
distribution build).
2018-06-27 06:36:20 -06:00
Matthew Flatt
cda4e5befe add sha1-bytes, sha224-bytes, and sha256-bytes via rktio
Although SHA-1 hashing functions are available from `openssl`
libraries, a fast crytopgraphic hash is useful for many purposes below
the layer where the OpenSSL library has been opened. And SHA-1 is
reasonably easy to add to rktio.

Meanwhile, provide an equally convenient SHA-2 function to discourage
bad security practices (i.e., using SHA-1 where SHA-2 should be
preferred).
2018-06-27 06:36:20 -06:00
Matthew Flatt
d72b70f8e1 schemify: speed up jitify a little 2018-06-27 06:36:20 -06:00
Matthew Flatt
ec036a0f5f schemify: remove reannotate arguments
Passing them in instead of direct access to `datum->correlated` was a
holdover from the old setup that schemified directly to annotations.
2018-06-27 06:36:20 -06:00
Matthias Felleisen
5bb837661c for #2058, issue discovered by Sam 2018-06-25 14:06:48 -04:00
Matthew Flatt
a6e6bc0ebd cs: make JIT mode generate non-nested fragments
Applying jitify to a linklet now generates fragments of code that
are not nested. The drawback of this approach is that calling
a nested function needs an extra indirection, and the closure
has an extra slot. The advantage is that the fragments can be
separately compiled and fasled, which could enable a cache of
compiled fragments.
2018-06-22 15:57:50 -06:00
Matthew Flatt
4fa8a9870d cs: report file for bad-version errors 2018-06-22 13:39:08 -06:00
Matthew Flatt
00b9acdac3 cs: fix procedure names
Use a `(let ([<name> ....]) <name>)` wrapper to communicate
an 'inferred-name property from correlated objects to
Chez Scheme. This stategy relies on a Chez Scheme patch to
make the wrapper work consistently.
2018-06-22 12:32:17 -06:00
Matthew Flatt
cf0b38aee9 cs: drop unused correlation early
The improvements reported in 74012f8c57 were actually due to a broken
experiment that dropped source locations on application forms, instead
of preserving them in marshaled code. Adjust the expansion pipeline
to do that earlier and intentionally.

The xify pas doesn't help all that much after all, but it's still more
comfortable to be independent of local-variable names.
2018-06-22 11:04:00 -06:00
Matthew Flatt
74012f8c57 cs: add xify pass for JIT mode
The xify pass replaces local variable names with `x0`, `x1`, etc.
Using a minimal set of symbols makes the fasled form smaller
and typically take only 60-70% as long to read.
2018-06-22 09:57:50 -06:00
Matthew Flatt
d8832723e9 expander: fix corner for syntax-debug-info
Add a missing argument in the implementation of binding traversals for
"all bindings" mode.
2018-06-22 09:57:03 -06:00
Sam Tobin-Hochstadt
30eb06874b Retry fetching from unicode.org when it fails. 2018-06-22 11:18:54 -04:00
Leif Andersen
eb97c7f54e Update deserialize-module-guard. (#2147)
It can now optionally return a pair to redirect the module
that is dynamic-required.
2018-06-22 10:48:12 -04:00
Matthew Flatt
d061970a01 adjust place tests and failure mode
The places test suite included some tests that create lots of places
and don't wait for them, which can lead to an overload of places that
exhausts resources such as file descriptors. Improve the tests, and
also improve a failure behavior from a crash to an error message.
2018-06-21 10:16:02 -06:00
Matthew Flatt
8678fbc90c place-kill: wait for place to finish
The `place-kill` function sends a message to another place to
terminate, but it didn't wait for that message to take
effect before returning. Worse, it put the place object in a
state that claimed that the place had terminated.
2018-06-21 09:00:15 -06:00
Matthew Flatt
d4fc865319 style nit: cond on its own line 2018-06-21 09:00:15 -06:00
Sam Tobin-Hochstadt
b6a3f40bd9 Use a custom implementation of promises.
Saves 43 definitions and 397 lines of (de)compiled code.
2018-06-21 10:37:12 -04:00
Matthew Flatt
61f59a2476 ffi/unsafe docs: clarify C->Racket transtion for _[std]bool
Closes #1817
2018-06-20 18:25:25 -06:00
Matthew Flatt
6ec6b39827 reference: document the synchronizaion result of delay/sync
... and, by implication, `delay/therad`.

Closes 1820
2018-06-20 18:19:57 -06:00
Matthew Flatt
4f658904b5 reference: mention that a place is managed by a custodian
Closes #1824
2018-06-20 18:18:15 -06:00
Matthew Flatt
2a5f8408d1 ffi/unsafe docs: clarify allocation by (_ptr o ...)
Closes #1827
2018-06-20 18:08:17 -06:00
Matthew Flatt
f3fc583c6f ffi/unsafe: document make-late-weak-{box,hasheq}
Closes #1828
2018-06-20 18:05:41 -06:00
Matthew Flatt
f58b99aa74 ffi/unsafe/alloc: add decallocation on place exit
Closes #1830
2018-06-20 16:54:59 -06:00
Matthew Flatt
8fb8d3c936 ffi/unsafe: add _wchar
Closes #1843
2018-06-20 16:54:59 -06:00
Gustavo Massaccesi
76c30df8e6 fix docs of make-custom-set-types
Notice that the vales returned by make-custom-hash-types have a
different order.

Thanks to Jos Koot for the report.
2018-06-20 19:39:26 -03:00