Commit Graph

1077 Commits

Author SHA1 Message Date
Matthew Flatt
a0576e0378 make the clean-up phase of a major GC incremental
Incremental GC now works well enough to be useful for some programs
(e.g., games). Memory accounting is still not incremental, so DrRacket
(and running programs in DrRacket) does not really support incremental
collection, although pause times can be much shorter in incremental
mode than by default.
2015-11-27 08:02:17 -07:00
Matthew Flatt
2486c7f4bc incremental GC: add finalization step
This step is semi-incremental, in that it can happen during
incremental collection, but all finalization is performed at once.
This will work well enoguh if the number of finalizers, weak boxes,
etc., will be small enough relative to the heap size.
2015-11-27 08:02:17 -07:00
Matthew Flatt
e24b73fbfd minor GC simplification 2015-11-27 08:02:17 -07:00
Vincent St-Amour
e9282d4f6e Fix expt of floats by large positive bignums.
Brings behavior in line with Gambit.

Closes GH #1148.
2015-11-25 17:46:36 -06:00
Matthew Flatt
8839f7b848 bump version number
Should have incremented it for "xform.rkt" change in f5dbd99e43.
2015-11-25 07:18:12 -07:00
Matthew Flatt
b443f3fe68 fix broken resize of place array
Change default array size from 32 to 4, so that the
resize path is used (and tested) on more typical
machines.
2015-11-24 09:20:44 -07:00
Matthew Flatt
5cb02282f5 fix round-to-even for exact->inexact on rationals
Thanks again to Robby
2015-11-22 18:09:11 -07:00
Matthew Flatt
ce7487182a fix too-early exact->inexact conversion in number parsing
Robby found this bug, continuing his streak that included
find the bugs behind commits f5dbd99e43 and 901ffdcbac.
2015-11-22 09:11:23 -07:00
Matthew Flatt
2a88662d01 exact->inexact fixup for MSVC
Casting a `uintptr_t` to `double` seems not to round to
nearest, so keep all bits while moving to `double` and
use arithmetic to combine them (since the rounding mode
is used correctly for arithmetic).
2015-11-22 08:33:44 -07:00
Matthew Flatt
901ffdcbac fix inexact-number parsing problem
Bug introduced in c40229f756.
2015-11-22 06:50:49 -07:00
Matthew Flatt
f5dbd99e43 fix precision in exact->inexact on bignums
The strategy of converting a bignum to a flonum by converting on word
boundaries can lose one bit of precision. (If the use of a word
boundary causes a single bit to get rounded away, but the first bit of
the next word is non-zero, then the rounding might have been down when
it should have been up.)

Avoid the problem by aligning relative to the high bit, instead.
2015-11-22 06:50:49 -07:00
Asumu Takikawa
92fc1f41c8 Add more hash-like operations to id-table
The operations are ref!, set*, set*!, update, and
update!. Also bumps version number.
2015-11-21 15:46:22 -05:00
Matthew Flatt
c40229f756 fix reading of extflonums, including with large exponents
Fix even basic readind when extflonums are not supported, but
also fix reading extflonums with large exponents (related to
the other recent changes to number parsing).
2015-11-21 10:55:14 -07:00
Matthew Flatt
9d2dd01689 more repairs of parsing inexact with large exponents
Fix the slow-path parsing of numbers in essentially the same
way as aff167b13d.

Closes #1140
2015-11-21 09:18:32 -07:00
Chris Jester-Young
aff167b13d Fix parsing of 0e401 on USE_EXPLICT_FP_FORM_CHECK platforms. 2015-11-21 08:27:46 -07:00
Matthew Flatt
8e46e46d40 add more support for continuation marks in procedure impersonators
Allow a more dynamic (than `impersonator-prop:application-mark`)
determination of continuation marks and associated values to wrap the
call of an impersonated procedure.
2015-11-20 10:20:02 -07:00
Jay McCarthy
69b8b2be35 Fix up prim count from merge mistake 2015-11-20 10:34:19 -05:00
Jay McCarthy
8c08d22197 update cstartup 2015-11-20 10:22:36 -05:00
Jay McCarthy
fff7bcfb03 initialize new params in read_escape_from_string 2015-11-20 10:17:59 -05:00
Jay McCarthy
ec713a22c3 Ensurce new parameters have false defaults everywhere 2015-11-20 10:17:59 -05:00
Jay McCarthy
bbf03997bb correct dot cancelling under readtable 2015-11-20 10:17:36 -05:00
Jay McCarthy
ce0aed77ea use readtable for detecting dot 2015-11-20 10:17:36 -05:00
Jay McCarthy
4451f44dda use readtable if available to look up whitespace 2015-11-20 10:17:36 -05:00
Jay McCarthy
35aa2c2398 first version of read_cdot 2015-11-20 10:17:36 -05:00
Jay McCarthy
23beaa4793 comments re mflatt 2015-11-20 10:17:08 -05:00
Jay McCarthy
c257d6dc64 tagged brackets and braces 2015-11-20 10:16:41 -05:00
Ryan Culpepper
912f1fe603 add macro-debugger event on expand opaque expression 2015-11-16 09:09:36 -05:00
Matthew Flatt
d3f2bd6dac fix broken abort handling related to module-registry lock 2015-11-15 16:46:07 -07:00
Matthew Flatt
0e16ce4bea add internal-definition-context-{binding-identifier,track}
When an internal-definition context is used with `local-expand`, the
any binding added to the context affect expansion, but the binding do
not appear in the expansion. As a result, Check Syntax was unable to
draw an arrow from the `s` use to its binding in

 (class object%
   (define-struct s ())
   s)

