Commit Graph

39039 Commits

Author SHA1 Message Date
Matthew Flatt
9704cc4731 add syntax-binding-set functions
The `syntax-binding-set` functions enable explicit construction of
lexical information for a syntax objects.
2018-08-15 10:34:33 -06:00
Matthew Flatt
9658c723db more consistent expander/linklet performance-logging output 2018-08-15 07:41:48 -06:00
Matthew Flatt
f46721fe85 document procedure-reduce-keyword-arity-mask
Should have been part of ecbd6f1578.
2018-08-14 20:35:08 -06:00
Matthew Flatt
facba8a6ab unbreak cify on "startup.inc"
Commit 7cbeebbb89 broke the input to cify, and eb73837baf uncovered a
different problem.
2018-08-14 20:29:32 -06:00
Matthew Flatt
a25efeb8a9 thread & io: performance improvement
Part of this change restores a `++direct` that was lost in 98ae91e0ba
for "racket/src/thread" to make the atomicity state a virtual
register. Also make `display` on a byte string more directly call
`write-bytes`. That change restores a 5-10% speed improvement for
`racketcs -cl racket/base`.
2018-08-14 19:35:00 -06:00
Matthew Flatt
a58d115bf2 fix problem with parameter impersonator
Closes #2228
2018-08-14 12:27:33 -07:00
Matthew Flatt
bbde12991c cs: faster continuation trace
Reduce the cost of getting a source backtrace for a continuation mark
set (especially as recorded in an exception).
2018-08-14 06:59:51 -07:00
Matthew Flatt
eb73837baf expander: enable performance measurements permanently
Change the expander-performance macro so that it's a very low cost if
not enabled on startup. An extra JIT specialization reduces the cost
further, since the enabled state is known by JIT time.
2018-08-12 11:05:20 -06:00
Matthew Flatt
7cbeebbb89 linklet flattener: repair to name simplifier
The linklet flattener's name-simplification pass (intended to avoid
gratuitious changes in "startup.inc") didn't recognize all binding
forms.
2018-08-12 08:50:35 -06:00
Matthew Flatt
107d1e42a7 raco demod: fix module name in generated bytecode
Closes #2226
2018-08-11 18:25:55 -06:00
Matthew Flatt
4a7c4d184c optimizer: don't drop application when argument count is wrong
Guard some ad hoc optimizations with an arity check in the cases of 1
or 2 arguments.

Closes #2222
2018-08-11 17:28:11 -06:00
Matthew Flatt
305d02f46a OpenBSD: constrain W^X-by-signal to x86_64
Closes #2214
2018-08-11 16:40:09 -06:00
Matthew Flatt
89583a4d03 fix inexact->exact on subnormal single-flonums and extflonums
Closes #2223
2018-08-11 16:23:31 -06:00
Matthew Flatt
cf396064c3 places and GC: subtarct terminated place's memory use
When a child place terminates, the parent's count of the child's
memory use needs to be updated. Until this repair, the
`current-memory-use` function has been reporting an incorrectly large
number after a place terminates.
2018-08-11 09:50:49 -06:00
Ryan Culpepper
15186ff41c syntax/parse: fix struct match patterns with wrong number of subpatterns 2018-08-10 18:04:56 +02:00
Ryan Culpepper
31519f827a syntax/parse: fix fixup of and pattern with head subpatterns 2018-08-10 18:04:56 +02:00
Matthew Flatt
0d1f4e3c63 unbreak no-JIT build 2018-08-10 09:59:15 -06:00
Matthew Flatt
c05b9409d5 procedure-arity: fix bug in non-JIT mode
The arity calculation for a `case-lambda` as a `prop:procedure`
argument did not drop the self argument as it should.
2018-08-10 09:11:17 -06:00
Matthew Flatt
696e9143a6 expander: declare readtable structure as #:authentic 2018-08-10 09:10:55 -06:00
Matthew Flatt
b533a13d20 JIT code accounting: add count of procedures
Extends ac601a095b.
2018-08-10 05:06:36 -06:00
Matthew Flatt
59d505c157 JIT: tweak unsafe references
Use a constant offset directly instead of loading into a register
for unsafe vector, struct, etc., access.
2018-08-10 05:06:36 -06:00
Matthew Flatt
7efff33831 JIT: tweak to avoid register reload on some branches 2018-08-10 05:06:36 -06:00
Matthew Flatt
fac3c6fbc6 cify repairs
Fix liveness for "simple" arguments to inlined functions. Fix
handling of non-authrntic structure access and mutation to
allow the possibility of a GC.
2018-08-10 05:06:36 -06:00
Ryan Culpepper
3dd402937b syntax/parse: fix var:literal pattern, closes #2225 2018-08-10 00:09:07 +02:00
Alexis King
d1b8ecb3e0 Make curry properly support functions with keyword arguments
Also, while we're at it, make the functions produced by curry cooperate
better with other parts of Racket. Namely, make the information reported
by procedure-arity and procedure-keywords accurate, and give procedures
more useful dynamic names.
2018-08-09 15:35:49 -05:00
Matthew Flatt
ecbd6f1578 add procedure-arity-mask and procedure-reduce-arity-mask
The mask encoding of an arity is often easier to test and manipulate,
and masked-based functions are sometimes faster than functions that
used the old arity representation (while always being at least as
fast).

