Commit Graph

39327 Commits

Author SHA1 Message Date
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
shhyou
33b94e6558 Exercise application result in -> contract 2018-08-05 12:57:32 -05:00
Matthew Flatt
d8ea41df23 cs: fix malloc argument parsing
Closes #2207
2018-08-03 06:58:15 -06:00
Robby Findler
258160707f use slightly better language so it makes sense with the swapping that
the error messages do based on positive/negative

inspired by #2205
2018-08-02 13:34:22 -05:00
Alex Knauth
6cc3a2f960
fix typo, stream-empty? -> set-empty? (#2191)
* fix typo, stream-empty? -> set-empty?

* add a regression test for the set->stream fallback
2018-08-01 13:14:05 -04:00
Matthew Flatt
a0ca6d6489 doc correction
Corrects a missed update from moving text form Inside to Foreign.
2018-07-31 10:14:08 -06:00
Matthew Flatt
b7392a688e hash-iterate-value & co.: add an optional bad-index result
The new argument to `hash-iterate-value` and most other
`...-hash-iterate-...` functions determines a result to be returned in
place of raising a "bad index" exception.

For most kinds of hash tables, a "bad index" exception will only
happen when the provided index is wrong or when a hash table is
mutated during an iteration. Mutation during iteration is generally a
bad idea, but in the case of a weak hash table, a potential background
mutation by the garbage collector is difficult to suppress or ignore.
Adding an option to control bad-index behavior makes it easier to
write loops that defend against uncooperative tables, including loops
where a hash-table key disappears asynchronously.

Racket's printer was already using this functionality internally, so
the change to `hash-iterate-value` and company mostly exposes existing
functionality.

The `in-hash` form and related sequence constructors similarly support
a bad-index alternate value so iterations can handle that case
explicitly. They do not use the new bad-index support implicitly to
skip missing entries, because that idea does not play well with the
iteration API. A hash-table index can go bad after `in-hash` has
selected the index and determined that it should be used for the next
iteration, and a sequence can't take back that decision.
2018-07-31 10:14:07 -06:00
Matthew Flatt
5526113311 cs: fix some problems with hash tables
In part, the corrections rely on a new `hashtable-cells` procedure
in Chez Scheme.
2018-07-30 17:37:23 -06:00
Matthew Flatt
fcd84113c8 cs: fix impersonator-property accessor failure modes 2018-07-30 07:46:57 -06:00
Matthew Flatt
bb4e7df1c6 cs: fix case of vector-copy! 2018-07-30 07:34:36 -06:00
Matthew Flatt
810d6da3c8 cs: unbreak continuation-mark chaperones 2018-07-30 07:02:59 -06:00
Matthew Flatt
d9ec0705cf add ffi/unsafe/collect-callback
The `ffi/unsafe/collect-callback` library exposes functionality
formerly only available via Racket's C interface, but implement
it for both Racket and RacketCs.
2018-07-29 13:32:44 -06:00
Matthew Flatt
f8297f9c00 thread: fix resume of suspended sync 2018-07-29 09:59:12 -06:00