Commit Graph

37873 Commits

Author SHA1 Message Date
Sam Tobin-Hochstadt
8b915ea977 Avoid uninitialized-variable warning. 2016-12-05 10:01:03 -05:00
Gustavo Massaccesi
25dc89a238 more reductions in ignored expressions
extend optimize_ignore to go inside expressions with
begin, begin0 and let.

Also, try to reuse begin's in the first argument of
make_discarding_sequence.
2016-12-04 23:18:43 -03:00
Matthew Flatt
200fbe9b95 fix rename-file-or-directory for raising exn:failsystem:fail:exists
Broken by 0133954c84, which avoided a made-up `EEXIST` but left in
place a no-loner-appropriate test for raising `exn:failsystem:fail:exists`.
2016-12-01 10:21:11 -07:00
Matthew Flatt
af555731a6 adjust generated #ifdefs in FFI
Make sure `#` is start at the start of the line using
the `IFDEF` function, although we'll probably never
again use a compiler old enough for this to matter.
2016-12-01 10:21:11 -07:00
Robby Findler
cbcbc6ae0c avoid adding bogus names to arguments of various contract combinators
closes #1528
2016-12-01 09:34:16 -06:00
Vincent St-Amour
3d63b76730 FIx typo in HTTP client docs.
Reported by nyaacarD on IRC.
2016-11-30 10:02:56 -06:00
Vincent St-Amour
8130b571c4 Fix compilation on ARM.
From Juan Francisco Cantero Hurtado.

Closes #748.
2016-11-29 12:26:26 -06:00
Matthew Flatt
ac04d1e544 repair broken allocation
Commit 4b02c169d7 incorrectly used a size calculation for
structs in the case a serialized structure representation.
2016-11-28 19:38:32 -07:00
Matthew Flatt
ba1f5be532 fix potential crash when printing a changing hash table
If a mutable hash table changes while it's being printed,
various parts of the printing function could see a mismatch
between the current size and an old array size. To avoid this
problem, extract the size whenever extracting the array.
2016-11-28 18:17:36 -07:00
Matthew Flatt
4b02c169d7 improve allocation reports, especially in backtrace mode
Track total bytes allocated for various tags and categories
in backtrace mode, and improve structure reporting to include
byte counts.

Strip away a more ad-hoc counting that was added recently.
2016-11-28 08:49:07 -07:00
Robby Findler
31ca626910 document a default 2016-11-25 09:17:28 -06:00
Sam Tobin-Hochstadt
34fdd2863a Avoid traversing immutable vectors when specified.
This adds #:eager as an option for controlling this behavior.

Using `#:eager 10` is a 2x improvement in performance for configuration 010001
of the suffixtree benchmark from Takikawa et al, POPL 2016.

The default behavior is unchanged. This is configurable because some
programs are much faster when eager checking is performed. For example:

