Commit Graph

1037 Commits

Author SHA1 Message Date
Matthew Flatt
2916fc34cc SenoraGC: support allocation of executable memory; tune for performance
Allocation of executable memory is intended to make SELinux
happier by mmapping with PROT_EXEC instead of using mprotect()
to allow execution after the fact.

Performance improvements bring SGC within 30% of the Boehm GC on
`racketcgc -cl racket`, which makes SGC an even more plausible
substitute.
2014-08-12 05:14:14 +01:00
Matthew Flatt
2220452b72 racket/place: protect place-creation bindings
Closes PR 14677
2014-08-11 10:48:58 +01:00
Matthew Flatt
c4508ad0d9 avoid cross-namespace submodule pollution via module-code cache
When a module is loaded with submodules intact, it should not be
cached and used for a later load that is intended to obtain the
module without submodules. Avoid mismatches by constraining the
cache to modules without submodules.
2014-08-11 10:26:32 +01:00
Matthew Flatt
2bdb8c1de5 fix rename-transformer-target for chaperoned structs 2014-08-11 07:41:47 +01:00
Matthew Flatt
5ef75682d7 fix run-time error reporting for variables in a submodule
Error reports used the "source" field of a module, which
doesn't have submodule information, or the "name" field of
a module, which might not match an actual filename (".ss"
vs. ".rkt"). Create the right combination.
2014-08-11 07:41:43 +01:00
Matthew Flatt
f4c1d7ec03 racket/class: add missing check for #<unsafe-undefined>
When a superclass method is called before the superclass
is initialized, then all field accesses need to be guarded.

Robby found this one.
2014-08-06 08:46:51 +01:00
Matthew Flatt
fe12e93192 bump version 2014-08-05 16:23:10 +01:00
Matthew Flatt
926e64f5f1 fix "fixing letrec" pass
Adjust the compiler pass to insert checks for #<unsafe-undefined>.
The chanegs amount to throwing out the old attempt to follow the
implementation sketched in "Fixing Letrec", and instead use a
simpler abstract interpretation.
2014-08-05 16:22:31 +01:00
Matthew Flatt
ac428f89fa use-before-definition analysis: fix checking of with-cont-mark form
Similar to the `set!` problem.
2014-08-05 16:00:19 +01:00
Matthew Flatt
6efac46b3f letrec-check analysis: remove no-op part of implementation
The `deferred_uvars` list is constucted so that it always
has the same length as `uvars`.
2014-08-05 16:00:19 +01:00
Matthew Flatt
837a55f484 use-before-definition analysis: fix handling of let[*]
Bindings in `let` and `let*` need to be tracked much the same
way as for `letrec`, so that

 (letrec ([b (let ([d (lambda () c)])
               (d))]
          [c 1])
   b)

raises an exception.
2014-08-05 16:00:19 +01:00
Matthew Flatt
7d85bccaa2 use-before-definition analysis: fix checking of set! form
Treat the RHS of `set!` as escaping to an unknown context, so
that any variables it references are treated as unprotected.
2014-08-05 16:00:19 +01:00
Matthew Flatt
30d30ce74c win32: fix 32-bit get-seconds 2014-07-31 09:53:07 +01:00
Matthew Flatt
dc271e8347 racket/port: enable buffering for peeking-input-port 2014-07-30 11:49:04 +01:00
Matthew Flatt
9d17a35539 fix expand on a module containing lifts from expression
Another attempt at the bug that b95baa1d25 was intended to fix.
2014-07-30 10:33:52 +01:00
Matthew Flatt
b95baa1d25 fix expand on a module containing a #%declare form 2014-07-30 08:49:28 +01:00
Matthew Flatt
21f78ecd14 fix problem with (continuation-marks <thread>)
A thread can be swapped out while it's in transition between a
mandling of the mark-stack position and recovering from C-stack
overflow. Fix up that case.
2014-07-30 07:20:45 +01:00
Matthew Flatt
807b909e73 allow expand on cross-phase-persistent modules
Previoulsy, `expand` mode explicitly disallowed cross-phase declaration
in commit 2e652fc2b3. I'm not sure why, and that commit has no test
case that fails when the restriction is removed, so my best guess is
that it was a debugging strategy that I forgot to undo.
2014-07-30 06:30:44 +01:00
Robby Findler
7472058fd9 fix contract random generation for -> when the range is 'any' 2014-07-29 09:38:09 -05:00
Leif Andersen
027fb52c66 mz-gdbinit script gives type when using pso
The mz-gdbinit script (generated by mk-gdbinit.rkt) gives the type when using
pso, even when the default template did not include the type.

