Commit Graph

3873 Commits

Author SHA1 Message Date
Matthew Flatt
f7382b17c7 ad hoc optimization of `hash-ref'
Convert
 (hash-ref <hash> <key-expr> (lambda () <literal>))
to
 (hash-ref <hash> <key-expr> <literal>)
which is useful for making the `case' expansion fit
Typed Racket.
2012-07-23 21:41:49 -05:00
Matthew Flatt
a0ba30d8e7 fix `syntax-local-get-shadower' for submodules
Closes PR 12926, 12928

Merge to v5.3
2012-07-22 21:43:20 -05:00
James Swaine
f0aaca0dde Change future visualizer trace collection slightly to be more composable 2012-07-22 20:03:22 -05:00
James Swaine
df54f8460b Fix future visualizer trace collection when running inside DrRacket 2012-07-22 20:03:21 -05:00
Eli Barzilay
a6b20f01da Use string-no-nuls?' and bytes-no-nuls?' in more docs & error messages.
Also use `byte?' instead of (integer-in 0 255).

(This commit will most likely require some proof-reading.)
2012-07-22 13:00:05 -04:00
Matthew Flatt
d95ec4d454 fixes for submodules and `variable-reference->namespace'
Closes PR 12925

Merge to 5.3
2012-07-22 11:54:46 -05:00
Asumu Takikawa
e14c5d61e9 Allow guards for impersonatable struct type properties 2012-07-19 22:46:14 -04:00
Matthew Flatt
d3677524b8 macro expander fix
Relevant to PR 12863

Merge to v5.3
2012-07-19 20:42:36 -05:00
Matthew Flatt
a45d13b52a another `namespace-attach-module' repair for submodules
Merge to v5.3
2012-07-19 16:50:25 -05:00
Matthew Flatt
73e07f576b macro-expander fix
The "simpliciation" of a syntax object's lexical context was dropping
module contexts that have no bindings, but those contexts now
contribute to the identifty of some bindings. Fix simplification
to replace the full rename rename with a simplified one, instead
of just dropping it.

Merge to v5.3
2012-07-19 16:50:25 -05:00
Matthew Flatt
9413b30599 fix related to module name resolver change 2012-07-19 07:46:50 -05:00
Matthew Flatt
5c626c5872 3m GC hints 2012-07-19 07:46:50 -05:00
Eli Barzilay
36ee9f9bbd Fix typo from commit 12a4ee8. 2012-07-18 22:52:41 -04:00
Eli Barzilay
bee08899eb New Racket version 5.3.0.16. 2012-07-18 03:30:10 -04:00
Ryan Culpepper
97fabae42f Post-release version for the v5.3 release 2012-07-17 19:21:23 -04:00
Matthew Flatt
5e4866e54c fill in one more corner of submodules and `namespace-attach-module'
When submodules are not independently loaded, then pull submodule
declarations along when attaching a module to a namespace.
2012-07-17 10:16:32 -06:00
Matthew Flatt
c8f4ac6ae4 submodules: make .zo path stick for consistent independent loading
When a module is loaded from bytecode and then the value of
`use-compiled-file-paths' changes, an attempt to load a submodule
would fail, because source isn't used if the main module is
already declared, and the bytecode code is not used according to
`use-compiled-file-paths'. Make the bytecode path stick when it
is used once, so that submodule loads succeed, and make it work
even with `namespace-module-attach'.

The module-attach part of this protocol requires a change to the
API of a module name resolver: the notification mode gets two
arguments, instead of one, where the second argument is an
environment.
2012-07-17 09:47:05 -06:00
Matthew Flatt
12a4ee8d98 FFI repairs for 64-bit big-endian
Again; missed pieces for b3c721a346.
2012-07-17 06:07:40 -06:00
Sam Tobin-Hochstadt
0c9bd915bc Fix error message for find-system-path.
Closes PR 12916.
2012-07-17 07:40:46 -04:00
Matthew Flatt
b3c7210a34 FFI repairs for 64-bit big-endian
Based on a patch supplied by Stephen Lewis
2012-07-16 19:22:31 -06:00
Matthew Flatt
8718a5dd62 doc and error-message fixes for module name resolver 2012-07-16 19:22:30 -06:00
Matthew Flatt
73e901a262 fix optimizer bug
The lambda-lifting transformation needs to iterate to a fixpoint
where each lambda's added arguments and order are known. The
check for whether something changed was formerly just the number
of added arguments, but that's not good enough, because a binding
might get lifted away while another one acquires an extra argument.
The right test is to check the count and original bindings for the
added arguments.