The general solution is to add the internal-definition context's
bindings to the expansion as a 'disappeared-bindings property. The new
`internal-definitionc-context-track` function does that using a new
`internal-definition-context-binding-identifier` primitive.
2015-11-15 06:17:22 -07:00
Matthew Flatt
8ec17deed1 avoid Linux stack correction on non-main thread 2015-11-13 14:54:05 -07:00
Matthew Flatt
fb1432e70e declare and document scheme_set_dll_path() for Windows embedding 2015-11-13 06:49:07 -07:00
Matthew Flatt
a053c78c30 fix re-export of shadowing binding
Mishandling of the `require`-binding table could cause
`racket/private/pre-base` to export `andmap` as syntax, for example,
instead of as a variable. The syntax-versus-variable distinction
doesn't usually matter, but it affects the order of exports in
bytecode form.
2015-11-12 14:24:44 -07:00
Matthew Flatt
2ed6c01e56 fix space-safety annotation for nested ifs
Closes PR 15176
2015-11-08 07:36:48 -07:00
Matthew Flatt
0beee9cd6a remove visit of available module in dynamic-require
Even though `dynamic-require` might lead to loading source, the
path into the compiler for that source will force compile-time code
as needed.

One benefit of ths change is that `racket -l pict3d` takes about half
as long, because `racket/gui` includes a `dynamic-require` to load a
platform-specific back-end, while `pict3d` can pull in a lot of
compile-time code to cooperate with Typed Racket.
2015-11-07 14:08:13 -07:00
Matthew Flatt
6655352789 guard against some cyclic lists in bytecode decoding
Closes #1098
2015-11-07 09:17:41 -07:00
Matthew Flatt
e94b07b3aa patch Pango to handle font-info failure
Getting NULL from CTFontCollectionCreateMatchingFontDescriptors()
might indicate a font installation problem; I'm not sure. In any case,
checking for NULL avoids a crash on at least one installation.
2015-11-07 08:19:50 -07:00
Matthew Flatt
4d9c5d8dd2 patch Cairo to avoid writing to a global constant
This bug is already fixed in the Cairo source repo, so we
can discard the patch on the next Cairo upgrade.

It's not clear which platforms are affected. On OS X, at least,
writing to a global constant can cause a crash.

Thanks to Spencer for making a small example that triggers the bug
(added to the "draw-test" package).
2015-11-06 16:01:36 -07:00
Sam Tobin-Hochstadt
b6939b0b2e Namespace scheme_boxmap_size now that it isn't static. 2015-11-06 14:25:41 -05:00
Juan Francisco Cantero Hurtado
5e2421b1a0 Doc: github.com/plt -> github.com/racket 2015-11-06 10:26:07 -06:00
Matthew Flatt
58c919c04e fix getting port name for reader errors
Closes #1121
2015-11-05 06:40:05 -07:00
Matthew Flatt
b54c03bb04 refine Cairo patch for CTFontCreatePathForGlyph
The CTFontCreatePathForGlyph() function can return NULL when
the glyph exists but has an empty path. Instead of treating that
as failure, which causes Cairo to generate a bitmap version of
the glyph, check that the glyph is mapped for bounding boxes,
and treat a NULL path as an empty path in that case.
2015-11-04 16:45:44 -07:00
Matthew Flatt
c5f4740b31 fix reader error for bad surrogate-style encodings 2015-11-04 14:03:48 -07:00
Matthew Flatt
5a8d2e4204 fix bugs in the reader, especially related to readtables
Closes #1118, but improved testing exposed many other bugs.
2015-11-04 08:51:03 -07:00
Vincent St-Amour
86f19474ca Have magnitude preserve single-precision-ness.
Found using random testing.
2015-11-03 18:43:27 -06:00
Matthew Flatt
37dc3ffa01 report error when --enable-extflonums fails
The `--enable-extflonums` option doesn't really do anything, since
extflonum support is enabled automtatically when the compiler's
configuration allows it. To make this slightly less confusing, report
an error when extflonums cannot be supported, despite
`--enable-extflonums`. The error is reported via compiling, instead of
via `configure`, but hopefully that's enough to be helpful.
2015-11-02 09:09:44 -07:00
Asumu Takikawa
14d25abd76 Add *-keys, *-values, in-* functions for id-tables
Bump version to 6.3.0.3 too
2015-11-01 02:50:12 -05:00
Matthew Flatt
101fac5c1e repair scope-propagtion cache yet again
Commit 352a5dd2d5 effectively reverted the repair
of d719c06e00.

Merge to v6.3
2015-10-30 22:24:40 -04:00
Matthew Flatt
352a5dd2d5 avoid thread swap in checking scope-propagation cache
Continuing with 2f25a1e2bd...

On further reflection, a GC is possible because a
thread swap is possible, and that's asking for trouble.
Disallow thread swaps (and, incidentally, GCs) whle
comparing scope propagations from the cache.

Merge to v6.3
2015-10-30 21:44:13 -04:00
Matthew Flatt
2f25a1e2bd fix GC-related issue with recent cache repair
Repairs a problem with d719c06e00.

A GC can happen while checking whether a cache entry matches,
in which case the cache is cleared, so don't check the cache
slot again after comparing.

Merge to v6.3
2015-10-30 21:31:57 -04:00
Matthew Flatt
d719c06e00 fix cache comparison of scope-propagation tables
Repairs 3eb2c20ad0, which used a scope-set comparison for
a table that maps scopes to propagation actions (add, remove,
or flip).

Closes #1113

Merge to v6.3
2015-10-30 21:01:46 -04:00
Matthew Flatt
bfb245553c fix some syntax-object traversals
Fix uses of `SCHEME_STX_VAL` that should be `scheme_stx_content`
to ensure propagation of scope changes.
2015-10-30 20:48:56 -04:00
Matthew Flatt
342198625e syntax-debug-info: handle non-identifiers correctly
In particular, fix the handling of binding information
when the context includes prefixing on import.

