Commit Graph

35878 Commits

Author SHA1 Message Date
Matthew Flatt
57ea02616c fix inspector tracking in syntax objects
Repair a NULL vs. #f mismatch.
2015-07-20 13:41:04 -06:00
Matthew Flatt
3d87d61039 fix expansion loop in a definition context
Add the current definition context's scope to any expression that is
produced by macro expansion before trying to expand again, in case the
expansion needs to refer to a definition introduced by a previous
expansion.

Previously, the scope was added before any expansion and after any
expansion, but that misses intermediate points.

The old expander had this bug, too (some of the new tests fail there),
but it showed up less often and was sometimes considered correct, for
various reasons.
2015-07-20 13:20:03 -06:00
Gustavo Massaccesi
a6fe7b3f40 Use the new Travis infrastructure 2015-07-20 12:49:47 -03:00
Robby Findler
e7e184a0ba link from 'disappeared-use and 'disappeared-binding in reference to check syntax 2015-07-20 10:29:24 -05:00
Matthew Flatt
54cf4c7f16 racket/generics: fix generated <gen>/c
The revised implementation of `define-generics` for the new macro
expander wasn't right, because the macro attached to `<gen>/c` for a
given `<gen>` used a macro-introduced reference to the generic to
match up method names with the generic's methods.
2015-07-20 06:39:18 -06:00
Matthew Flatt
0bc5a1b06a fix nested begin-for-syntax
Initialize a phase-2 namespace before trying to use it.
2015-07-19 12:07:53 -06:00
Gustavo Massaccesi
9fe6c138cf Fix typos in docs 2015-07-18 20:44:36 -06:00
Gustavo Massaccesi
597eb161f5 avoid compiler warning 2015-07-18 20:44:36 -06:00
Matthew Flatt
1eba8ac2a7 fix place-channel support for eq[v] hash tables
Bug caught by an existing test.
2015-07-18 20:44:36 -06:00
Sam Tobin-Hochstadt
801a8950bb Fix missing space. 2015-07-17 13:23:10 -04:00
Matthew Flatt
053cfc0ddb fix an incorrect simpliciation in the GC
I had tried to simplify the "generation 0" allocation function to
always use `GEN0_PAGE_SIZE`, but "generation 0" is also used for place
messages, in which case a much smaller size should be used.

The "place-in-channel-fnl.rkt" test exposed this problem.
2015-07-17 09:55:17 -06:00
Sam Tobin-Hochstadt
e8ca83ad78 Don't run db-test on appveyor after all. 2015-07-17 11:47:13 -04:00
Sam Tobin-Hochstadt
9a5d2d8b2d Encrypt correctly for Appveyor. 2015-07-17 11:38:02 -04:00
Sam Tobin-Hochstadt
be29992908 Have Travis post to the #notifications channel. 2015-07-17 11:14:04 -04:00
Sam Tobin-Hochstadt
9f8a0d4731 Run more tests on appveyor now that the machine is faster. 2015-07-17 10:58:23 -04:00
Sam Tobin-Hochstadt
ab07280e71 Reduce syntax/parse dependencies in match. 2015-07-17 10:58:13 -04:00
Matthew Flatt
123f724c47 fix GC problem with chains of ephemerons
A recent GC change (included with the set-of-scopes expander)
allows the GCs marking procedure to recur directly to a limited
depth, instead of always pushing pointers onto a stack. Direct
recursion is not cmopatible with ephemeron-resolution process,
so switch to no-recur mode.

This problem was uncovered by an existing test.
2015-07-17 02:10:04 -06:00
Matthew Flatt
dd0ced3c02 avoid compiler warnings 2015-07-16 21:04:01 -06:00
Matthew Flatt
e954ce0ffa document raco setup --fast-clean 2015-07-16 18:24:25 -06:00
Matthew Flatt
aaee824f68 optimizer: fix coordinate shift when a letrec is split
The combination of splitting a `letrec` and optimizing
the resulting `(let ([x <proc>]) x)` to just `<proc>`
used a bad coordinate shift, which made property testing
incorrect, etc.