Closes PR 12910
2012-07-15 10:32:45 -06:00
Matthew Flatt
9b51973b79 fix bytecode validation bug
Since the optimizer can lambda-lift a function and adds box arguments
(i.e., locations of mutable variables instead of values), then
the validator must check that calls and declarations are consistent.
But declaration-side information wasn't registered properly.
2012-07-15 10:32:33 -06:00
Matthew Flatt
e430463ea4 another submodule expansion repair
Relevant to PR 12902
2012-07-13 09:38:44 -06:00
Matthew Flatt
a94a2f6d55 avoid compiler warning 2012-07-13 07:48:17 -06:00
Matthew Flatt
1d8f5279bd futures: fix a problem related to lightweight continuations
The mark-stack counter needs to be updated even if there
are no entries to add to the mark stack.
2012-07-12 15:43:22 -06:00
Matthew Flatt
f747c086d8 fix checking for `syntax-local-lift-require'
Closes PR 12894
2012-07-11 14:03:31 -06:00
Matthew Flatt
a022e78ab1 fix Windows (and maybe other compilers) compile problem 2012-07-11 10:29:28 -06:00
Vincent St-Amour
0ae21d8036 Have inlining logs be produced at the debug level, like the TR opt logs. 2012-07-11 10:59:33 -04:00
Vincent St-Amour
78355b6398 Give up on reporting close calls directly from the inliner. 2012-07-11 10:59:33 -04:00
Vincent St-Amour
570c5ef0f4 Log fuel and closure size.
That way, we can detect close calls post facto.
2012-07-11 10:59:32 -04:00
Vincent St-Amour
4538072df6 Add anchor to inliner messages. 2012-07-11 10:59:32 -04:00
Vincent St-Amour
9424c843ef Log inlinings that were close to happening. 2012-07-11 10:59:31 -04:00
Vincent St-Amour
c2018e3710 Log inlining successes, and some failure paths. 2012-07-11 10:59:31 -04:00
Eli Barzilay
6752bec4a3 New Racket version 5.3.0.14. 2012-07-11 03:30:15 -04:00
Matthew Flatt
506b70f71f fix `variable-reference->module-source' for submodules
Unlike the `variable-reference->resolved-module-path', the module
source one doesn't include a submodule path.
2012-07-10 18:35:03 -06:00
Matthew Flatt
428711bf93 another submodule-expansion repair 2012-07-10 15:05:40 -06:00
Matthew Flatt
85bc23377b increment version 2012-07-10 11:42:42 -06:00
James Swaine
2b2070f7b2 Clean up code in futures visualizer
Remove mouseover display for creation graph nodes (for now)
2012-07-10 10:54:43 -05:00
James Swaine
39f42b753d Futures visualizer - show name of jitted function for on_demand events 2012-07-10 10:54:43 -05:00
James Swaine
919d359e9a Make sure future log buffers are cleared when starting to
trace for the futures visualizer
2012-07-10 10:54:42 -05:00
James Swaine
b6f71ec4be Add futures visualizer, improvements to futures logging 2012-07-10 10:54:42 -05:00
Matthew Flatt
8c66bd786b error-message repair
Closes PR 12886
2012-07-06 16:48:37 -06:00
Matthew Flatt
29c83cd254 fix a problem with unboxed arguments in self tail calls
This is an old bug, but it was exposed by recent improvements
in unboxing.

Also, fix JIT implementation of explicitly decremented fuel on
a 64-bit platform, plus some other code clean-up.
2012-07-06 08:25:05 -06:00
Matthew Flatt
f71037c775 also improve JIT support for unboxed flonums in non-tail-call
Applies to non-tail calls to immediate functions, which can be
generated by a `for' or `let loop' pattern in a non-tail
position.
2012-07-06 08:07:10 -06:00
Matthew Flatt
8e6a6738bb futures: improve x87 consistency
Each future thread has its own x87 flags, apparently reset to the
default (at least on Mac OS X) rather than inherited from the
creating thread, so reset the x87 configuration in each new future
thread.
2012-07-06 08:07:10 -06:00
Matthew Flatt
ea2909fdb8 fix no-future build to be bytecode-consistent with future build 2012-07-06 08:07:10 -06:00
Matthew Flatt
b08c202a12 improve JIT support for unboxed flonums in a tail-call case
Applies to tail calls to immediate functions, which can be
generated by a `for' or `let loop' pattern in a tail
position.
2012-07-06 08:07:10 -06:00
Matthew Flatt
c428d4ed4c futures: makestack overflow trigger a request for future-thread memory 2012-07-06 08:07:09 -06:00
Matthew Flatt
aa68692b37 allow `begin' wrapper on a submodule to re-expand
Closes PR 12835
2012-07-02 10:02:41 -06:00
Matthew Flatt
aa0d21b7dd improve module-path-index sharing for a module declaration
To support module caching, module path indexes must be cloned
for each use of the cached module, so that path resolutions
don't collide. Cloning was previously implemented at the point
of shifting the modidx based on the module instantiation name,
but now its cloned at declaration time. This result in better
sharing of module-path resolutions, which in turn speeds up
compile-time instantiation of modules, which in turn speeds up
interactions & examples in documentation (as much as 10% for the
Guide, for example).

Furthermore, the reverse cache within a modidx may have been
used improperly during cloning, and that's not a problem in
the new implementation.
2012-06-28 11:42:20 -06:00
Eli Barzilay
29006f95f4 New Racket version 5.3.0.13. 2012-06-28 03:30:15 -04:00
Matthew Flatt
0d1056dbed fix potential bad interaction of module caching and JIT assumption
The JIT wants to detect calls to functions bound to module-level
variables that are always instantiated to a procedure of a particular
arity, in which case it can avoid some checks.  The problem is that
bytecode and JITted code can be shared via the module cache across
namespaces that use different modules to implement a particular module
path or that enable the JIT differently.  In particular, starting with
one that has a procedure binding and then using one (in a different
namespace) that has a non-procedure binding could lead to a crash.

Defend against this possibility by never treating imported variables
as constant in that sense. The JIT detects imported variables through
a new import map in the prefix.

This change may slow code. My guess is that it will have no
performance impact in practice, due to cross-module inlining,
although I can construct a microbenchmark that slows by 20%.
2012-06-27 09:57:50 -06:00
Matthew Flatt
73a4b1758e avoid a compiler warning 2012-06-27 09:57:50 -06:00
Matthew Flatt
577cf4592e fix problems with references to bindings at higher phases 2012-06-27 09:57:50 -06:00
Matthew Flatt
307ebebcbe misc clean-up 2012-06-27 09:57:50 -06:00
Matthew Flatt
edce1b0406 fix optimizer for impersonated continuation mark keys
The optimizer can no longer reduce
  (with-continuation-mark _id _v-expr _expr)
to just
  _expr
when _v-expr and _expr are simple enough, because _id
might be bound to a continuation mark key with an
impersonator that checks the result of _v-expr.

The loss of an optimization can have a significant affect on
errortrace of microbenchmarks, such as

 (for ([i (in-range 10000000)])
   i)
2012-06-27 09:57:50 -06:00
Eli Barzilay
cf5bafc50f New Racket version 5.3.0.12. 2012-06-27 03:30:16 -04:00
Asumu Takikawa
db6c37df92 Add proxy-able continuation mark keys and proxies
(with much help from Matthew on the JIT side)
2012-06-26 13:39:36 -04:00
Matthew Flatt
cb88590dfb fix interaction of `procedure-arity-includes?' and other things
A arity-reduced procedure-valued `prop:procedure' was not handled
correctly, for example.

A good candidate for random testing? I had the right kind of test in
place, but only for an arity of 1. It turns out that testing any other
arity would have exposed the problem, so now there are tests with
arity 0. If I had randomly generated procedures instead of manually
constructing `f0' through `f1:+' in "procs.rktl", then maybe I would
have more naturally generalized the arity testing, too. Then again,
I did already have relevant inputs, and it was the testing of inputs
that was too specific.