Closes PR 15173
2015-10-30 11:39:20 -04:00
Matthew Flatt
31b035cc94 fix submodule name used in error reporting 2015-10-30 08:47:23 -04:00
Matthew Flatt
6e21376473 fix relative-path handling for source locations in bytecode
Closes PR 15174
2015-10-29 21:09:52 -04:00
Matthew Flatt
685e74a1c6 fix debugging mode for checking runstack overflow 2015-10-29 21:09:52 -04:00
Sam Tobin-Hochstadt
60fb3e06b2 Improve set! error messages. 2015-10-29 19:33:15 -04:00
Sam Tobin-Hochstadt
1d3fe10d3d Ensure that the closure_map is big enough when deserializing.
Also document more invariants about the closure representation,
and avoid some code duplication.

Fixes #1108 (caught by fuzz testing).
2015-10-29 19:33:15 -04:00
Sam Tobin-Hochstadt
9d909d6834 Another validation check.
Fixes bug caught by fuzz testing.
2015-10-29 19:33:15 -04:00
Vincent St-Amour
c3aa266bee Flush the same port we write to. 2015-10-29 15:37:14 -05:00
Matthew Flatt
d17cc6039b repair syntax-local-lift-require to top level
In `syntax-local-lift-require`, avoid scope adjustments intended
to deal with `require` forms that are compiled in one namespace
and evaluated in another.
2015-10-28 21:14:10 -04:00
Matthew Flatt
3eb2c20ad0 avoid excessive memory use in or expansion
When `or` has many subexpressions, the expansion generates a
sequence of deeply nested `let`s, where original and macro-introduced
forms are interleaved in a way that defeats a minimal
child-is-same-as-parent sharing of scope sets. Add a small
cache that's good enough to capture extra sharing and
dramatically lower memory use for an `or` that has 1000
subexpressions.
2015-10-23 16:32:22 -06:00
Ryan Culpepper
a41c63be09 call SCHEME_EXPAND_OBSERVE_* only when in expand mode, not compile
Merge to 6.3.
2015-10-23 18:26:23 -04:00
Matthew Flatt
b98731ed00 Windows cross-build: MzCOM as a GUI executable
Merge to v6.3
2015-10-22 09:39:48 -06:00
Matthew Flatt
876708c100 fix tracking of shadowed module imports
When an import is shadowed by another import or by a definition, don't
include it in the set of bindings in the resut of
`syntax-local-module-required-identifiers` or in the set that can be
exported by `all-from-out`.

Merge to v6.3
2015-10-21 16:56:54 -06:00
Matthew Flatt
7b7a315777 fix taint-check ordering in expander
Merge to v6.3
2015-10-20 20:22:37 -06:00
Matthew Flatt
a38ba440fa add ".def" generation for MSVC build 2015-10-20 20:22:28 -06:00
Matthew Flatt
ea6cef5246 Windows: make scheme_register_tls_space() always available
To make the API consistent for MSVC versus MinGW builds, make
a functional formerly required for embedding on 32-bit Windows
always available and required for all Windows variants.
2015-10-20 20:22:22 -06:00
Matthew Flatt
0e924525ee MinGW build: put ".lib", ".exp", and ".obj" in the right place
Those files are compiler-specific, so they should be in a "gcc"
subdirectory instead of "msvc".
2015-10-20 20:22:11 -06:00
Matthew Flatt
5056e5fd1b provide ".def" file for the Racket DLL
A ".def" file is compiler-independent.
2015-10-20 20:22:05 -06:00
Matthew Flatt
b8ba78d1d3 avoid slow TLS with MinGW
Recent versions of MinGW-W64 use emutls for `__thread` variables,
and that's much slower than Windows-native TLS. Go back to the
inline-assembly implementation of therad-local access.
2015-10-20 20:21:58 -06:00
Matthew Flatt
5d74897aa4 always install static "mzconfig.h" for Windows 2015-10-20 20:21:53 -06:00
Matthew Flatt
dfab18fe47 configure: infer static linking of libwinpthread for MinGW
Merge to v6.3
2015-10-20 08:49:09 -06:00
Matthew Flatt
dad2804412 make MinGW build use the LIBS environment variable
Merge to v6.3
2015-10-19 20:23:00 -06:00
Matthew Flatt
7cffdca067 work around an access() problem on Mac OS X
... again.

Merge to v6.3
2015-10-19 17:48:53 -06:00
Matthew Flatt
836316f5ed fix TEST_ALTERNATE_TARGET_REGISTER build
Merge to v6.3
2015-10-19 17:48:53 -06:00
Matthew Flatt
04e546716e fix typo
Thanks to Jack Firth.
2015-10-19 08:09:23 -06:00
Juan Francisco Cantero Hurtado
e957a7d655 Add config for linux/ppc64. 2015-10-19 07:55:30 -06:00
Matthew Flatt
e803a3c15e unbreak no-places, no-futures build 2015-10-17 07:00:37 -06:00
Matthew Flatt
c50c23c134 GC: toward incremental collection
Make the old-generation marking process incremental
on request, where `(collect-garbage 'incremental)`
makes a request.

Only the marking phase of an old-generation collection
is incremental, so far. In exchange for slower
minor collections and a larger heap, you get a major
collection pause time that is roughly halved. So, this
is a step forward, but not good enough for most purposes
that need incremental collection.