It defaults to printing out only the name of the type without additional
information.
2014-07-29 14:22:07 +01:00
Jan Dvořák
8bd5aa38b1 allow mixing exceptions with ffi/unsafe/alloc
Use call-as-atomic that can handle exceptions instead of dynamic-winding
start-atomic and end-atomic. Exceptions can be found in the functions's
result wrapper such as:

    (define-lib find-some-object
                (_fun (name : _string/utf-8)
                      (object : (_ptr o _some-object-pointer))
                      --> (result : _int)
                      --> (begin
                            (when (negative? result)
                              (error 'find-some-object "unknown name"))
                            object))
                #:wrap (allocator free-some-object))

Signed-off-by: Jan Dvořák <mordae@anilinux.org>
2014-07-29 14:16:26 +01:00
Matthew Flatt
41e7d346d1 adjust link-all to avoid conflicts 2014-07-29 10:48:33 +01:00
Matthew Flatt
04c36e2c09 adjust pack-all script to flush status messages 2014-07-29 10:48:32 +01:00
Matthew Flatt
d2a8bfcfe6 raco pkg update: don't claim conflict with package being updated
Merge to v6.1
2014-07-28 16:29:43 +01:00
Robby Findler
e082f9b183 adjust real-in implementation so that it prints as (real-in ...) instead
of (between/c ...)
2014-07-28 08:37:19 -05:00
Matthew Flatt
135ccf094e Windows: use native Win32 API for dates
Allows conversion of negative "seconds" to reach dates before
1970, and fixes year-varying DST tracking for versions of
Windows that know about those details.

As far as I can tell, we have to compute ourselves whether a
date is in daylight-saving time based on specifications of
when daylight and standard times start. That part seems tricky
and could use extra review.
2014-07-25 15:37:35 +01:00
Matthew Flatt
816d09bb24 macro expander: fix #%top via local-expand
Fix bug in b25a2b83ba that breaks the teaching languages.
2014-07-25 11:21:20 +01:00
Matthew Flatt
8f8e3b7c65 close hole in chaperone implementation
Problem, example, and solution from Sam; see the dev mailing-list post
on 24-JUL-2014.

When a chaperoned accessor, mutator, or property accessor is used to
chaperone a struct, the chaproning procedure must not be able to
see things that the chaproned accessor, mutator, or property accessor
would not allow.
2014-07-25 11:02:08 +01:00
Matthew Flatt
b25a2b83ba The implementation of #%top within a module has, for a while,
required that the identifier wrapped by `#%top` not have a local
binding. Change the documentation to match the implementation in that
way. (Since local binding in an identifier's lexical information
contributes to its identity as a top-level binding, that specification
of `#%top` would make sense everywhere, but I've left the top level
alone for backward compatibility.)

Also, change `local-expand` to never introduct `#%top`
wrappers. That's a little more consistent with what `#%top` has
evolved to mean, and it specifically works better with
`local-expand/capture-lifts`.

Closes PR 14635 and PR 14654
2014-07-25 09:07:46 +01:00
Matthew Flatt
ccda0e4abb macro expander: fix identifier-binding on fully expanded module
Fix the case of an identifier that is used as a binding in a module
but originated from a different module.
2014-07-25 07:21:06 +01:00
Asumu Takikawa
1bf54b06ee Revert label phase check, do correct thing
Thanks to Matthew for advice
2014-07-24 13:46:42 -04:00
Matthew Flatt
682c92554f net/http-client: don't send a 0-sized chunk that isn't a terminator 2014-07-24 16:40:34 +01:00
Scott Bell
29922c8a77 Send a final, empty chunk as required by RFC 2616 in http-conn-send! 2014-07-24 16:39:41 +01:00
Matthew Flatt
1809df456a regexp-match: tune chunking of UTF-8 decoding
A `string-split` on a big string with lots of small matches sends the
regexp matcher a big string many times. Decoding 1024 bytes each time
is too much. Decoding 32 bytes is be a better trade-off between
chunking for large matches and being lazy for small matches.

For example, on a 60MB string with a space every 15 characters or so,
splitting on a space is about 3 times as fast with this adjustment.

I tried a few chunk sizes, and 32 worked the best in my experiments.
Naturally, as more bytes are read, the chunk size ramps up, so it's
a question of initial size; larger matches are relatively insensitive to
the initial size (so, again, it makes little sense to cater to large
matches with a large initial decoding size of 1024 bytes).
2014-07-24 16:07:01 +01:00
Matthew Flatt
fffcf9f921 equal?: remove redundant eqv? test 2014-07-24 14:39:51 +01:00
Matthew Flatt
f0e710179c filesystem-change-evt: report inotify_init() error correctly 2014-07-24 14:12:17 +01:00
Matthew Flatt
c570a86201 streamline some paths for equality and hashing
Cuts about 1/3 of the time for a string-hashing microbenchmark
provided by Pedro Ramos:

 #lang racket
 (define alphabet "abcdefghijklmnopqrstuvwxyz")
 (define (random-word n)
   (build-string n (lambda (x) (string-ref alphabet (random 26)))))
 (define words (for/list ([k 1000000])
                 (random-word 3)))
 (define d (make-hash))
 (time (for ([w (in-list words)])
         (if (hash-has-key? d w)
             (hash-set! d w (add1 (hash-ref d w)))
             (hash-set! d w 1))))
2014-07-24 13:33:11 +01:00
Asumu Takikawa
ad677478ab Test for begin at label phase 2014-07-23 12:20:50 -04:00
Matthew Flatt
a95e279219 fix submodule export of enclosing module's binding
When `x` and `x`-with-a-mark are both defined, then the order of
definitions affected the binding that `(provide x)` would export
in a submodule that uses `#f` as its language. The problem was
in the implementation of the implicit `require`, which needs to
look up a variable's symbolic name in two different environments
to set up the right mapping.
2014-07-23 16:46:51 +01:00
Matthew Flatt
4c8084e5d8 quasisyntax: fix reporting for misused unsyntax[-splicing]
Closes PR 14652
2014-07-23 11:01:41 +01:00
Matthew Flatt
df5bfe19c0 sync: accept 0 arguments
As suggested by Jonathan Schuster.

Note that the `choice-evt` constructor already accepted 0 arguments.
2014-07-23 07:55:17 +01:00
Robby Findler
f9b20d3789 fix bug in ->i 2014-07-22 22:42:41 -05:00
Asumu Takikawa
041c2b1a07 Add flatten-all-begins to syntax/flatten-begin 2014-07-22 17:38:08 -04:00
Robby Findler
2a07425f26 renaming bug in file/convertible's contract 2014-07-18 23:32:24 -05:00
Robby Findler
5641ab84db add contracts to file/convertible 2014-07-18 20:59:09 -05:00
Robby Findler
4a996cce6b add context into the blame record for struct-type-property/c
and use the standard contract printer
2014-07-18 20:33:41 -05:00
Matthew Flatt
e8278176fa update racket/HISTORY.txt
Merge to v6.1
2014-07-18 07:55:50 +01:00
Matthew Flatt
7a5746d9a7 future: fix completion of a future that ends with a delayed tail call
The completion needs to be set up as an lightweight contination so
that it can be captured.

Merge to v6.1
2014-07-17 17:02:02 +01:00
Matthew Flatt
4541a75e76 future: fix slow path for inlined struct getter
Merge to v6.1
2014-07-17 17:02:01 +01:00
Matthew Flatt
76aefcb508 fix sleep timeout in scheduler
In the case that the current time equals exactly the timeout of
a `sync/timeout`, the Racket process could get stuck (using no CPU)
instead of continuing as it should.

How did we not find this before? Why am I suddenly able to replicate
the problem (i.e., hitting exactly the target timeout in the secheduler
at the millisecond granularity)?

Merge to v6.1
2014-07-17 07:53:55 +01:00