Closes PR 12870
2012-06-25 17:30:03 -06:00
Matthew Flatt
4cd1560b2b error-message repair 2012-06-24 22:29:43 -06:00
Matthew Flatt
28a47f245e fix too-strict bytecode check 2012-06-23 05:21:53 -07:00
Matthew Flatt
d5713cf18b error-message repair 2012-06-23 05:21:52 -07:00
Matthew Flatt
91791983aa fix indentation of some error messages
`raise-syntax-error' and `raise-arguments-error' do not
try to adjust indentation, anymore, because it's too confusing
2012-06-23 02:20:59 -07:00
Matthew Flatt
4323096a46 change contract on second' of date' to allow only 1 leap second 2012-06-23 02:04:55 -07:00
Matthew Flatt
503b3858f5 error-message update 2012-06-23 02:04:55 -07:00
Matthew Flatt
ff8a062bfe guarantee `current-seconds', etc. from 1/1/1970 UTC
For all currently supported platforms, the result was already
portable, despite the documentation's hedging.

Also fixed up the documentation in other ways, such as the fact
that `seconds->date' returns a `date*'.
2012-06-23 02:04:55 -07:00
Matthew Flatt
ed2b2b56eb avoid a hard-coded limit 2012-06-23 02:04:55 -07:00
Matthew Flatt
1dc0072d03 further error message convention refinements
Add extra intitial-message lines, use "..." on a field name
to indicate that it could reasonably be hidden by default,
and refine some existing messages.
2012-06-22 09:47:59 +08:00
Matthew Flatt
40c892ff80 futures: future-local handling of stack overflow
Includes the addition of 'overflow and 'start-overflow-work
events, whcih are effectively specializations of 'sync and
'start-work to expose overflow handling.