An incremental-mode request sticks until the next
major GC. The idea is that any program that could
benefit from incremental collection will have
some sort of periodic task where it can naturally
request incremental mode. (In particular, that
request belongs in the program, not in some external
flag to the runtime system.) Otherwise, the
system should revert to non-incremental mode, given
that incremental mode is slower overall and can
use much more memory --- usually within a factor of
two, but the factor can be much worse due to
fragmentation.
2015-10-16 21:08:23 -06:00
Matthew Flatt
7db0c3b1d4 avoid changing mark bits for old objects
For a minor GC and pages that contain backpointers,
leave mark bits as they are; instead make a pass to
shift mark bits for new objects to "dead" bits, and
use dead bits for fixup.

This change is intended as a small step toward incremental
collection.
2015-10-16 18:10:30 -06:00
Ryan Culpepper
d47b96970c make Windows build work on case-sensitive filesystems 2015-10-16 17:18:34 -04:00
Matthew Flatt
6199f9a596 GC: use generation 1/2 consistently within a collection
The rule for using generation 1/2is based on the current
memory use versus the maximum size of generation 0. Recent
changes to the GC have caused that size to vary during
a collection, which means that the choice to use generation
1/2 or not can change within a collection.

Partial use of generation 1/2 doesn't inherently cause problems, but
it can cause a generation-1 object to point to a generation-1/2 object
even though the former was allocated after the latter. That's a
problem on if getting generations out of order relative to allocation
order can create problems. As it happens, reset_finalizer_tree()
checks the generation of the finalization record and not the finalized
pointer, because the record is always allocated after the pointer.

Merge to v6.3
2015-10-15 16:02:36 -06:00
Sam Tobin-Hochstadt
a4d292b21a Use an unsigned type for sizes.
Fixes this crash http://drdr.racket-lang.org/32121/pkgs/racket-test/tests/racket/stress/fuzz.rkt
found by fuzz testing.
2015-10-14 15:27:13 -04:00
Sam Tobin-Hochstadt
f400dab912 Add a check in the compilation-top reader.
This bug was found by fuzz testing.
2015-10-13 17:50:04 -04:00
Matthew Flatt
20f31fb742 set a bit to prevent corruption of flags via hashing
Certain datatypes in the runtime system are not supposed
to be hashed, where bits normally reserved for hash codes
are used for other purposes. A bad bytecode file can cause
some of those to be hashed, anyway. Normally, the damage is
isolated to that content of the damaged bytecode, but
certain variable-reference bytecode forms are both shared
and non-hashable. Set a bit that ensures hashing will not
change flags in the shared object.

This problem was exposed by fuzz testing.
2015-10-12 19:27:13 -06:00
Ryan Culpepper
a6835422bf Post-release version for the v6.3 release 2015-10-09 15:23:31 -04:00
Matthew Flatt
aa7c3ac38b use libtool install -s to install libraries
Use `install -s` instead of `strip -S` when building shared libraries
via libtool.
2015-10-08 19:02:47 -06:00
Matthew Flatt
7555d022db for CPP, detect __linux__, etc., instead of linux, etc.
When a compiler is run in standards mode, predefined macros that
do not start with "_" are dropped, so use the "_" versions
consistently. Whether or not Racket itself would compile in
standards mode, the Racket headers should be able to work that
way --- at least on Unix platforms.
2015-10-08 10:53:23 -06:00
Matthew Flatt
85c1ba55f3 fix native-stacktrace interaction with thread start
Repairs 4d3852ae69.
2015-10-06 19:11:28 -06:00
Matthew Flatt
4d3852ae69 add indirection on thread start to avoid ObjC exception issues
In Mac OS X 10.11, something about the use of exceptions triggers
a libunwind stack traversal, and that traversal runs into trouble
with Racket's stack mangling for threads. Inserting generated code
in the stack frame sequence causes libunwind to give up and avoids
a crash (e.g., with `-j -l drracket` on startup).
2015-10-06 09:32:58 -06:00
Matthew Flatt
3bcd153fb6 adjust copyright dates: 2014 -> 2015
Better late than never?
2015-10-05 13:39:11 -06:00
Gustavo Massaccesi
09a2b630bc Generalize inferred names
After some expansions, a expression with the syntax property 'inferred-name of
'x is converted to one with ('x . 'x), so it's not useful to get the name of a
procedure. So we simplify the syntax property 'inferred-name to handle
these cases.
2015-10-05 10:25:57 -06:00
Matthew Flatt
b92eac82ab patch Pango to make the system control font accessible
The patch doesn't directly make the font accessible, but
it provides a hook so that the font can be made accessible.
2015-10-04 20:30:17 -06:00
Matthew Flatt
2c7663eb5e remove accidentally committed explicit GC
I even marked it "REMOVEME", but didn't look at the commit
closely enough before pushing.
2015-10-02 12:50:08 -06:00
Matthew Flatt
93d9826936 fix another problem with GC and place messages
When a place message is deserialized by simply adopting the page
containing the message, the adoption can trigger a garbage
collection, but there's still a pointer to a chain of objects
"in flight" in the thread, and a GC can discard the pairs that
form the chain.
2015-10-02 11:48:25 -06:00
Matthew Flatt
ed07a5e176 fixup 2015-10-02 05:50:06 -06:00
Matthew Flatt
7671c15b17 more GC callback shapes to support Mac OS X 10.11 2015-10-01 21:23:25 -06:00
Matthew Flatt
7abe38e763 adjust namespace-relative treatment of compiled require
Removing all original module context doesn't work, because it
doesn't distinguish between fragments of syntax that had the
"inside-edge" scope without the "outside-edge" scope.