Attempting to assign an arity like `(expt 2 100)` to `(lambda x x)`
won't work anymore; it will raise an out-of-memory exception, because
the arity is represented internally as a mask. The arities that cannot
be represented aren't sensible arities, anyway.
2018-08-09 10:11:41 -06:00
Matthew Flatt
36204b00ca improve procedure-{reduce-arity,rename} performance
The main performance improvement is in calling a function returned by
`procedure-{reduce-arity,rename}` when the arity is not a single
integer. Calls to functions with > 29 arguments can be worse, but
that seems like a much rarer case.
2018-08-09 10:11:41 -06:00
Matthew Flatt
d3a8834f75 cs: improve procedure-{reduce-arity,rename} 2018-08-09 10:11:41 -06:00
Matthew Flatt
ac601a095b add PLT_EAGER_JIT to force JIT on linklet instantiation
Forcing JIT code generation through an environment variable is useful
to get a sense of how much machine code is generated for a program.
Setting `PLT_LINKLET_TIMES` causes the overall memory used by
JIT-generated code (including adminstrative overhead) to be printed on
exit.
2018-08-09 10:11:41 -06:00
Matthew Flatt
3e9196ab5c cs: convert Rumble though expander to boot file
Loading as a boot file saves time later on major GCs.
2018-08-09 10:11:41 -06:00
Matthew Flatt
f2a7405dda syntax/moddep: DAG repair and #:show argument 2018-08-09 10:11:40 -06:00
Ryan Culpepper
088f72c8c5 syntax/parse: parse syntax-class patterns just once; closes #2164
In pass 1, syntax class defns (without #:attributes decl) need to parse
patterns to determine exported attributes. But to allow forward refs,
stxclass references are not resolved until pass 2.

Previously, this was done by just reparsing patterns in pass 2. But that
means pattern expanders get expanded twice, and their expansions might
not agree (eg generate-temporaries). So instead, parse in pass 1, insert
"fixup" patterns to delay stxclass resolution, and resolve fixups in pass 2.
Complication: a fixup pattern is assumed S, but can change to H in pass 2.
2018-08-09 14:37:33 +02:00
Ryan Culpepper
dbfb1e2fe8 syntax/parse: add datum-to-expression helper 2018-08-09 14:37:33 +02:00
Ryan Culpepper
d950049c5a syntax/parse: trim internal provides 2018-08-09 14:37:33 +02:00
Ryan Culpepper
8a4bab5c3e minimatch: add match-lambda 2018-08-09 14:37:33 +02:00
Ryan Culpepper
34e7c8f556 syntax/parse: only collect attrs with interned names 2018-08-09 14:37:33 +02:00
Leif Andersen
7fc309c524
Add link from protect-out to protecting exports page. (#2221) 2018-08-08 16:08:16 -04:00
shhyou
b2829078ee Fix build[-*]-contract-property contract in docs 2018-08-08 12:51:14 -05:00
shhyou
0c8c643989 Fix default fallback for contract-struct-generate
The actual problem is that build-chaperone-contract-property
exported to the user defaults #:exercise and #:generate
to false. This commit changes the default fallback value
in the case where #:generate is not a procedure instead
of changing build-chaperone-contract-property directly
to stay consistent with the how contract-struct-exercise
currently does it.
2018-08-08 12:51:14 -05:00
shhyou
aeab2420fa Fix default contract generation and exercise proc
The default values updated in commit ffc5720b5 do
not work for very subtle reasons. In build-contract
in racket/contract/private/prop, the default values
should not accept an extra ctc argument since ctc
is already handled by make-flat-contract. The
default gen procedure should also be (λ (fuel) #f)
instead of (λ (ctc) (λ () #f)) since the latter
would generate false when the generation should
have failed. In build-property, the default procedure
(λ (ctc) (λ (fuel) #f)) is correct and should not
be changed to (λ (ctc) (λ () #f)).
2018-08-08 12:51:14 -05:00
Ben Greenman
59f49cb6ff
doc: index the character constants
add character constants (`#\newline`, etc.) to the index
2018-08-08 11:56:34 -04:00
shhyou
43b0cd4a7e Initialize fail-escape in contract-exercise
Some exercise procedure might invoke
contract-random-generate/choose, therefore
fail-escape needs to be initialized.
2018-08-07 10:06:28 -05:00
Matthew Flatt
5ba910d143 read-bytes!: avoid integer overflow in read size
Closes #2211
2018-08-06 20:43:04 -06:00
shuhung
b4e44e71a9 Export contract-random-generate-env? 2018-08-06 12:55:38 -05:00
Ben Greenman
aae08c48ee
doc: stx-trans.scrbl edits and examples (#2200)
- `local-expand` : replace ambiguous comma with an english word, to clarify
- `syntax-local-value` : replace '@emph{Unlike}` with `Unlike`, because the
   extra emphasis was overall distracting to me
- `syntax-local-value/immediate` : add example
- `syntax-local-introduce` : add example
- replace a few `and/c` with `syntax/c`
2018-08-05 23:54:29 -04:00
Ben Greenman
2ef8d60cc6
improve hash-ref error message for non-thunk failure procedure (#2204)
Improve the `hash-ref` error message when the failure result does not
accept zero arguments. (This only changes what the error messages says.)

Example:
```(hash-ref #hash() 'a add1)```

Old message:
```
; add1: arity mismatch;
;  the expected number of arguments does not match the given number
;   expected: 1
;   given: 0
```

New message:
```
; hash-ref: contract violation
;   expected: (-> any)
;   given: #<procedure:add1>
;   argument position: 3rd
```
2018-08-05 23:53:49 -04:00
Philip McGrath
3e6846a8d9 typo: "unintialized" -> "uninitialized" (#2209) 2018-08-05 23:53:21 -04:00
Matthias Felleisen
8deaa4cf91
fixing bad error message for assf
The old error message requested a function of 2 arguments while the quasi-contract demands one of 1 argument.
2018-08-05 17:48:17 -04:00
Matthew Flatt
582e85adf7 support Visual Studio 2017
Requires the Windows 8 SDK for now, I think.
2018-08-05 13:44:48 -07:00
Matthew Flatt
df67d4e9d1 expander: fix problem with define shadowing require
When a `define` that shadows a `require` appears before the `require`,
then the `require` may fail to other, non-shadowed bindings from the
same `require` spec.

Thanks to Matthias for reporting the problem.
2018-08-05 13:46:38 -06:00