Also, fix a bug related to a potential GC during mark-stack
restore from a lightweight continuation.
2012-06-21 07:14:50 +08:00
Matthew Flatt
f91dc81bf5 futures: fix some CGC problems
.. even though futures don't work well with CGC, due to
the lack of future-local allocation.
2012-06-21 07:14:49 +08:00
Matthew Flatt
61be7a9a40 futures: implementation clean-up
Remove some unnecessary and redundant parameterization.
2012-06-21 07:14:49 +08:00
Matthew Flatt
db46b2ef92 futures: make tail-call allocation local or synchronizable
By itself, this change won't help anything, because tail-call
allocation is triggered for something that can't be called directly.
This change sets up part of an improvement for future-local recovery
from stack overflow, though.

(I had trouble constructing a test that would trigger the new code.
Fortunately, the existing tests trigger it.)
2012-06-21 07:14:49 +08:00
Matthew Flatt
b27ae70d0a error message repair 2012-06-21 07:14:49 +08:00
Sam Tobin-Hochstadt
ac0bb2b98f Error checking in bytecode reader.
Found by:
    fuzz.rkt -s 912673274  -f collects/setup/compiled/xref_rkt.zo
    fuzz.rkt -s 568444835  -f collects/syntax/scribblings/compiled/strip-context_scrbl.zo
    fuzz.rkt -s 1009851773 -f collects/mred/private/wx/cocoa/compiled/platform_rkt.zo
