Commit Graph

36017 Commits

Author SHA1 Message Date
Leif Andersen
34cfe48355 Add examples to make-require-transformer 2016-01-21 17:53:37 -05:00
Robby Findler
10c934aec0 restore the contract profile marks
commit bea67c0 dropped a bit too much of the contract wrapper
2016-01-21 06:57:42 -06:00
Leif Andersen
f7298cdb29 scheme_rename -> scheme_reload 2016-01-20 23:03:16 -05:00
Robby Findler
bea67c0a39 When we know that the procedure getting a contract is "simple enough",
drop the tail call fanciness

"simple enough", for now, means that it is a struct selector, predicate,
constructor, or mutator. Perhaps we will learn more about such simple
procedures where this is safe some other way.

This commit speeds up this program:

  #lang racket/base
  (require racket/contract/base)
  (struct s (x))
  (define f (contract (-> any/c integer?) s-x 'pos 'neg))
  (define an-s (s 1))
  (time
   (for ([x (in-range 10000000)])
     (f an-s)))

by about 1.9x
2016-01-20 21:38:32 -06:00
Robby Findler
126c090579 special case any/c when it appears syntactically in the argument to ->
Skip calling the domain projection in that case and, if all of the
arguments are any/c then also skip putting the contract continuation mark

This appears to give about a 20% speed up on this program:

  #lang racket/base
  (require racket/contract/base)
  (define f
    (contract
     (-> any/c integer?)
     (λ (x) 1)
     'pos 'neg))
  (time
   (for ([x (in-range 4000000)])
     (f 1)))
2016-01-20 21:08:15 -06:00
Alex Knauth
f130a5ea48 Link to reference from reader extensions guide 2016-01-20 20:36:52 -06:00
Adrien Tateno
4949eb3374 exn-message misspelled as exn-messgae 2016-01-20 16:51:29 -06:00
Vincent St-Amour
7c4aaa20a8 Document with-contract-continuation-mark. 2016-01-20 16:51:28 -06:00
Stephen Chang
fa96375742 fix in-vector segfault; document corner cases
closes #15227
2016-01-19 16:37:07 -05:00
Stephen Chang
0f39ee9b72 fix ni-range docs; add for tests 2016-01-19 14:22:02 -05:00
Stephen Chang
60845b2098 fix broken for tests in racket-test-core 2016-01-19 11:56:46 -05:00
Stephen Chang
8331e28c49 Merge pull request #1208 from stchang/fast-in-hash
add :do-in fast path for in-hash
2016-01-19 10:52:10 -05:00
Matthew Flatt
86f0d75a96 JIT: fix fast path for property-only chaperones
The recently added fast path for property-only chaperones did not
propagate the original object in the case that the property-only
chaperone wraps a `chaperone-procedure*` chaprerone.

Merge to v6.4
2016-01-19 06:51:25 -05:00
Vincent St-Amour
ad0f94c054 Additional test case from Robby. 2016-01-18 22:23:08 -06:00
Vincent St-Amour
4fd60fed11 Instrument id table contracts. 2016-01-18 22:23:07 -06:00
Vincent St-Amour
d5ae7125e5 Add instrumentation to sequence/c. 2016-01-18 22:23:07 -06:00
Vincent St-Amour
451ef1d37e Add instrumentation for tail-marks-match?. 2016-01-18 22:23:07 -06:00
Vincent St-Amour
b8af007d94 Instrument stream/c. 2016-01-18 22:23:07 -06:00
Vincent St-Amour
74c423bb24 Add instrumentation to set/c. 2016-01-18 22:23:06 -06:00
Vincent St-Amour
a48b559324 Instrument async-channel/c. 2016-01-18 22:23:06 -06:00
Vincent St-Amour
c726cf6ffc More instrumentation tests. 2016-01-18 22:23:06 -06:00
Vincent St-Amour
2f6f403ce8 Fix and improve ->i instrumentation. 2016-01-18 22:23:06 -06:00
Vincent St-Amour
d0c48de685 Add instrumentation to struct property contracts. 2016-01-18 22:23:06 -06:00
Vincent St-Amour
1661eeda18 Front-load some work in struct/dc instrumentation. 2016-01-18 22:23:05 -06:00
Vincent St-Amour
b00d7782ca Instrumentation for parametric->/c. 2016-01-18 22:23:05 -06:00
Vincent St-Amour
143267f1e9 Remove now-redundant instrumentation of vector contracts.
Now covered by instrumentation at contract entry points.
2016-01-18 22:23:05 -06:00
Vincent St-Amour
1277f0347a Instrumentation for object-contract. 2016-01-18 22:23:05 -06:00
Vincent St-Amour
e5738b8ee6 Add missing instrumentation to misc.rkt. 2016-01-18 22:23:04 -06:00
Vincent St-Amour
72418fba03 Instrument higher-order hash/c. 2016-01-18 22:23:04 -06:00
Vincent St-Amour
d34cd06b90 Tests for instrumentation of contract entry points. 2016-01-18 22:23:04 -06:00
Vincent St-Amour
f3f5d9212a Instrumentation at use site for provide/contract and flat contracts. 2016-01-18 22:23:04 -06:00
Vincent St-Amour
ecce6e1b85 Fix test names. 2016-01-18 22:23:03 -06:00
Vincent St-Amour
9b7724167a Add instrumentation for box contracts. 2016-01-18 22:23:03 -06:00
Vincent St-Amour
379a3dd110 Add instrumentation to contract system entry points.
To catch checking that does not happen inside chaperones.
2016-01-18 22:23:03 -06:00
Robby Findler
66d6de6394 avoid putting tail marks on when we know they are already there 2016-01-18 21:19:32 -06:00
Robby Findler
0104e753e7 fix incorrect contract profiler marks, introduced in 308c918a 2016-01-18 21:19:32 -06:00
Matthew Flatt
edd117d414 update HISTORY.txt for v6.4
Merge to v6.4
2016-01-17 16:37:20 -07:00
Matthew Flatt
1204aacd70 procedure-specialize: repair for literal syntax object
Fix `procedure-specialize` for a procedure that refers to a
syntax-object literal. A syntax-object literal becomes part of the
procedure closure, but in a special way that nomrally allows syntax
objects to be loaded on demand. For now, specialization counts as
a demand of the syntax object.