For reasons that are not clear, the new expander triggered
the problem through an existing test.
2015-07-16 18:18:58 -06:00
Matthew Flatt
e65beb2636 adjust a core test to avoid mscheme 2015-07-16 17:06:59 -06:00
Matthew Flatt
b72dceb865 avoid excessive fallbacks via eval-syntax
The `eval-syntax` function (which is used by other functions, such as
loading a module) should not install fallback-binding scopes from
the current namespace.
2015-07-16 14:20:00 -06:00
Matthew Flatt
fc5e32e526 switch to set-of-scopes expander
The development history for set-of-scopes is preserved in a "scope"
branch in the main Racket repository, which is commit
 ae88c96f50
2015-07-16 14:20:00 -06:00
Matthew Flatt
bfc2b27d65 fix optimizer's single-use tracking, especially on inlining
When `(let ([x ...]) (let ([y x]) ... y ... y ...))` turns into
`(let ([x ...]) ... x ... x ...)`, make sure that `x` is not
still marked as single-use. Incorrect marking as single-use could
cause the optimizer to inline too much, for example.

Thanks to Gustavo for tracking down the problem.
2015-07-16 07:48:17 -06:00
Matthew Flatt
ec6c88442d fix length-specifying form of _bytes to include room for nul 2015-07-16 07:10:36 -06:00
Gustavo Massaccesi
bfc9eb8d62 Add ´not´ to the relevant predicates list
Previously all the predicates recognized only non-#f things, so ´not´ can be
added to the list of disjoint predicates. But many of the parts of the code
relied on the non-#f property and had to be modified.
2015-07-14 19:20:11 -03:00
Gustavo Massaccesi
dfc64053b7 Infer type from comparisons in test positions
In (if (eq? x <pred?-expr>) <tbranch> <fbranch>) infer that the type of
x is pred? in the tbranch.

Also, reduce (eq? x y) => #f when the types are different.
2015-07-14 19:19:50 -03:00
Gustavo Massaccesi
bc2cf531e3 Reduce variables with type null? and void? to null and #<void>
The optimizer reduces the variables with a known type to #t in a Boolean context.
But some predicates imply that the variable has a definite values, so they can be
reduced in a non-Boolean context too.

For example, in (lambda (x) (if (null? x) x 0))) reduce the last x ==> null.
2015-07-14 19:19:28 -03:00
Gustavo Massaccesi
58300857db Fix bug in type propagation to avoid the reduction of mutable variables
This fixes the bug twice:
* Don't reduce mutable variables with a type to #t in a Boolean context.
* Don't record the type of mutable variables when a predicate is
     checked in a test condition.
2015-07-14 19:19:05 -03:00
Gustavo Massaccesi
b7ae673ee0 Mark (values <expr>) as single valued
While reducing some ignored constructors, the optimizer may wrap the arguments
<expr> in (values <expr>) to ensure that it's a single value non-cm expression.
This avoids the unnecessary nesting of (values (values <expr>)).

Similarly, add the cases for begin and begin0 to single_valued_noncm_expression
2015-07-14 13:43:54 -03:00
Gustavo Massaccesi
d0c9a894fb Mark many port primitives as non-cm 2015-07-14 13:28:28 -03:00
Robby Findler
2ffa03c626 remove unused definition (some old refactoring lost track of this,
I presume)
2015-07-13 09:34:37 -05:00
Matthew Flatt
231e9b3f81 ffi/com repair
Thanks to Kang Ren.