Record the presence of the outside-edge scope by using the
root scope, and convert the root scope to the current namespace's
outside-edge scope on evaluation.
2015-09-30 11:32:16 -06:00
Matthew Flatt
6e80609998 macro expander: fix over-eager pruning of use-site scopes
The bug could cause

 #lang racket/base

 (define x 'outer)

 (define-syntax-rule (def-and-use-m given-x)
    (begin
      (define-syntax-rule (m)
        (let ()
          (define given-x 'inner)
          x))
      (m)))

 (def-and-use-m x)

to produce 'inner when it should produce 'outer.

Thanks to Brian Mastenbrook for pointing the problem and
providing examples.
2015-09-30 08:39:03 -06:00
Matthew Flatt
31549082e6 avoid crash when interrupting bytecode unmarshal
Interrupting bytecode unmarshal for syntax objects could leave
half-constructed values in a table that is intended to resolve graph
structure. Clear out work towards a graph construction when
interrupted.

The most common symptom of half-constructed syntax objects was a crash
after a Ctl-C during startup.
2015-09-28 14:38:12 -05:00
Sam Tobin-Hochstadt
57b4920234 Check that serialized procedures are the right kind of procedures.
Fixes http://drdr.racket-lang.org/31801/pkgs/racket-test/tests/racket/stress/fuzz.rkt
2015-09-23 15:49:18 -04:00
Sam Tobin-Hochstadt
d6ad89764b Add a few more pair checks. 2015-09-23 15:49:18 -04:00
Sam Tobin-Hochstadt
083029fa6f Add pair check in unmarshalling.
Closes #1070.
2015-09-23 15:49:18 -04:00
Matthew Flatt
aaf098f203 fix potential GC problem while setting up a place channel 2015-09-22 16:45:47 -06:00
Matthew Flatt
003bca503f avoid compiler warnings 2015-09-20 21:13:27 -06:00
Matthew Flatt
93efe503ad fix misuse of comparison macro 2015-09-20 21:13:27 -06:00
Matthew Flatt
1d5b34f48b auto-detect when strip -S works for archives
Otherwise, don't try to strip archives such as "libracket3m.a".
2015-09-20 21:13:17 -06:00
Matthew Flatt
b37c07a280 Windows: generate "lib/msvc" content from cross-compile 2015-09-20 19:54:42 -06:00
Matthew Flatt
15797a7951 Windows: use same TLS strategy for both VC and MinGW in 64-bit mode 2015-09-20 19:17:15 -06:00
Matthew Flatt
8d43c73a0c windows: use same scheme_setjmp() protocol with all compilers 2015-09-20 18:13:59 -06:00
Matthew Flatt
6dfc20d3ec fix inferred-name propagation for internal-definition contexts
Set the name while checking for an immediate expansion when
no other forms follow.
2015-09-19 19:27:13 -06:00
Matthew Flatt
bcc65ac92e GC: separate old-generation finalizers from now ones
Avoiding a traversals of old-generation finalizers can
save a couple of milliseconds for a minor GC in DrRacket.
2015-09-19 16:49:58 -06:00
Matthew Flatt
7ff1cf3619 avoid traversal of full page table when restoring mprotects
Overlooked this traversal at 50df879e79.
2015-09-19 15:16:30 -06:00
Matthew Flatt
584920b3a6 GC: clarify page field overloadings
Rename fields in a page record and split some of them with `union` to
better document the intent of each field.

This change is intended to have no effect on the GC's behavior. One
tricky case is the line dropped around line 3542 of "newgc.c". That
line reset `scan_boundary` (formerly `previous_size`), which on the
surface is inconsistent with leving objects before the boundary
without `marked` bits set. However, that line is reachable only
when geneation-1 objects are being marked (objects newly moved
there would not be unmarked), in which case `san_boundary` should
already be reset.
2015-09-19 14:06:26 -06:00
Matthew Flatt
9768f632a2 Disable static-library install for Windows or Mac OS X
Also, OS X `strip` needs `-S` for archives, in case a static-library
install is enabled.
2015-09-19 09:05:45 -06:00
Matthew Flatt
a75bdbf0a1 remove unused variable 2015-09-19 08:52:19 -06:00
Matthew Flatt
ee9d797906 fix file descriptor handling for poll() without epoll()
This problem could cause busy-waiting after a network connection
on Android, for example.
2015-09-19 08:16:30 -06:00
Matthew Flatt
fccd86d67d configure: --enable-racket=auto to simplify cross-compilation
Using `--enable-racket=auto` causes a Racket for the current platform
to be built in a "local" subdirectory of the build directory as
support for cross-compilation.
2015-09-18 21:56:20 -06:00
Matthew Flatt
a88d52bd34 configure: make --enable-libs on by default 2015-09-18 21:06:00 -06:00
Matthew Flatt
a9015e5484 GC: remove unmaintained counters 2015-09-18 12:40:14 -06:00
Matthew Flatt
40f9467c07 count phantom bytes as regular allocation
The original idea was to count phantom bytes as "administrative
overhead", but issues discussed in #962 identified problems
with that idea. Finish shifting the accounting to treat
phantom bytes as payload allocation.
2015-09-18 12:26:32 -06:00
Matthew Flatt
0b9cda5018 avoid undefined behavior in hashing inexacts
Casting a negative floating-point number to an unsigned integer
is not ok. Corece to a signed integer, first.

Thanks to John Regehr for help.
2015-09-18 09:49:04 -06:00
Juan Francisco Cantero Hurtado
b7bcd4f687 Remove extra ')'.
Found by cppcheck.
2015-09-17 14:12:15 -06:00
Juan Francisco Cantero Hurtado
38661481ed Missing ')' in bool.c
Found by cppcheck.
2015-09-17 14:12:15 -06:00
Matthew Flatt
bcfd19c902 GC: don't double-count phantom bytes 2015-09-15 19:41:17 -06:00
Matthew Flatt
0e35b5cfad fix misplaced flag
The misplacement of `SCHEME_PRIM_SOMETIMES_INLINED` caused the
optimizer to produce different results when the JIT is statically
disabled, for example.
2015-09-15 15:16:11 -06:00
Matthew Flatt
166d6fd8a3 GC: fix block_cache assumptions
Correct a mismatch for an internal API.
2015-09-15 15:16:11 -06:00
Matthew Flatt
2616b06570 fix problems with block-cache chunked mprotects
The problems don't show up with the current use of the block
cache, but repair mprotect tracking in case it matters in
the future.
2015-09-15 15:16:11 -06:00
Matthew Flatt
68f8d63222 fix problem with traversing closures for GC
This bug is an old one, in a sense, because travesing fields
in a closure could have moved the prefix with earlier versions
of the collector. It shows up now because we're changing fields
one indirection closer.
2015-09-15 15:16:11 -06:00
Matthew Flatt
0781d0fa46 GC: refine decision for old-generation compaction
Compact fewer blocks by moving them only when other
blocks have room.

Also, fix block protection tracking in the case of a page
count that isn't divisible by 8.
2015-09-15 15:16:11 -06:00
Matthew Flatt
3d69846046 GC: fuse mark and fixup passes, usually
In the common case of a minor GC without a generation 1/2
or a major GC without compaction, a single pass suffices
to both mark and update references.

This change reduces overall GC time by 10%-25% on typical
programs.
2015-09-15 15:16:11 -06:00
Matthew Flatt
28047789a9 remove "array of tagged" GC support
The GC supported allocation for an array of objects where
the first one provides a tag, but at this point it was
used only in some corners. Change those corner and simplify
the GC by removing support for arrays of tagged objects.

The main corner to clean up is in the handling of a macro-expansion
observer and inferred names. Move those into the compile-time
environment. It's possible that name inference has been
broken by the changes, but in addition to passing the tests,
the generated bytecode for the base collections is exactly the
same as before the change.
2015-09-15 15:16:10 -06:00
Matthew Flatt
bcd3d814fd GC: chunk mrpotect calls on old-page allocation
Although a block cache is set up to group most page-protection changes
into a single OS call, allocating new old-generation pages was not
covered. Adjust the block cache to group those.

This change has a small effect on performance, but it seems
better to have a few system calls in place of thousands.
2015-09-15 15:16:10 -06:00
Matthew Flatt
ab2aaff6be optimizer: fix let-values splitting and allocation reordering
First bug:

When the optimize converts

 (let-values ([(X ...) (values M ...)])
   ....)

to

 (let ([X M] ...)
   ....)

it incorrectly attached a virtual timestamp to each "[X M]" binding
that corresponds to the timestamp after the whole `(values M ...)`.

The solution is to approximate tracking the timestamp for invidual
expressions.

Second bug:

The compiler could reorder a continuation-capturing expression past
an allocation.

The solution is to track allocations with a new virtual clock.
2015-09-13 12:32:08 -06:00
Matthew Flatt
5ae7e54dac {eval,compile,expand}-syntax: install top-level fallback less often
Make `eval-syntax`, `compile-syntax`, and `expand-syntax` more
consistent (with intent and each other) by not installing a fallback
automatically. In particular, a fallback is not installed for a
`module` form, so that different ways of expanding a `module` form
produce consistent results (e.g., for ambiguous bindings).
2015-09-12 16:24:52 -06:00
Gustavo Massaccesi
58895067c8 Remove nested begin0's added by sfs pass 2015-09-11 22:38:05 -03:00
Sam Tobin-Hochstadt
17d69338a9 Remove obselete time config defines.
Removes `USE_FTIME`, `USE_PALMTIME`, `USE_MACTIME`, `TIME_SYNTAX`.
2015-09-11 20:30:14 -04:00
Matthew Flatt
81ee1b39c7 change the (relatively new) argument to collect-garbage
Make the argument a symbol, 'major or 'minor, instead
of a boolean, because that allows further extension.
2015-09-11 12:07:35 -06:00
Matthew Flatt
c416db91c1 Fix shared-space marked-page chaining
Fixes a problem with a4910716e4, and adjusts place-specific
major GCs to use the already constructed chain instead
of reconstructing it.
2015-09-11 12:07:35 -06:00
Matthew Flatt
50df879e79 GC: adjust cleanup phase to not touch irrelevant page records
Fixes the last place where a minor collection touched a record
per allocated page.
2015-09-11 12:07:35 -06:00
Matthew Flatt
15271b673d GC: adjust fixup phase to not touch irrelevant page records
This is another step toward making a minor collections independent
of total allocation.
2015-09-11 12:07:34 -06:00
Matthew Flatt
58cc3e91c3 fix 32-bit Windows build for MSVC 2012 and up 2015-09-10 06:19:29 -06:00
Matthew Flatt
e318257a7f support Visual Studio 2015
Closes #996
2015-09-09 13:34:31 -06:00
Matthew Flatt
c492f763c7 Visual Studio projects: put <PlatformToolset> in more places
Putting <PlatformToolset> in the new places makes the projects
work when more than one version of Visual Studio is installed.

Maybe the old place was always the wrong place, or maybe
VS 2010 wanted it in the old place. Either way, sprinkling
the version in more places seems unlikely to hurt.
2015-09-09 13:34:07 -06:00
Asumu Takikawa
c160302be7 Bump version number for rename transformer change
Refers to commit 33bb5e9060
2015-09-09 11:37:59 -04:00
Matthew Flatt
707f888c83 make base: more complete avoidance of user-specific state
User-scope package installation matching the version of
Racket being built could affect the collections visible
during `raco setup` for `make base`. In particular, the
presence of `setup/scribble` could cause all built docs
to be discarded.

Also, add the `--no-user-path` flag to `racket` (which
has long been documented as an alias for `-U`).
2015-09-09 06:24:35 -06:00
Matthew Flatt
261b7bde28 set-phantom-bytes!: fix tracking across generations 2015-09-08 15:29:09 -06:00
Asumu Takikawa
33bb5e9060 Make prop:rename-transformer accept a procedure
Allows the choice of target identifier to be delayed
until expansion time, rather than fixed at the point of
the transformer definition.
2015-09-08 13:29:13 -04:00
Matthew Flatt
8394936ee0 collapse copied code in GC 2015-09-08 07:39:48 -06:00
Matthew Flatt
37c4ea4720 GC: adjust backpointer marking to not touch other page records
Also, free medium pages for a terminated place.
2015-09-08 07:39:48 -06:00
Matthew Flatt
9372862ee2 GC: move minor work to clean-up phase instead of setup 2015-09-08 07:39:48 -06:00
Matthew Flatt
7eee429705 avoid traversing table of JITted code names on every GC
The table as a tree is traversed to prune empty branches,
but the travseral is needed only toward branches that
have changed. Skipping the traversal can save several
milliseconds on each collection.
2015-09-08 07:39:48 -06:00
Matthew Flatt
c401d86bb3 streamline name handling in make-struct-type
Name handling formerly interned symbols along the
way to allocating a plain string, which takes effort
and causes changes to the symbol table, which forces
a minor GC to traverse the whole symbol table. Skip
unnecessary symbol-interning steps.
2015-09-08 07:39:48 -06:00
Matthew Flatt
0ab94dd3e4 force GC more appropriately on phantom bytes
When the number of bytes recorded via phantom bytes approaches memory
use at the last GC, force a garbage collection.
2015-09-08 07:39:48 -06:00
Gustavo Massaccesi
27791ebab7 Remove ignored call/cc
Reduce (call/cc (lambda (<ignored>) body ...)) to (begin body ...)
2015-09-08 09:13:44 -03:00
Matthew Flatt
5ca752c92b fix problems with internal calls to syntax-track-origin 2015-09-07 08:22:21 -06:00
Matthew Flatt
4cb74da76c add patch for Mac OS X build of Cairo
Pull in a patch to avoid CGFontGetGlyphPath, which is deprecated.
2015-09-06 17:18:35 -06:00
Matthew Flatt
8566c67b35 make syntax-object unmarshaling more accepting
Defend against certain bad encodings, but accept an encoding
that includes more sharing than the built-in marshaling
could create.
2015-09-06 16:37:31 -06:00
Matthew Flatt
079f46fbc1 adjust top-level handling for identifiers without #%top
Refine the changes in 16c198805b so that `(define id ... id ... )` at
the top level compiles more consistently when `id` is an identifier
whose lexical context does not include `#%top`.
2015-09-06 08:06:07 -06:00
Matthew Flatt
c3f876d2f7 fix bug in mashaling paths
The change in commit fb8e08a2ac could lose part of a relative path.
2015-09-05 14:09:38 -06:00
Matthew Flatt
16c198805b prevent compile from binding in the current namespace
When `compile` is used on a top-level definition, do not
create a binding in the current namespace, but arrange for
a suitable binding to be in place for the target namespace.

Closes #1036
2015-09-05 10:58:44 -06:00
Matthew Flatt
24592f78fc ffi/unsafe/objc: add support for blocks
Also add some functions for manipualting classes and objects.
2015-09-04 08:31:52 -06:00
Matthew Flatt
8ee717520f fix sync when resumed after a break exception
This repair adjusts the bug fix of commit 769ad3e98. That older commit
ensured that `sync/enable-break` doesn't both break and accept a
channel message or semaphore wait. But it effectively disables those
actions if the break is continued.

Instead of (partially!) ending the `sync` get out of semaphore
and channel queues so that no event can be selected during
the break, and then get back in line if the break is continued.
2015-09-02 18:21:38 -06:00
Matthew Flatt
fb8e08a2ac adjust path encoding in bytecode and syntax-object sources
When a path is made relative for marshaling to bytecode, record
a list of byte strings in stead of a platform-specific relative
path.

For syntax-object source locations, convert any non-relative path to a
string that shows just the last couple of path elements preceded by
".../". This conversion avoids embedding absolute paths in bytecode,
but at the cost of some information. A more complete and consistent
solution would invove using a module-path index instead of a path, but
that would be a big change at several layers.
2015-09-02 18:21:38 -06:00
Matthew Flatt
a934bdf444 Adjust the bytecode format to accomodate syntax source locations
Make room in the bytecode format for source locations and 'paren-shape
property values for syntax objects. Saving source locations increases
bytecode size by about 10% on average.

Also, convert the internal representation of syntax properties to
use immutable hash tables, instead of lists.
2015-09-02 14:49:39 -06:00
Matthew Flatt
53821a4997 intern path values in bytecode 2015-09-01 15:54:41 -06:00
Matthew Flatt
929db29b67 add prop:expansion-contexts
The `prop:expansion-contexts` property can control the expansion
of a rename transformer in much the same that conditionals on
`(syntax-local-context)` can control the expansion of other
transformers.
2015-09-01 13:55:35 -06:00
Gustavo Massaccesi
c290de0f88 Fix typos 2015-09-01 11:46:41 -05:00
Blake Johnson
38317b87c2 setting the imported flag on toplevels 2015-08-31 16:13:08 -06:00
Matthew Flatt
9c0b6593b6 filesystem-change-evt: wide paths for Windows 2015-08-30 12:20:40 -06:00
Matthew Flatt
73e5313e1c fix starter icons for Windows cross-compile 2015-08-30 10:58:07 -06:00
Matthew Flatt
1b778bf34b fix GRacket paths for MinGW build 2015-08-30 07:01:10 -06:00
Matthew Flatt
6beff43439 fix expand[-syntax[-to-top-form]] to add namespace's scope
Make `expand` more consistent with `eval` and with the old expander.
2015-08-29 11:44:33 -06:00
Matthew Flatt
94e5b1723b JIT simplification
Remove unused and confusing attempt to avoid runstack sync.
2015-08-28 20:24:46 -06:00
Matthew Flatt
ab6b58a476 avoid compiler warning 2015-08-28 20:21:29 -06:00
Gustavo Massaccesi
152787cb0e JIT: inline string=? and bytes=? 2015-08-28 20:57:39 -03:00
Matthew Flatt
79738d3bf6 fix no-places build 2015-08-28 17:27:17 -06:00
Matthew Flatt
bfb4d34715 fix memory accounting for useless channels
Fix accounting for a channel that is without a
peer for sending and/or receiving.
2015-08-28 17:05:38 -06:00
Matthew Flatt
b016246096 avoid interferences among places for memory accounting
All places uses the same accounting bit for objects
that are in the shared space. Each place also flips
the bit value it wants on each accounting, so if two
places are accounting at the same time with opposite
bit values and can reach the same objects, they can
interefere. It's even possible for them to race
through cycles and cause each other to loop forever.

Add a lock to ensure that there's only one bit value
in play for the shared space at any given time. A
place must stall if other places are busy with memory
accounting and an opposite bit value.
2015-08-28 17:05:37 -06:00
Matthew Flatt
a9078196b7 fix GC problem with in-flight place messages
While a place message is received by a thread but not yet
deserialized, if the message contains references to objects in the
shared space, and if a "master" GC happens (which crosses all places),
make sure that the references in the still-serialized message are
traversed.
2015-08-28 17:05:37 -06:00
Matthew Flatt
2773737c9c avoid races in marking shared-space objects
Although the race condition for setting mark bits
shouldn't matter, reasoning about the race is
difficult and asking for trouble, so don't do it.
2015-08-28 17:05:37 -06:00
Matthew Flatt
460743021d fix over-counting of place-message channel memory 2015-08-28 17:05:37 -06:00
Matthew Flatt
d71832f20e another MSVC MzCOM repair
Missed a line that was meant to be included with
commit a98947e81e.
2015-08-27 14:35:55 -06:00
Matthew Flatt
29784bda8e add cross-system-type and cross-system-library-subpath
Adjust installation tools to support cross-installation (i.e.,
installation for a platform other than the current one) as triggered
by "system.rktd" in "lib" having different information than the
running Racket executable.
2015-08-27 12:01:31 -06:00
Matthew Flatt
a98947e81e fix MSVC MzCOM build 2015-08-27 10:00:54 -06:00
Matthew Flatt
d4fb5ecec5 fix "GRacket.exe" capilization for MinGW build 2015-08-27 08:44:10 -06:00
Matthew Flatt
a3972487fb unbreak Linux build 2015-08-27 07:10:08 -06:00
Matthew Flatt
2a9022945d support for building MzCOM with MinGW 2015-08-26 14:07:19 -06:00
Matthew Flatt
828aff1476 unbreak non-Windows build 2015-08-26 10:02:02 -06:00
Matthew Flatt
ba7e2f11ec repair MinGW32 builds
Also, change floating-point handling to be like the MSVC build by
default, where the process is left in double-precision mode and
the mode is changed for exfl operations.

Includes repairs for integer-size mismatches in uses of Windows
threads.
2015-08-26 07:00:51 -06:00
Asumu Takikawa
fadcb78ffa Fixes to prop:rename-transformer
The error message for the guard used an incorrect contract.
Also removed an unused line that allows a box value in the
property. I don't think it was possible to trigger this line
anyway because of the dynamic check.
2015-08-25 08:20:49 -06:00
Blake Johnson
d86ccb1330 initializing ui->closures in the right place 2015-08-25 08:11:26 -06:00
Matthew Flatt
3d452fdba6 raco exe: make Windows exes as proper PE32 images
Instead of simply tacking bytecode onto the end of an executable,
generate a proper PE32 image.
2015-08-24 17:12:11 -06:00
Matthew Flatt
d16c5c08b6 Windows: update default icons
Includes a 256x256 icon.
2015-08-24 17:12:11 -06:00
Matthew Flatt
b9a5e92c37 file-truncate: flush on Windows before truncating
Otherwise, writes to the output port can get lost.
2015-08-24 15:08:21 -06:00
Matthew Flatt
cbb4ffee4d JIT: replace a multiplcation with a shift
In the implementation of `with-continuation-mark`.
2015-08-24 12:20:31 -06:00
Matthew Flatt
620ccbfa03 JIT: streamline values result delivered to let-values
In a case like

  (let-values ([(X ...) (with-continuation-mark M_k M_v
                          (values M ...))])
     ....)

where the bytecode compiler cannot convert to a sequence of `let`
bindings, make the JIT implement `values` as delivering argument
results directly to the corresponding variable locations.
2015-08-24 12:20:30 -06:00
Blake Johnson
674ab66d7b Added support for ref args in lifts to unresolver 2015-08-18 14:40:41 -06:00
Matthew Flatt
629697d14a remove accidentally added file 2015-08-17 12:36:51 -06:00
Matthew Flatt
1b493f2146 fix MzCOM's atexit replacement 2015-08-17 10:16:02 -06:00