Commit Graph

1077 Commits

Author SHA1 Message Date
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
Matthew Flatt
641c56b6e9 repair leak in managing OS-level locks 2015-08-17 09:51:20 -06:00
Matthew Flatt
693cdc673d GC: use ofm_malloc() and ofm_free() for admin allocation
Using ofm_....() makes it easier to check that memory allocated for GC
administrtation is itself reclaimed.
2015-08-17 09:39:11 -06:00
Matthew Flatt
fea2b1ce5e repairs for MinGW build
Fix compiler warnings and installation bugs related to the
".exe" extension.
2015-08-17 08:32:12 -06:00
Matthew Flatt
0caf079637 add syntax-local-lift-module 2015-08-14 16:52:56 -06:00
Matthew Flatt
111a7e085d fix prefab checking in printer
Mishandling of a chaproned prefab when, for example, determining
whether to use quoted printing caused the `tests/compiler/zo` test to
sometimes fail.
2015-08-14 07:28:37 -06:00
Matthew Flatt
e82e61e84c restore needed call in unresolver
Add back a call incorrectly removed in bd82646d81.
2015-08-13 18:22:51 -06:00
Gustavo Massaccesi
07816f2ca4 Use scheme_getenv in eval.c 2015-08-13 19:05:40 -03:00
Blake Johnson
12315ec964 using correct inspector for unresolved module 2015-08-13 15:13:46 -06:00
Juan Francisco Cantero Hurtado
f3098a946a Fix an error in racket-test-core/number.rktl on OpenBSD-current/sparc64
"Errors were:
(Section (got expected (call)))
((numbers) (0.0 -0.0 (#<procedure:round> -0.0)))
((numbers) (125.0+0.0i 125.0-0.0i (#<procedure:z-round> 125.00000000000023-0.0i)))
((numbers) (100.0+0.0i 100.0-0.0i (#<procedure:z-round> 99.99999999999999-0.0i)))"
2015-08-13 15:13:46 -06:00
Matthew Flatt
33cf716835 include phantom bytes consistently in memory-use reports 2015-08-13 15:13:46 -06:00
Matthew Flatt
bd82646d81 avoid compiler warnings 2015-08-13 11:57:06 -06:00
Matthew Flatt
7741b4b361 local-expand: fix argument checking
Also, fix contract in the docs, since the first argument is allowed to
be an S-expression.
2015-08-13 11:48:20 -06:00
Matthew Flatt
02574d2501 SGC: use PRIdPTR and PRIxPTR
Avoid compiler warnings by using the right format string.
2015-08-12 14:48:11 -06:00
Matthew Flatt
956d538164 fix missing zero of allocated atomic memory in unresolver 2015-08-11 16:01:54 -06:00
Blake Johnson
d39801c937 ref_args off by one 2015-08-11 16:01:54 -06:00
Matthew Flatt
13bd013528 fix JIT-inlined set-cpointer-tag! for non-x86 2015-08-11 16:01:53 -06:00
Matthew Flatt
820ab7126c fix enum mismatch in ARM JIT
Also, recognize `__ARM_ARCH_6ZK__`.
2015-08-11 16:01:53 -06:00
Matthew Flatt
1757348b23 repairs for MSVC
Don't use `for (int i ....`, which is too modern.
2015-08-10 17:14:09 -06:00
Blake Johnson
fbe8537f18 add compiled-expression-recompile
Uses an unresolver pass, which is expanded to work on more programs.
2015-08-10 16:39:43 -06:00
Matthew Flatt
2661d46929 toward deterministic bytecode generation
Progress toward making the bytecode compiler deterministic, so that a
fresh `make base` always produces exactly the same bytecode from the
same sources. Most changes involve avoiding hash-table order
dependencies and adjusting scope identity. The namespace used to load
a reader extension is also better defined. Plus many other little
changes.

The identity of a scope that is unmarshaled from a bytecode file now
incorporates the hash of the file, and the relative order of scopes is
preserved in a bytecode file. This combination allows compilation to
start with modules that loaded and compiled in different orders
(including delayed loading of bytecode fragments within one file).

Formerly, a reader extension triggered by `#lang` or `#reader` was
loaded in whatever namespace happens to be current. That's
unpredictable and can pollute a module build at the level of bytecode.
To help make builds deterministic, reader extensions are now loaded in
a root namespace of the current namespace.

Deterministic compilation in general relies on deterministic macros.
The two most common ways for a macro to be non-deterministic are by
using `gensym` (use `generate-temporaries`, instead) and by using an
unsorted hash-table traversal (don't do that).

At this point, bytecode generation is unlikely to be completely
deterministic, since I uncovered non-determinism mostly by iterating
attempts over the base collections. For now, the intent is not to
provide guarantees outside of the compilation of the base collections
--- but "more deterministic" is likely to be useful in the short run,
and we can improve further in the long run.
2015-08-07 15:48:39 -06:00
Matthew Flatt
0efd052218 fix single-float hashing 2015-08-07 05:30:25 -06:00
Matthew Flatt
6bcb449b55 fix impersonator-property:application-mark propagation
Propagate the mark value only if it's on the current continuation
frame, as originally intended. Adjust the docs to clarify.
2015-08-07 05:30:25 -06:00
Matthew Flatt
0480f55f67 add with-immediate-continuation-mark bytecode form
Specialize a
  (call-with-immediate-continuation-mark _key (lambda (_arg) _body) _def-val)
call to an internal
  (with-immediate-continuation-mark [_arg (#%immediate _key _def_val)] _body)
form, which avoids a closure allocation and more.

This optimization is useful for contracts, which use
`call-with-immediate-continuation-mark` to avoid redundant
contract checks.
2015-08-07 05:30:25 -06:00
Matthew Flatt
c308915047 minor streamlining of foreign-call path
JIT-inline `cpointer-tag` and `set-cpointer-tag!`, plus minor
shortcuts and GC hints in Racket->C conversion.
2015-08-06 14:44:30 -06:00
Matthew Flatt
bf76ced8ba work around EPERM error from access()
On OS X, it seems that access() can sometimes fail with EPERM
when checking for execute permission on a file without it.
I've previously seen this result when running as the superuser,
but that's apparently not the only possibility; a long path
may also be relevant.
2015-08-01 21:59:19 -06:00
Matthew Flatt
086d02003a fix linking of compiled reference to a top-level variable
Re-linking in a new namespace doesn't need the namespace of
compilation.

A "namespac.rktl" test exposed this problem, where the "transfer a
definition of a macro-introduced variable" test could fail if a GC
occurred between compilation in one namespace and evaluation in
another.
2015-07-31 11:17:25 -06:00
Matthew Flatt
1f2e0dacb3 minor adjustments
SGC header correction plus extra assert.
2015-07-31 07:32:34 -06:00
Gustavo Massaccesi
a1f04604df JIT: Inline keyword? 2015-07-30 21:27:26 -03:00
Jay McCarthy
2602ff530d Adding no major collection guarantee to collect-garbage minor collections 2015-07-30 11:42:13 -06:00
Jay McCarthy
2f22f86c0a Adding minor collections to collect-garbage 2015-07-30 11:42:13 -06:00
Matthew Flatt
26158a51d2 raise-syntax-error: fix srcloc reporting on #f as 3rd arg 2015-07-29 11:54:18 -06:00
Matthew Flatt
7864436594 fix top-level scope introduction
Although `eval-syntax` is not supposed to add the current namespace's
"outer edge" scope, it must add the "inner edge" scope to be consistent
with adding the inner edge to every intermediate expansion (as in
other definition contexts).

In addition, `eval`, `eval-syntax`, `expand`, and `expand-syntax`
did not cooperate properly with `local-expand` on the inner edge.
2015-07-28 13:14:00 -06:00
Rui Paulo
84996ff2ac sconfig: FreeBSD uses clang. 2015-07-25 20:57:59 -06:00
Rui Paulo
6dd1aa0cd8 sconfig: add FreeBSD/arm. 2015-07-25 20:57:40 -06:00
Matthew Flatt
98bd78e7f0 remove unused counter 2015-07-25 20:56:09 -06:00
Matthew Flatt
5e2b6c2b74 JIT: repair some runstack-pointer syncs
Some failure paths were missing an update before calling failure
code, and the new failure paths need to unconditionally update the
runstack pointer (because the common stub doesn't know whether the
calling context needs an update).
2015-07-25 20:49:58 -06:00
Gustavo Massaccesi
8430daa628 Jitinline string-length and bytes-length
Previously only the unsafe versions were inlined in the jit compiler.
2015-07-25 20:31:44 -03:00
Matthew Flatt
9593b4c806 make-syntax-introducer: add optional argument to change kind of scope
Genereating a use-site scope, instead of a macro-introduction scope,
prevents the scope's presense from triggering a #f result from
`syntax-original?`.
2015-07-25 14:37:54 -06:00
Matthew Flatt
1d380864e9 remove accidentally committed debugging change 2015-07-23 09:09:03 -06:00
Matthew Flatt
f4d05aaba8 fix bytecode-marshaling problem related to rename transformers 2015-07-23 08:04:34 -06:00
Matthew Flatt
120f1329c6 change bytecode marshaling of scopes
This change mostly reverts 1465ff25fc, which turned out to be a hassle
because it created more cyclic structure.

A simpler strategy is to allow a phase-specific scope to be detached
(perhaps temporarily, due to on-demand loading of bytecode) from its
group; when that's possible, the scope is not reachable from a place
where it can be moved to other syntax objects, so it's ok to be
detached. Debugging output needs to handle that gracefully, though.
Also, in case of broken bytecode, fix up a detached scope if it
does end up in an unexpected place.
2015-07-23 08:04:34 -06:00
Matthew Flatt
176777b05f adjust transfer of compiled in one namespace and run in another
Formerly, compiling a definition in one namespace and evaluating it in
another would cause the definition to take place in the original
namespace --- unless the compiled code is marshaled to a byte string
and back. Adjust the "linking" process to redirect the variable
definition and any references to the new namespace. (This is a change
relative to the compiler with the old macro expander.)

Also, repair a compiled `require` form along similar lines. (This is
*not* a change relative to the compiler with the old macro expander;
the mismatch is part of the motivation for changing `define`
handling.)
2015-07-22 10:54:31 -06:00
Matthew Flatt
1465ff25fc in ".zo", keep module's set of scopes together
For a set of phase-specific scopes that correspond to the "inside
edge" of a module, make sure the whole set is marshaled together.
2015-07-21 12:50:48 -06:00
Matthew Flatt
57ea02616c fix inspector tracking in syntax objects
Repair a NULL vs. #f mismatch.
2015-07-20 13:41:04 -06:00
Matthew Flatt
3d87d61039 fix expansion loop in a definition context
Add the current definition context's scope to any expression that is
produced by macro expansion before trying to expand again, in case the
expansion needs to refer to a definition introduced by a previous
expansion.

Previously, the scope was added before any expansion and after any
expansion, but that misses intermediate points.

The old expander had this bug, too (some of the new tests fail there),
but it showed up less often and was sometimes considered correct, for
various reasons.
2015-07-20 13:20:03 -06:00
Matthew Flatt
0bc5a1b06a fix nested begin-for-syntax
Initialize a phase-2 namespace before trying to use it.
2015-07-19 12:07:53 -06:00
Gustavo Massaccesi
597eb161f5 avoid compiler warning 2015-07-18 20:44:36 -06:00
Matthew Flatt
1eba8ac2a7 fix place-channel support for eq[v] hash tables
Bug caught by an existing test.
2015-07-18 20:44:36 -06:00
Matthew Flatt
053cfc0ddb fix an incorrect simpliciation in the GC
I had tried to simplify the "generation 0" allocation function to
always use `GEN0_PAGE_SIZE`, but "generation 0" is also used for place
messages, in which case a much smaller size should be used.

The "place-in-channel-fnl.rkt" test exposed this problem.
2015-07-17 09:55:17 -06:00
Matthew Flatt
123f724c47 fix GC problem with chains of ephemerons
A recent GC change (included with the set-of-scopes expander)
allows the GCs marking procedure to recur directly to a limited
depth, instead of always pushing pointers onto a stack. Direct
recursion is not cmopatible with ephemeron-resolution process,
so switch to no-recur mode.

This problem was uncovered by an existing test.
2015-07-17 02:10:04 -06:00
Matthew Flatt
dd0ced3c02 avoid compiler warnings 2015-07-16 21:04:01 -06:00
Matthew Flatt
aaee824f68 optimizer: fix coordinate shift when a letrec is split
The combination of splitting a `letrec` and optimizing
the resulting `(let ([x <proc>]) x)` to just `<proc>`
used a bad coordinate shift, which made property testing
incorrect, etc.

For reasons that are not clear, the new expander triggered
the problem through an existing test.
2015-07-16 18:18:58 -06:00
Matthew Flatt
b72dceb865 avoid excessive fallbacks via eval-syntax
The `eval-syntax` function (which is used by other functions, such as
loading a module) should not install fallback-binding scopes from
the current namespace.
2015-07-16 14:20:00 -06:00
Matthew Flatt
fc5e32e526 switch to set-of-scopes expander
The development history for set-of-scopes is preserved in a "scope"
branch in the main Racket repository, which is commit
 ae88c96f50
2015-07-16 14:20:00 -06:00
Matthew Flatt
bfc2b27d65 fix optimizer's single-use tracking, especially on inlining
When `(let ([x ...]) (let ([y x]) ... y ... y ...))` turns into
`(let ([x ...]) ... x ... x ...)`, make sure that `x` is not
still marked as single-use. Incorrect marking as single-use could
cause the optimizer to inline too much, for example.

Thanks to Gustavo for tracking down the problem.
2015-07-16 07:48:17 -06:00
Gustavo Massaccesi
bfc9eb8d62 Add ´not´ to the relevant predicates list
Previously all the predicates recognized only non-#f things, so ´not´ can be
added to the list of disjoint predicates. But many of the parts of the code
relied on the non-#f property and had to be modified.
2015-07-14 19:20:11 -03:00
Gustavo Massaccesi
dfc64053b7 Infer type from comparisons in test positions
In (if (eq? x <pred?-expr>) <tbranch> <fbranch>) infer that the type of
x is pred? in the tbranch.

Also, reduce (eq? x y) => #f when the types are different.
2015-07-14 19:19:50 -03:00
Gustavo Massaccesi
bc2cf531e3 Reduce variables with type null? and void? to null and #<void>
The optimizer reduces the variables with a known type to #t in a Boolean context.
But some predicates imply that the variable has a definite values, so they can be
reduced in a non-Boolean context too.

For example, in (lambda (x) (if (null? x) x 0))) reduce the last x ==> null.
2015-07-14 19:19:28 -03:00
Gustavo Massaccesi
58300857db Fix bug in type propagation to avoid the reduction of mutable variables
This fixes the bug twice:
* Don't reduce mutable variables with a type to #t in a Boolean context.
* Don't record the type of mutable variables when a predicate is
     checked in a test condition.
2015-07-14 19:19:05 -03:00
Gustavo Massaccesi
b7ae673ee0 Mark (values <expr>) as single valued
While reducing some ignored constructors, the optimizer may wrap the arguments
<expr> in (values <expr>) to ensure that it's a single value non-cm expression.
This avoids the unnecessary nesting of (values (values <expr>)).

Similarly, add the cases for begin and begin0 to single_valued_noncm_expression
2015-07-14 13:43:54 -03:00
Gustavo Massaccesi
d0c9a894fb Mark many port primitives as non-cm 2015-07-14 13:28:28 -03:00
Matthew Flatt
d6fa581a4c increase signal-handling stack size
On 64-bit Linux platforms other than x86_64 (e.g., AArch64), SIGSTKSZ
isn't big enough. Use a stack 10 times as large.
2015-07-03 12:41:37 -06:00
Matthew Flatt
ff492f9bb6 add comments on how page alisngment 2015-07-03 12:40:26 -06:00
Matthew Flatt
331b104345 JIT: inline ptr-ref and ptr-set!
Special treatment of `ptr-ref` and `ptr-set!` applies when the second
argument is one of a few primitive C types: `_int`, `_double`, etc.
2015-07-02 15:59:35 -06:00
Matthew Flatt
b782b9a4db fix no-places, no-futures build 2015-07-02 14:48:19 -06:00
Matthew Flatt
0cda0c98b0 fix GC for non-x86 64-bit platforms
A test for 64-bitness was broken, checking specifically for x86_64
instead of the general 64-bit flag.
2015-07-02 07:26:06 -06:00
WarGrey Gyoudmon Ju
8a817e577c disable HAVE_POLL_SYSCALL in solaris: poll(2) is the CPU eater, and this problem affects all TCP applications including plt-web-server. 2015-07-01 18:21:01 -06:00
Matthew Flatt
40f79dd72e configure: fix --enable-noopt
Broken by cf8c3c9cfe, which shifted optimization flags from
CFLAGS to PREFLAGS when using a gcc-stype preprocessor.
2015-06-30 16:27:34 -06:00
Gustavo Massaccesi
72132ea3aa Reoptimize propagated constants
Reduces them to #t or #f when they are copied to a Boolean context
2015-06-29 23:44:47 -03:00
Matthew Flatt
6f6a792d06 fix memory-management problem with #:lock-name
Repairs a bug in 290020c597.
2015-06-26 07:44:43 +08:00
Matthew Flatt
290020c597 ffi/unsafe: add #:lock-name option to _fun and _cprocedure
While `#:in-original-place? #t` provides one way to serialize
foreign calls, it acts as a single lock and requires expensive
context switches. Using an explicit lock can be more efficient
for serializing calls across different places.

For example, running "plot.scrbl" takes 70 seconds on my machine
in the original place and using `#:lock-name` in any place,
while it took 162 seconds in a non-main place with Cairo+Pango
serialization via `#:in-original-place? #t`.

Internally, the named lock combines compare-and-swap with a
place channel. That strategy gives good performance in the case
of no contention, and it cooperates properly with the Racket
scheduler where there is contention.
2015-06-25 10:35:22 +08:00
Matthew Flatt
9931d5ef1c avoid compiler warning 2015-06-24 07:17:39 +08:00
Matthew Flatt
f7e1fcd557 log a warning for shadowing an import with a definition 2015-06-24 07:15:29 +08:00
Gustavo Massaccesi
95bac91268 Propagate types form the body of let's forms and inlined functions
The optimizer was able to use the type information gained outside
the let's to reduce expressions inside the lets. For example, in
  (lambda (z) (car z) (let ([o (random)]) (pair? z)))
it reduces (pair? z) ==> #t.

This enable the propagation in the other direction so in
  (lambda (z) (let ([o (random)]) (car z)) (pair? z))
it reduces (pair? z) ==> #t too.
2015-06-23 16:52:40 -03:00
Gustavo Massaccesi
1a091f535e Intersect types gathered in if branches 2015-06-23 16:46:23 -03:00
Matthew Flatt
ea016bec96 allow definition in module to shadow a preceding import
This change is experimental and intended to reduce (but certainly not
eliminate) the problem of breaking existing code by adding exports to
a module.
2015-06-23 21:31:57 +08:00
Matthew Flatt
ca57adcf2d fix slow leak in link-establishing thread-resume
Using `(thread-resume t1 t2)` would not prevent a GC of t1, but it
would create an intermediate record to make the link from t1 to t2,
and that intermediate record would leak due to a missing level of
indirection in a table-cleanup traveral. The leak not only accumulated
memory, it also caused ever slower traversals of the table in an
attempt to clean up.

(Since the leak is small and the leaking object is not directly
accessible, I don't have a good idea on how to test this repair
automatically, but see the program in the PR.)

Closes PR 15099.
2015-06-22 16:53:52 +08:00
Matthew Flatt
bf12a2bdd7 bump version number
Should have bumped it with the xform changes.
2015-06-07 09:03:01 -06:00
Matthew Flatt
d95200f19a remove setting of socket send buffer size
Modern OS configurations likely use an even larger buffer size, and
making it small can have substantial negative performance effects
(e.g., with PostgreSQL over TCP).
2015-06-06 10:50:44 -06:00
Matthew Flatt
4deacddde8 attempt to fix xform problem
Mark some pointer arithmetic as ok.
2015-06-06 09:21:23 -06:00
Matthew Flatt
cf8c3c9cfe adjust auto-configuration of CPPFLAGS vs. CFLAGS
When AC_PROG_CC picks GCC, move its selection of CFLAGS
into CPPFLAGS, so that preprocessing will have the same
optimization and debugging flags as compilation.

Arguably, AC_PROG_CC plus AC_PROG_CPP should do that
soemhow, but it's understandable that the autoconf
implementers didn't cover the possibility of
preprocessing that changes with the optimization level.

Closes #945
2015-06-06 07:55:14 -06:00
Matthew Flatt
298feb1bb6 fix problem with expand and local-require
When `local-require` is used in a non-phase-0 position and it is
`expand`ed (as opposed to compiled directly), then the generated
`#%require` form had the wrong binding phase.

Merge to v6.2
2015-05-15 10:44:20 -06:00
Gustavo Massaccesi
6c2888937a Make (make-vector <number>) omittable
In many use cases the length of the vector is fixed and know,
so we are sure that make-vector will not raise an error and
we can recognize these expressions as omittable and drop
them when the result is ignored.
2015-05-14 16:36:35 -03:00
Gustavo Massaccesi
2be6eb9570 Mark the result of more procedures as vector?
The result of some procedures is a vector, but they are not omittable
because they may rise an error. With the recent changes of the
predicate reduction these cases are correctly handled.
2015-05-14 16:36:21 -03:00
Matthew Flatt
6f984d868c fix expander problem with set! 2015-05-09 18:35:25 -06:00
Matthew Flatt
0304fedf92 Makefile: make SRC_CATALOG work for in-place and unix-style
Configure an in-place or unix-style build to use the given
SRC_CATALOG before the default catalogs.
2015-05-03 21:41:46 -07:00
Gustavo Massaccesi
4c10a9efac Check the type of the arguments of more procedures
The optimizer checks the type of the argument of some unary procedures and
uses the gathered information to replace them by the unsafe version, reduce
predicates and detect type errors. This extends the checks to more procedures
that have no unsafe version and procedures that have more than one argument.
2015-05-03 15:15:24 -03:00
Gustavo Massaccesi
e8ad90a14d Remove duplicate code in scheme_omittable_expr 2015-05-01 10:01:24 -03:00
Ryan Culpepper
d48840f23b Post-release version for the v6.2 release 2015-04-27 09:36:47 -04:00
Matthew Flatt
11939df0f2 fix custodian-managed-list for weakly held objects 2015-04-18 07:06:33 +01:00
Matthew Flatt
469763ca37 Adjust use of readtable argument in read/recursive
Use the given readtable more consistently to parse
delimiters in the top-level form. This change particularly
addresses problems with trying to restore the original
`(` when parsing a hash table, but allowing nested
forms to still use a different `(` mapping.
2015-04-15 13:01:58 -06:00
Matthew Flatt
16ce8fd90d fix an optimizer bug
Optimization of an identifier in a test position passed a
pre-optimization offset to a function that expects a
post-optimization offset.
2015-04-12 06:48:07 -06:00
Juan Francisco Cantero Hurtado
667b9e9b71 Clarify the minimum CPU requirements in README
The JIT needs SSE2, not just SSE.
2015-04-10 14:12:54 -06:00
Matthew Flatt
be1a63cf50 fix SSE detection to detect SSE2
SSE isn't enough, because the JIT needs SSE2
2015-04-10 14:03:44 -06:00
Matthew Flatt
8e22b22630 fix string-titlecase based on case-ignoreable chars
Fix extraction of case-ignorable characters from the Unicode
database.
2015-04-10 13:30:58 -06:00
Matthew Flatt
23ec573e51 repair chaperone handling in current-command-line-arguments 2015-04-06 12:44:47 -05:00
Matthew Flatt
f7d4f7b234 MinGW build repairs and improvements 2015-03-28 09:50:01 -06:00
Matthew Flatt
5fff8e2056 internal hooks to build "Racket.exe" without "libracket3m.dll"
For now, setting `libracket-dll?` to #f in
  racket/src/worksp/gc2/make.rkt
enables that build mode.
2015-03-28 09:50:01 -06:00
Jay Kominek
3ad60aa67a fix integer-length overflow (PR14986) improve performance on integer-length of negative bignums 2015-03-26 11:20:40 -06:00
Matthew Flatt
2dd29f7e3d fix pessimism in optimizer reordering
When determing whether expressions can be reordered, a reference to a
module-defined variable was considered unreorderable when it is
known to have a value and no further mutation, but the value isn't
constant across all runs.
2015-03-26 09:15:13 -06:00