Commit Graph

1077 Commits

Author SHA1 Message Date
Gustavo Massaccesi
65eaff3a03 Avoid compiler warnings 2016-02-02 19:06:31 -03:00
Matthew Flatt
4e7bb3071a OS X: support Unix-style install
Support "Unix-style" (as opposed to "in-place") installation for
OS X, which is mostly a matter of putting ".app" files in the
right place and correcting relative references.

Intended to fix #1180
2016-01-29 22:01:57 -07:00
Stephen Chang
86a9c2e493 fix return type of hash_table_index 2016-01-26 10:26:51 -05:00
Stephen Chang
e8d34dd156 add hash-iterate-pair and hash-iterate-key+value
- cuts in-hash and in-hash-pairs iteration time in half
- refactor hash_table_index
- add tests
- bump version

closes #1224
2016-01-26 10:14:40 -05:00
Matthew Flatt
9e69f341b3 fix unsafe-chaperone-procedure and ...-procedure* side channel
Also, clarify in docs that `unsafe-chaperone-procedure` cannot
really work with an argument created via `chaperone-procedure*`.
2016-01-24 21:45:21 -08: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
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
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
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
Robby Findler
579d50b2d8 add procedure-result-arity 2016-01-16 00:02:20 -06:00
Robby Findler
41c8d5bc27 add unsafe-{chaperone,impersonate}-procedure 2016-01-16 00:02:19 -06:00
Gustavo Massaccesi
be82c27db3 fix bug in shifting of types during inlining
During inlining, the type information gathered in
code that was inside the lambda is copied to the outer
context. But the coordinates of the type information
were shifted in the wrong direction, so the type was
assigned to the wrong variable.

This bug is difficult to trigger, so the test is convoluted.

Merge to v6.4
2016-01-13 23:59:17 -03:00
Matthew Butterick
0fb11e61e6 update copyright from 2015 to 2016 2016-01-13 19:40:35 -07:00
Matthew Flatt
052c7e4c06 pick better names for new module-expansion properties
In retrospect, 'module-body-outside-context wasn't a good
name for a property that turned out to hold only an
inside-edge scope.
2016-01-13 07:53:50 -07:00
Matthew Flatt
6ea9e963c4 add context properties to a module expansion
Add 'module-body-inside-context, 'module-body-outside-context, and
'module-body-context-simple? properties to the expansion of a
`module` form. These properties expose scopes that are used by
`module->namespace` and taht appear in marshaled bytecode.
2016-01-13 07:44:31 -07:00
Ryan Culpepper
c2e99efefc Post-release version for the v6.4 release 2016-01-09 11:31:31 -05:00
Matthew Flatt
034d2e9531 declare NSSupportsAutomaticGraphicsSwitching
Related to #1193
2016-01-09 06:12:46 -07:00
Matthew Flatt
3e5c889b7d adjust non-JIT application of chaperone with only properties
Don't push elements to the runstack that aren't popped back off. I
can't construct an example that demonstrates a problem, but fix it
just in case.
2016-01-09 06:09:36 -07:00
Matthew Flatt
7bae604711 fix default source catalog for make 2016-01-08 09:53:44 -07:00
Jay McCarthy
b078cbc0ef Add define-rename-transformer-parameter and friends 2016-01-08 11:03:33 -05:00
Matthew Flatt
c9348f7cd7 fix Mac OS X pre-built libssl install 2016-01-07 06:11:27 -07:00
Jay McCarthy
ccc50ca68f Forgot to update racket, just base 2016-01-06 17:42:56 -05:00
Matthew Flatt
273bc4ea49 use OS X native SSL when libssl is too old
OS X's libssl is deprecated, and it doesn't work with SSL connections
that need SNI. We'll distribute out own libssl builds for OS X via a
package, but we need a native implementation that works well enough to
get that package.
2016-01-06 11:55:43 -07:00
Matthew Flatt
92f1bfa4d2 openssl: add 'secure protocol shortcut
The 'secure protocol symbol is just a shorthand for
`(ssl-secure-client-context)`, but it helps highlight
that the default 'auto isn't secure, and having a plain
symbol smooths the connection to native Win32 and OS X
implementations of SSL.
2016-01-06 11:55:43 -07:00
Matthew Flatt
1e5da68b88 OS X: avoid getdtablesize() by switching frmo select() to poll()
The getdtablesize() result appears not to be constant on OS X.
Creating some combination of CFStream objects, threads, and CFRunLoop
objects can cause the value to be increased by a factor of 10. Avoid
the need for getdtablesize() by switching from select() to poll().
2016-01-06 07:34:18 -07:00
Matthew Flatt
8068c1e2a5 Revert "add source for "racket-playsound.exe""
This reverts commit e08188aeda.