(require racket/contract)
(collect-garbage)
(time (for/sum ([_ 100000])
        (vector-ref (contract (vectorof integer? #:eager #t) #(1) 'pos 'neg)
                    0)))
(collect-garbage)

(time (for/sum ([_ 100000])
        (vector-ref (contract (vectorof integer? #:eager #f) #(1) 'pos 'neg)
                    0)))

The second loop is 3-4 times slower than the first. However, making
the vector much larger will make the difference go the other way.
2016-11-22 11:28:30 -05:00
Matthew Flatt
201d3760b7 fix syntax-source-module repair
Try again on 3a782d01db, which broke contract tests by
mangling the module path index attached to a module.
2016-11-21 20:43:46 -07:00
Matthew Flatt
3a782d01db fix interaction of module->namespace and syntax-source-module
An identifier that gets a module context via `module->namespace` plus
`namespace-syntax-introduce` should not count as having the module as
its source as reported by `syntax-source-module`.

The correct behavior happened for the wrong reason prior to commit
cb6af9664c.

Closes #1515
2016-11-21 17:40:44 -07:00
Vincent St-Amour
87161fc5f3 Add more missing properties. 2016-11-21 15:46:25 -06:00
Matthew Flatt
02b0a30988 improve ellipsis-count checking wrapper
For a template expression that involevs ellipses, a wrapper is added
to catch failures an report as an "incompatible ellipsis match count"
error. The wrapper was only added when there are multiple pattern
variables with ellipses, but it turns out that it's possible to fail
with incompatible counts using a single pattern variable.

Besides handlign that case, the revised check avoids an unnecessary
wrapper in cases where multiple pattern variables have ellipses but
they are used independently in a template.

Closes #1511
2016-11-21 10:01:36 -07:00
Vincent St-Amour
cf2030b0b1 Add missing properties to contract chaperone. 2016-11-21 11:00:02 -06:00
Sam Tobin-Hochstadt
c5cce7aa7b Fix test for values, and simplify test case. (#1525)
Repairs 7c22c42c7.
2016-11-21 11:02:56 -05:00
Matthew Flatt
4902b5e10c more forceful update of Scribble common files for docs
racket/scribble#69
2016-11-21 08:02:09 -07:00
Matthew Flatt
7c22c42c72 fix optimizer imprecision for values
Without this repair,

 #lang racket/base
 (require 2htdp/abstraction)
 (for/list ((dropping-which-one (in-naturals)))
   1)

fails to compile with a "optimizer clock tracking has gone wrong"
error. A variant of this test (that doesn't depend on `2htdp`)
is now in the "optimize.rktl"; a simpler and more direct test
should be possible, but I wasn't able to construct one.
2016-11-20 18:06:46 -07:00
Robby Findler
09c1174f7e add the #:extra-delay argument to recursive-contract 2016-11-19 15:56:18 -06:00
Ryan Culpepper
f1128cca97 syntax/parse: fix literal-set->predicate and datum-literals 2016-11-16 18:58:44 -05:00
Gustavo Massaccesi
85eee2bbbc optimizer: remove argument of finish_optimize_application
The value of rator_flags was calculated in optimize_application and used in
finish_optimize_application, but it is possible to calculate it directly in
finish_optimize_application, and then remove some internal coupling.

This also simplifies other locations where the rator of an application was
changed and then it was necessary to recalculate the value of rator_flags
to complete the optimization steps.
2016-11-15 11:39:11 -03:00
Gustavo Massaccesi
9ebfdb54e7 extend reductions for expressions like (if (if X Y #f) Z K)
=> (if X (if Y Z K) K) where K is a constant,
to expressions where the inner `if` is (if X Y #t) or (if X #t/#f Y)
2016-11-15 11:37:17 -03:00
Gustavo Massaccesi
c3595c56b4 extend reductions for expressions like (let ([x (let ([y M]) N)]) P)
=> (let ([y M]) (let ([x N]) P))

to expressions where the outer `let` has more than one clause, for example

(let ([x (let ([y M]) N)]
      [z _])
  P)
2016-11-15 10:43:26 -03:00
Leif Andersen
1582178982 Add example for dict-implements/c 2016-11-15 08:29:51 -05:00
Matthew Flatt
115dec6fd9 fix bug in scheduler
When a thread that is blocked on a set of semaphores and channels
is suspended and resumed after one of the events becomes ready,
and if the event has a wrapper function, then the wrapper was
not applied and the event selection was not reported correctly.

Thanks to Philip McGrath for reporting the problem.
2016-11-14 08:21:42 -07:00
Sam Tobin-Hochstadt
3b9354f16b Handle quasi-list patterns better inside prefab struct patterns.
Reported by William Bowman.
2016-11-09 19:47:12 -05:00
Reuben Thomas
81fa8c403d sendurl: overhaul browser list
Remove “ancient browsers” netscape and mosaic.

Remove non-browsers (xdg-open, gnome-open), because we really want a
browser, and they don’t understand file URLs with queries.

Add chromium-browser.

Add default browser finders x-www-browser and sensible-browser (Debian &
derivatives).
2016-11-09 11:17:27 -06:00
Matthew Flatt
db26a24f2f Windows: fix timezone calculation
Comparing to daylight-saving time change was performed incorrectly, so
that days in the same month as a change and the hour within the day before
the switch hour were all treated as pre-switch (instead of counting
only days up to the switch as pre-switch).

Thanks to Jon Zeppieri for the repair and George Neuner for
the report.
2016-11-09 05:57:05 -08:00
Vincent St-Amour
e7a6573a20 Fix configure.ac for NetBSD.
From Aleksej Saushev.

C.f. http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/racket/patches/
2016-11-08 12:49:58 -06:00
Alexis King
393afa3759 Track the origin of modules produced by module+ forms
This ensures the 'origin property is propagated from macros that expand
to module+ forms.
2016-11-08 10:15:48 -08:00
Vincent St-Amour
81cd3622d3 Update docs to reflect xrepl being enable by default. 2016-11-08 08:58:21 -06:00
Matthew Flatt
0d4e2a3275 configure: add -Wno-nullability-completeness for xform output
Mac OS X header files for 10.12 include `_Nullable` and `_Nonnull`
annotations. When those appear in xform output, they're no longer
counted as being in system headers, and so nullability
completeness is enabled. Disable is explicitly when the flag is
supported.
2016-11-04 05:05:22 -06:00
Gustavo Massaccesi
5833390396 optimizer: extend the reductions like (equal? x y) => (eq? x y)
This kind of reductions were applied only when x or y was a constant.

Classify the relevant predicates in 4 categories. In particular,
if <expr> satisfy pred? we can use this classification to apply
the correct reduction:

(equal? <expr> y) ==> [no reduction, unless y has a different type]
(equal? <expr> y) ==> (eqv? <expr> y)
(equal? <expr> y) ==> (eq? <expr> y)
(equal? <expr> y) ==> (begin <expr> (pred? y))
2016-11-01 20:40:01 -03:00
Gustavo Massaccesi
7c1cb1a2f0 optimizer: add symbol?, keyword? and char? to the relevant predicates
Also, add a new primitive interned-char? that is hidden, but it's
useful to track in the optimizer the the chars? with a value < 256
that are interned because they are treated specially, and if they
are equal? then they are eq?.
2016-11-01 20:40:00 -03:00
Robby Findler
3760de1fa9 improve the error message in ->* 2016-11-01 17:50:31 -05:00
Robby Findler
2f53b436f9 small error message tweak 2016-11-01 11:58:58 -05:00
Andrew Kent
82204d1444 faster in-*-id-table (#1499) 2016-10-30 14:28:13 -04:00
Andrew Kent
2070db9c01 report locations in default error handler 2016-10-30 17:19:32 +01:00
Matthew Flatt
19bfe3e44d xform: another Apple divergence from normal C tokenization
Make xform work with

  __attribute__ ((availability(macosx, introduced = 10.12.1)))

where `10.12.1` is not a normal C token.
2016-10-30 12:19:42 +01:00
Georges Dupéron
df2b1dad45 Fixes #1497 free-id-table-ref! with procedure failure argument stores the procedure, not its result 2016-10-28 10:47:48 -05:00
Georges Dupéron
432afc4561 raco pkg new: include v6.5 and v6.6 and v6.7 in .travis.yml 2016-10-26 21:02:15 -05:00
Matthew Flatt
cb6af9664c fix expand + compile + write + read + module->namespace
... + prefix-in + relative-path module. All of those ingredients
(or some similar alternatives) are necessary to trigger a slow
way of saving module context for interaction evaluation where
a module-path index shift was getting lost.
2016-10-26 17:09:30 -06:00
Gustavo Massaccesi
f159295e55 optimizer: add boolean? to the list of relevant predicates
Previously the relevant predicates where disjoint, and until this commit
the only predicate that recognizes #f was `not`. So it's necessary to fix
two reductions to allow other predicates that recognize #f, like `boolean?`.

Add a hidden `true-object?` primitive that recognizes only #t, that is also
useful to calculate unions and complements with `boolean?` and `not`.

Also, extend a special case for expressions like
    (or (symbol? x) (something))
where the optimizer is confused by the temporal variable that saves the
result of `(symbol? x)`, and the final expression is equivalent to
    (let ([temp (symbol? x)])
      (if temp #t (something)))
This extension detects that the temporal variable is a `boolean?` and
reduces the expression to
    (if (symbol? x) #t (something))
2016-10-25 16:49:13 -03:00
Alexis King
2030c0b0ae Add a missing for-label require to the file/glob docs 2016-10-25 10:22:41 -07:00
Robby Findler
1b834d010a fix wrong name in docs 2016-10-23 22:54:46 -05:00
Craig Allen
b826b176d2 mistake in passing get-timestamp rather than sys-type to write-central-directory
It's worth noting that this hasn't caused me an issue, I came across it as I wanted to see what sys-type actually did. I couldn't say what the affect of this change would be and don't have a use case for it, it just looks wrong!
2016-10-23 11:25:17 -06:00
Matthew Flatt
4ce947da74 update pkg FAQ on the package build service's catalog 2016-10-23 10:43:02 -06:00
Matthew Flatt
c4d7e8bf1b improve ubsan support
Provide `--enable-ubsan` to simplify `-fsanitize=undefined` builds,
where alignment and floating-point divide-by-zero need to be
disabled to get useful results.

Also, repair undefined behavior exposed by the test suite. Most of the
repairs are avoiding `memset(..., NULL, 0)` --- which is an unhelpful
requirement, IMO. The other two repairs are worthwhile but unlikely to
have caused trouble.
2016-10-22 21:35:02 -06:00