2012-06-19 19:17:12 -04:00
Matthew Flatt
1e4186098e yet more fixes to avoid compiler warnings 2012-06-16 04:54:45 +08:00
Matthew Flatt
d0d83577c7 avoid some compiler warnings 2012-06-14 15:25:42 +08:00
Matthew Flatt
089cb6669c improve implicit-begin syntax-error reporting 2012-06-14 15:11:19 +08:00
Matthew Flatt
567d16ea2b fix embedded-code reader
When the code is source insteda of bytecode, `#reader' and `#lang'
need to be enabled.
2012-06-13 17:20:17 +08:00
Matthew Flatt
a871574318 make #%plain-module-begin' transformer detect module*' in stop list 2012-06-13 17:07:06 +08:00
Matthew Flatt
95d77d63e0 fix some casts 2012-06-13 16:33:03 +08:00
Asumu Takikawa
4ce4d7531b Improve docs & errors for control proxies
In particular, use consistent terminology for errors
and provide usage examples
2012-06-12 12:16:56 -04:00
Eli Barzilay
b93a3c7495 New Racket version 5.3.0.11. 2012-06-12 03:30:23 -04:00
Asumu Takikawa
a181011b55 Check for proxied prompt tags when needed
Fixes a bug where some control operators would
not recognize proxied prompt tags (non-proxied were fine)
2012-06-11 21:04:45 -04:00
Asumu Takikawa
5aa76c27a9 Support multiple values for control proxy functions 2012-06-11 18:18:37 -04:00
Asumu Takikawa
d527426cac Prototype implementation of control proxies 2012-06-11 18:18:37 -04:00
Vincent St-Amour
a89bd99e2a Fix printing of single-precision floats.
If there's already an exponent separator, replace it with f.

Closes PR12836.
2012-06-09 19:35:37 -04:00
Matthew Flatt
5caa114564 fix `print-syntax-width' for +inf.0
Closes PR 12837
2012-06-10 06:58:06 +08:00
Matthew Flatt
fbb6a294f3 local-expand' allows a stop list to have only module*'
That is, when the sto plist contains only `module*', core
forms are not implicitly added to the stop list.
2012-06-08 16:08:55 +08:00
Matthew Flatt
941f215aa0 improve cycle-in-loading error message 2012-06-08 16:08:55 +08:00
Vincent St-Amour
c0b978f71f Fix handling of NaN in flmin and flmax. 2012-06-06 18:26:51 -04:00
Matthew Flatt
fdb722dcb1 shortcut for numbers in `write', etc. 2012-06-06 15:17:35 +08:00
Matthew Flatt
4b07fc42f0 racket/future: fix heuristic for creating future-running threads
James noticed that the previous implementation was too slow to make
threads.
2012-06-06 13:25:14 +08:00
Matthew Flatt
269a3392dc racket/future: fix debug logging for sync vs. block
When a "synchronized" operation is handled for a future thread
during a `touch' on the future, then still report the handling
as "synchronized" insteda of "blocked".
2012-06-06 13:25:14 +08:00
Matthew Flatt
53f7a77e8f racket/place: avoid place-termination cycle 2012-06-05 17:53:27 +08:00
Matthew Flatt
d1c2430bf1 remove extra space in some error messages 2012-06-03 11:09:32 +08:00
Tim Brown
ff185cf743 Solaris 5.10 has poll(), so set try_poll_syscall="yes" in configure
in order to enable it. Otherwise Solaris 5.10 has issues building.
2012-06-03 04:50:06 +08:00
Matthew Flatt
d8a26e6c3c more corrections to the error message conversion
Foudn these by writing a simple source checker.
2012-06-01 19:03:43 -07:00
Matthew Flatt
85a2267e6c ffi/unsafe: new error message convention at primitives
Also, fix FFI procedures to preserve names: change `ptr-ref' with
`_fpointer' on an `ffi-obj' value to return the `ffi-obj'
value, so that the name in the `ffi-obj' value can be used
by `_cprocedure'.

Closes PR 12645
2012-06-01 19:03:43 -07:00
Matthew Flatt
f10a258dcb ffi/unsafe: fix arithmetic overflow and representation
Thanks to Tobias Hammer for the report and initial repairs.
2012-05-31 09:21:25 -06:00