New implementation of `play-sound` doesn't need it.
2016-01-05 20:36:33 -07:00
Matthew Flatt
25f8a5d0d9 Revert "adjust "racket-playsound.exe" return code"
This reverts commit 26560240f1.

New implementation of `play-sound` doesn't need it.
2016-01-05 20:36:33 -07:00
Matthew Flatt
fdf56dfebf fix calculation of unexported bindings
When a module defines <name-1> and doesn't export it, but when
the module imports <name-2> and re-exports that refers to another
module's definition of <name-1>, then <name-1> wasn't properly
registered as an unexported binding.

Most of the implementation change is just a clean-up of an
unnecessary traversal from before the addition of a `count`
field in each hash table.
2016-01-02 15:10:23 -07:00
Matthew Flatt
190925ee32 avoid a compiler warning 2016-01-02 07:46:42 -07:00
Matthew Flatt
fd7b8b29ea avoid compiler warning 2016-01-01 14:33:16 -07:00
Matthew Flatt
d3bb9d0412 fix bytecode-reading time-complexity bug
When a tree marshaled to bytecode form has many shared pieces,
the unmarshaling process can lose track of the sharing in one
place and traverse too much of the structure as pieces are
loaded.
2016-01-01 13:52:37 -07:00
Matthew Flatt
567679bf0a {impersonate,chaperone}-hash: add equal-key-proc wrapper
The optional `equal-key-proc` wrapper effectively interposes on calls
to `equal?` and `equal-hash-code` for hash-table keys.
2015-12-31 09:22:57 -07:00
Matthew Flatt
a516304f6b fix specialization over a nested lambda 2015-12-29 07:04:17 -06:00
Matthew Flatt
26560240f1 adjust "racket-playsound.exe" return code 2015-12-29 07:04:17 -06:00
Matthew Flatt
e08188aeda add source for "racket-playsound.exe" 2015-12-28 07:37:29 -06:00
Matthew Flatt
cefcbdf802 Windows: ensure 'kill subprocesses end with Racket
Use a job object to ensure that subprocesses that are meant
to be killed by the current custodian are reliably terminated
if Racket exits for any reason.
2015-12-28 07:37:29 -06:00
Matthew Flatt
afa01fa763 allow optimizations around procedure-specialize
Although `procedure-specialize` should be useful in places where
inlining does not apply, allowing inlining and related optimizations
through it, anyway.
2015-12-28 07:37:29 -06:00
Matthew Flatt
0840fcd6c8 JIT: avoid assertion failures due to a full buffer 2015-12-25 08:04:22 -06:00
Matthew Flatt
f0d09dbef1 make JIT recognize literal struct predicatates, etc.
Mka the closure specializer handle literal struct operations
(as opposed to just references to struct operations).
2015-12-25 07:14:40 -06:00
Matthew Flatt
843992d0c7 use specialization opportunity for #%apply-values 2015-12-24 12:17:31 -06:00
ven
c1950f1ae3 Fix small typo in jit.h
Just noticed it while reading db0a6de1d2
2015-12-24 10:11:56 +01:00
Matthew Flatt
ba2eb6487c restore precision for procedure-closure-contents-eq?
After adding `procedure-specialize`, making
`procedure-closure-contents-eq?` work as before involves
a little extra tracking. I'd prefer to weaken or
even get rid of `procedure-closure-contents-eq?`, but
this adjustment keeps some contract tests passing.
2015-12-23 22:06:18 -07:00
Matthew Flatt
44e1262648 unbreak no-JIT build 2015-12-23 21:51:14 -07:00
Matthew Flatt
db0a6de1d2 add procedure-specialize
The `procedure-specialize` function is the identity function, but it
provides a hint to the JIT to compile the body of a closure
specifically for the values in the closure (as opposed to compiling
the body generically for all closure instances).