Merge to v6.4
2016-01-17 16:37:20 -07:00
Matthew Flatt
e0cc61d5af fix broken info use after JIT buffer overflow
After the JIT buffer becomes too full, some paths
don't bail out fast enough, so guard against
broken info in some relatively new uses of the info.

Merge to v6.4
2016-01-17 16:37:20 -07:00
Sam Tobin-Hochstadt
e133d87765 Handle rename transformers better in match expanders.
Closes PR 15223.

Merge to 6.4.
2016-01-17 10:48:07 -05:00
Matthew Flatt
ea172ae459 unsafe-{chaperone,impersonate}-procedure: fix name on bad arity
When a procedure created by `unsafe-{chaperone,impersonate}-procedure`
is given the wrong number of arguments, the original procedure's name
should be used in the error message.
2016-01-16 23:06:33 -07:00
Robby Findler
738529c7de fix a bug introduced in 35ce47d97 2016-01-16 12:37:58 -06:00
Matthew Flatt
f317f906d8 small repairs to docs on 'scribblings in "info.rkt"
Merge to v6.4
2016-01-16 08:20:36 -07:00
Matthew Flatt
0a266780fe unsafe-{impersonate,chaperone}-procedure: to racket/unsafe/ops
Move from racket/base, since the functions are unsafe.
2016-01-16 08:20:36 -07:00
Matthew Flatt
48de4101c2 sync version numbers 2016-01-16 07:04:06 -07:00
Matthew Flatt
cc4fd16ed5 avoid a srcloc from "kw.rkt" 2016-01-16 07:03:29 -07:00
Robby Findler
35ce47d97c use procedure-result-arity in racket/contract
This commit, combined with the use of unsafe-chaperone-procedure,
achieves almost the same speedups as c24ddb4a7, but now correctly.

More concretely, this program:

  #lang racket/base
  (module server racket/base
    (require racket/contract/base)
    (provide
     (contract-out
      [f (-> integer? integer?)]))
    (define (f x) x))
  (require 'server)
  (time
   (let ([f f]) ;;  <-- defeats the plus-one-arity optimiztion
     (for ([x (in-range 1000000)])
       (f 1) (f 2) (f 3) (f 4) (f 5))))

runs only about 40% slower than the version without the "(let ([f f])"
and this program

  #lang racket/base
  (module m racket/base
    (provide f)
    (define (f x) x))
  (module n typed/racket/base
    (require/typed
     (submod ".." m)
     [f (-> Integer Integer)])
    (time
     (for ([x (in-range 1000000)])
       (f 1) (f 2) (f 3) (f 4))))
  (require 'n)

runs about 2.8x faster than it did before that same set of changes.
2016-01-16 00:02:20 -06:00
Robby Findler
e3abc6f5c7 add a tail test 2016-01-16 00:02:20 -06:00
Robby Findler
579d50b2d8 add procedure-result-arity 2016-01-16 00:02:20 -06:00
Robby Findler
308c918a42 use unsafe-{chaperone,impersonate}-procedure in racket/contract
for contracts where the arity of the given function is exactly
the arity that the contract expects (i.e. no optional arguments
are turned into madatory or dropped)
2016-01-16 00:02:20 -06:00