The repair seems obviously correct, but I don't know how to test
it (i.e., don't have a COM object that would exercise the code).
2015-07-10 08:26:21 +02:00
Matthew Flatt
d6fa581a4c increase signal-handling stack size
On 64-bit Linux platforms other than x86_64 (e.g., AArch64), SIGSTKSZ
isn't big enough. Use a stack 10 times as large.
2015-07-03 12:41:37 -06:00
Matthew Flatt
ff492f9bb6 add comments on how page alisngment 2015-07-03 12:40:26 -06:00
Matthew Flatt
331b104345 JIT: inline ptr-ref and ptr-set!
Special treatment of `ptr-ref` and `ptr-set!` applies when the second
argument is one of a few primitive C types: `_int`, `_double`, etc.
2015-07-02 15:59:35 -06:00
Matthew Flatt
b782b9a4db fix no-places, no-futures build 2015-07-02 14:48:19 -06:00
Matthew Flatt
0cda0c98b0 fix GC for non-x86 64-bit platforms
A test for 64-bitness was broken, checking specifically for x86_64
instead of the general 64-bit flag.
2015-07-02 07:26:06 -06:00
WarGrey Gyoudmon Ju
8a817e577c disable HAVE_POLL_SYSCALL in solaris: poll(2) is the CPU eater, and this problem affects all TCP applications including plt-web-server. 2015-07-01 18:21:01 -06:00
Matthew Flatt
40f79dd72e configure: fix --enable-noopt
Broken by cf8c3c9cfe, which shifted optimization flags from
CFLAGS to PREFLAGS when using a gcc-stype preprocessor.
2015-06-30 16:27:34 -06:00
Gustavo Massaccesi
72132ea3aa Reoptimize propagated constants
Reduces them to #t or #f when they are copied to a Boolean context
2015-06-29 23:44:47 -03:00
Eric Dobson
5cd910f9f2 Fix docs on channel synchronization 2015-06-29 17:34:57 -06:00
Matthew Flatt
e4eeaa79cb fix error-message formatting
Avoid an extra newline.
2015-06-29 17:34:19 -06:00
Matthew Flatt
138e16e80f fix clone-linked package update on evolving to a multi-package repo
When a package "p" is clone-linked and the repo for "p" changes to be
a multi-package repository (e.g., with "p-lib", "p-doc", and "p"), a
`raco update` would get confused. Unofrtunately, a plain `raco pkg
update p` can't work in that case, because the clone link would still
be a pathless repo URL; the repairs make `raco pkg update --lookup
--clone ..../p` work as is should.

Related: fix inference of package names in the early check for whether
a package is installed.
2015-06-29 17:33:27 -06:00
Matthew Flatt
6f6a792d06 fix memory-management problem with #:lock-name
Repairs a bug in 290020c597.
2015-06-26 07:44:43 +08:00
Matthew Flatt
290020c597 ffi/unsafe: add #:lock-name option to _fun and _cprocedure
While `#:in-original-place? #t` provides one way to serialize
foreign calls, it acts as a single lock and requires expensive
context switches. Using an explicit lock can be more efficient
for serializing calls across different places.

For example, running "plot.scrbl" takes 70 seconds on my machine
in the original place and using `#:lock-name` in any place,
while it took 162 seconds in a non-main place with Cairo+Pango
serialization via `#:in-original-place? #t`.

Internally, the named lock combines compare-and-swap with a
place channel. That strategy gives good performance in the case
of no contention, and it cooperates properly with the Racket
scheduler where there is contention.
2015-06-25 10:35:22 +08:00
Matthew Flatt
9931d5ef1c avoid compiler warning 2015-06-24 07:17:39 +08:00
Matthew Flatt
f7e1fcd557 log a warning for shadowing an import with a definition 2015-06-24 07:15:29 +08:00
Gustavo Massaccesi
95bac91268 Propagate types form the body of let's forms and inlined functions
The optimizer was able to use the type information gained outside
the let's to reduce expressions inside the lets. For example, in
  (lambda (z) (car z) (let ([o (random)]) (pair? z)))
it reduces (pair? z) ==> #t.

This enable the propagation in the other direction so in
  (lambda (z) (let ([o (random)]) (car z)) (pair? z))
it reduces (pair? z) ==> #t too.
2015-06-23 16:52:40 -03:00
Gustavo Massaccesi
1a091f535e Intersect types gathered in if branches 2015-06-23 16:46:23 -03:00