This hint is useful to the contract system, where a predicate
is coerced to a projection with

 (lambda (p?)
   (procedure-specialize
    (lambda (v)
      (if (p? v)
          v
          ....))))

Specializing the projection to a given `p?` allows primitive
predicates to be JIT-inlined in the projection's body.
2015-12-23 17:46:56 -07:00
Matthew Flatt
592ae853e3 JIT: fast path for procedure impersonator w/o wrapper proc
Make the JIT-generated function-call dispatch recognize a call to
an impersonator that wraps a procedure only to hold properties.

This change also repairs handling for a arity-reducing wrapper
on a primitive, where the fast path incorrecty treated the
primitive as a JIT-generated function.
2015-12-22 15:05:14 -07:00
Matthew Flatt
b794404333 faster path for a procedure impersonator w/o wrapper proc
Make the call path faster when an impersontor is present
on a procedure only to add impersonator properties.
2015-12-22 15:04:53 -07:00
Matthew Flatt
e8073e699e restore a fast path for a procedure chaperone
When the representation of a redirect changed, the fast
path wasn't updated.
2015-12-22 15:04:53 -07:00
Matthew Flatt
c73bcceafe avoid a string pointer needed only for error reporting 2015-12-22 15:04:53 -07:00
Matthew Flatt
c01ced6e1d add syntax-transforming-with-lifts? 2015-12-22 08:02:44 -07:00
Matthew Flatt
0553f191d7 adjust PLT_INCREMENTAL_GC so it can disable generational GC
A value that starts "1", "y", or "Y" enabled incremental mode
permanently (any value was allowed formerly), while a value that
starts "0", "n", or "N" causes incremental-mode requests to be
ignored.
2015-12-20 08:58:21 -07:00
Matthew Flatt
3a99a19c56 reduce double major GCs
When a major GC triggers finalization, another major
GC is scheduled immediately on the grounds that the
finalizer may release other values. That was important
at once time, but the finalization and weak-reference
implementation has improved to the point where the
extra ful GC no longer seems necessary or useful.
2015-12-20 08:58:21 -07:00
Matthew Flatt
513849c1e3 incremental GC: make accounting incremental for the root custodian 2015-12-20 08:58:21 -07:00
Matthew Flatt
9711000b70 drop generation 1/2 except in incremental mode
Originally, generation 1/2 was intended to delay major
collections when the heap is especially large. It doesn't
seem to be effective in that case, and it can slow down
minor GCs, so continue to use it only in incremental
mode (where it helps significantly with fragmentation).
2015-12-20 08:58:21 -07:00
Matthew Flatt
6957780cd5 incremental GC: tune departure from incremental mode
At the completion of an incremental major GC, if incremental
mode wasn't requested recently, schedule an immediate major
GC to reduce the heap back to its normal footprint.
2015-12-20 08:58:21 -07:00
Matthew Flatt
7d2b538293 fix marshaling of a compiled top-level begin-for-syntax
Closes #1174
2015-12-19 09:37:32 -07:00
Matthew Flatt
2fad028fd5 fix incremental GC bug
Also, fix reporting of whether a minor GC was in incremental mode.
2015-12-19 09:37:32 -07:00
Matthew Flatt
d7184227e1 fix mutation of shared "self" module path index for submodules 2015-12-17 06:21:05 -07:00
Matthew Flatt
ca237910b3 fix make-syntax-delta-introducer with a #f argument
Closes PR 15202
2015-12-15 17:11:45 -07:00
Gustavo Massaccesi
6985150e0b Don't drop expressions with side effects in eq? reduction
The expression (eq? x y) is reduced to #f when the types of
x and y are known. Reduce this to (begin x y #f) when they
have side effects.
2015-12-15 00:25:00 -03:00
Matthew Flatt
f7c67f5c45 incremental GC: always use generation 1/2 in incremental mode
Also, make nursery 1/4 as big in incremental mode, and
correspondingly tune the amount of work to perform per
collection by 1/4 its old value. Using generation 1/2
reduces fragmentation that would otherwise be increase
by a smaller nursery.
2015-12-13 17:16:05 -07:00
Matthew Flatt
d01aec1b32 JIT: always use buffer padding of 200
The main intent of this change is to raise the buffer size
for ARM, but that would leave only 32-bit x86 at size 100, so
just make it size large for all machines.
2015-12-12 14:11:17 -07:00
Matthew Flatt
c6b8ba7c4a JIT: add missing checks for buffer space 2015-12-12 08:13:34 -07:00
Matthew Flatt
d66af86a58 JIT on ARM: add assertion to check long-jump mode
The same assertion is present already in Thumb mode, but
add it to non-Thumb mode.
2015-12-12 07:48:14 -07:00
Matthew Flatt
f5d5277ae7 fix binding table when shadowing imports 2015-12-10 04:56:14 -07:00
Matthew Flatt
b7dd829a6f bump version number 2015-12-09 21:06:55 -07:00
Matthew Flatt
2743ea06bb avoid paths in case-lambda names
Filter absolute path names for `case-lambda` in the same way as for
`lambda`.
2015-12-09 21:06:55 -07:00
Matthew Flatt
c0f4eb8287 inctemental GC: make finalization more incremental
Allow the process of discovering finalizers to be incremental,
including allow interruptions in later levels of ordered
finalization.
2015-12-08 07:53:03 -07:00
Matthew Flatt
6f106d9adc incremental GC: more precising counting of work done 2015-12-08 05:17:44 -07:00
Matthew Flatt
715bdbb49e incremental GC: avoid already-finished finalizaton work
Avoid extra work svaing finalization information and
re-chaining old-generation records for a major GC.
2015-12-06 12:36:52 -05:00
Matthew Flatt
e44926fcee increemntal GC: compact when a major GC is forced early
This change further defends against fragmentation when
incremental mode isn't working well.
2015-12-06 12:36:52 -05:00
Matthew Flatt
b5131321d7 force non-inremental GC if excessive fragmentation
Increemntal GC skips the old-generation compaction phase.
For most applications, that's ok, but it's possible for
fragmentation to get out of hand. Detect that situation
and fall back to non-incremental mode for one major GC.
2015-12-06 12:36:52 -05:00
Matthew Flatt
724dc2fdbf fix namespace-mapped-symbols forcing of lazy binding info 2015-12-02 13:14:28 -07:00
Sam Tobin-Hochstadt
a6eb00a41c Avoid warning for unused variable. 2015-12-02 10:01:01 -05:00
Matthew Flatt
d56e7309ad GC: fix yet another problem counting allocated bytes 2015-12-01 16:21:32 -07:00
Gustavo Massaccesi
b175241961 Flatten nested begin and begin0 forms
The nested begin/begin0 are flattened at read time, but some
optimizations may create new instances.
2015-12-01 13:50:16 -03:00
Matthew Flatt
7e949d5513 GC: skip memory accounting if demand goes away
Memory accounting is enabled on demand; if demand goes
away --- as approximated by no live custodians having
a limit or previously been queried for memory use ---
then stop accounting until demand resumes.
2015-12-01 08:14:38 -07:00
Matthew Flatt
bef34606cb incremental GC: fix handling of ephemerons
Fix the case that an old-generation finalizer ends up
on a modified page after all old-generation marking
is complete.

Also, make sure epehemerons are checked after previous
marking that may have left the stack empty.
2015-12-01 05:50:06 -07:00
Matthew Flatt
03302c3f30 repair an assertion in the GC 2015-12-01 05:50:06 -07:00
Matthew Flatt
8363144818 incremental GC: make finalization more incremental 2015-12-01 05:50:06 -07:00
Matthew Flatt
f30d8bd562 incremental GC: fix overcount of immobile objects 2015-12-01 05:50:06 -07:00
Matthew Flatt
d306ecdf3a incremental GC: fix accumulation of page-repair work
Too much work was being saved for the final step of a
major GC.
2015-12-01 05:50:06 -07:00
Matthew Flatt
e9c722cf22 re-tune incremental GC parameters
With immobile-object allocation repaired, smaller increments
work.
2015-12-01 05:50:06 -07:00
Matthew Flatt
7901962647 incremental GC: fix phantom-byte counting 2015-12-01 05:50:06 -07:00
Matthew Flatt
fa3cabd681 incremental GC: avoid allocating immobile on old-generation page
The allocation strategy for immobile objects avoids some fragmentation
in non-incremental mode, but it interferes with finishing up an
incremental major collection, so trade some fragmentation for
an earlier finish (which is far more likely to use less memory
instead of more, despite extra fragmentation).
2015-12-01 05:50:06 -07:00
Matthew Flatt
817fdad2d5 Windows with MinGW: Fix network address resolution
Use the same code as for MSVC compilation, which is as simple
as defining `HAVE_GETADDRINFO`.

Closes PR 15192
2015-11-29 17:31:47 -07:00
Vincent St-Amour
e7e75c2292 Fix exponentiation of negative single-floats and moderately large bignums. 2015-11-29 15:46:56 -06:00
Matthew Flatt
a389678556 improve interaction of incremental mode and finalization
Really, just improve when majors GCs are forced to trigger
further finalizations. This improvement makes `(collect-garbage)`
followed by `(collect-garbage 'incremental)` move more
reliably into incremental mode.
2015-11-28 15:54:45 -07:00
Matthew Flatt
9407afa0a2 faster GC traversal of shared closure prefixes 2015-11-28 11:21:19 -07:00
Matthew Flatt
89807d178e fix accounting of nursery for logging
The pre-GC count didn't include the obejcts allocated on
the most recent nursery page.
2015-11-28 10:36:12 -07:00
Matthew Flatt
c3ac1c6bf4 reduce incremental work on (collect-garbage 'minor)
When `(collect-garbage 'minor)` is combined with incremental
mode, do less incremental work. At the same time, don't
skip an incremental GC just because a major GC is ready.
2015-11-28 10:36:12 -07:00
Matthew Flatt
e968cfbde4 fix accounting of phantom bytes for incremental GC
Also fixes accounting when a phantom-bytes value is
treated as potentially having a backpointer.
2015-11-28 10:35:24 -07:00
Matthew Flatt
81e0636843 fix counting of interior-pointer-allowed objects
Words versus bytes.
2015-11-28 09:22:11 -07:00
Matthew Flatt
ca0e9b8b2f report timing of incremental step 2015-11-28 09:22:11 -07:00
Matthew Flatt
d37bfd45ae avoid unnecessary closure-fixup work in incremental mode 2015-11-28 09:22:11 -07:00
Matthew Flatt
46fe53fadb incremental GC: avoid extra traverals of weak-link lists
When incremental mode has already gone through weak boxes
and arrays, a major GC doesn't need to see them again.
2015-11-28 09:22:11 -07:00
Matthew Flatt
ad2dd24fb8 incremental GC: split "incremental" finalization to single step
Don't finalize after performing some marking work, since
finalization is in one chunk, so it's best to avoid combining
that delay with others.
2015-11-28 06:09:39 -07:00
Matthew Flatt
493eb1de7f tweak incremental-GC parameters
Based on experiments with a few programs.
2015-11-27 15:08:54 -07:00
Matthew Flatt
ba8103bbde add PLT_INCREMENTAL_GC
Although calling `(collect-garbage 'incremental)` in a program with
a periodic task is the best way to request incremental collection, it's
handy for some experiments to have an environment variable that turns
it on permanently.

This change also makes incremental-mode minor collections log as "mIn"
instead of "min", and it changes the first field of the logged
`gc-info` structure to be a mode symbol instead of a boolean.
2015-11-27 08:02:18 -07:00