Commit Graph

3080 Commits

Author SHA1 Message Date
Matthew Flatt
a929c58712 rktio: compiles for Windows using MinGW 2017-06-19 06:45:16 -06:00
Matthew Flatt
9bfaaf3ab3 rktio: wide-string handling for Windows 2017-06-19 06:45:16 -06:00
Matthew Flatt
4ffb01c6fa rktio: more configure for rktio 2017-06-19 06:45:16 -06:00
Matthew Flatt
2187e77e65 rktio: add filesystem-change events 2017-06-19 06:45:16 -06:00
Matthew Flatt
19776f6bb9 rktio: fix some leaks 2017-06-19 06:45:16 -06:00
Matthew Flatt
b5e88e70c2 rktio: environment variables 2017-06-19 06:45:16 -06:00
Matthew Flatt
a767ea38fc rktio: improve organization 2017-06-19 06:45:16 -06:00
Matthew Flatt
c5ddf79721 rktio: small repairs 2017-06-19 06:45:16 -06:00
Matthew Flatt
9e68886b26 rktio: processes 2017-06-19 06:45:16 -06:00
Matthew Flatt
6c2f71bf80 rktio: UDP 2017-06-19 06:45:16 -06:00
Matthew Flatt
e9d5260295 rktio: dup and socket addresses 2017-06-19 06:45:16 -06:00
Matthew Flatt
9461c0e72a rktio: repairs for dynamic fd_set support 2017-06-19 06:45:16 -06:00
Matthew Flatt
72b0351331 rktio: repairs for Linux 2017-06-19 06:45:16 -06:00
Matthew Flatt
6e1d519711 rktio: fix network problems 2017-06-19 06:45:16 -06:00
Matthew Flatt
3065773b31 rktio: add networking 2017-06-19 06:45:16 -06:00
Matthew Flatt
adedf861b2 rktio: finish epoll/kqueue layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
04130638fc rktio: add kqueue/epoll layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
09703b94f7 rktio: put "globals" in an rktio_t
Avoid thread-local state by threading a `rktio_t`
record through everything.
2017-06-19 06:45:16 -06:00
Matthew Flatt
68352ef86a rktio: more progress 2017-06-19 06:45:16 -06:00
Matthew Flatt
64146e94dc rktio: first cut at moving Racket OS wrappers to a library
The world doesn't need yet another cross-platform I/O library, but
it's getting one. This one has exactly the things that Racket needs,
and pulling it out will make it reusable from other VMs while
improving the Racket code organization.

This first step just gets started.
2017-06-19 06:45:16 -06:00
Matthew Flatt
dc14a68162 fix performance problem in expander
For a term

 (lambda (arg-id ...) (define def-id _rhs) ... (arg-id def-id) ...)

the expander could take quadratic time in the number of `def-id`s
due to walking an environment to remove use-site scopes. (The
variant of the expander rewritten in Racket didn't have this
problem.)
2017-06-08 07:01:31 -06:00
Matthew Flatt
ff26c2f29b fix complexity of type merging in bytecode optimizer
Merge a smaller table into a larger one to avoid an overall
quadratic-time computation.
2017-06-08 07:01:30 -06:00
Leif Andersen
5c27f5550c Add mzrt_sema_trywait to the mzrt library.
This commit add mzrt_sema_try_wait to the functions that operate
on semaphores. The existing ones are:

* int mzrt_sema_create(mzrt_sema **sema, int init);
* int mzrt_sema_post(mzrt_sema *sema);
* int mzrt_sema_wait(mzrt_sema *sema);
* int mzrt_sema_destroy(mzrt_sema *sema);
2017-06-05 10:46:24 -04:00
Leif Andersen
5510a76dca
scheme_add_atexit_closer now uses scheme_atexit.
This is because calling atexit is not correct in all
situations, namely on old operating systems.
2017-06-04 08:56:07 -04:00
Leif Andersen
a8fa5d4ebb
Add scheme_atexit c function.
This way programs can actually call atexit. (Otherwise atexit
is frequently not provided in libc as a symbol.)
2017-06-03 20:47:34 -04:00
Leif Andersen
2f6c42f3c1 Add a #:make-c-id flag to define-ffi-definer
This make-c-id allows an author to specify a convention for how
to connect and identifier defined with define-ffi-definer and
the actual symbol in the file.

* Adds docs.
* Adds tests.
* Adds history.
2017-06-02 10:26:57 -04:00
Matthew Flatt
f459dd9eb7 make collapse-module-path-index work on a "self" modidx 2017-06-01 19:37:18 -06:00
Matthew Butterick
4c5f66ff4a fix typo
`that do` → `that does`
2017-05-30 11:05:40 -04:00
Matthew Flatt
06b69c625f repair chainges to ffi/file
Bring back the exported `_file/guard`, `_file/r`, and `_file/rw`;
restore/move tests in "file.rktl" test suite; and add docs for new
functions.
2017-05-27 07:29:47 -06:00
Matthew Flatt
87c0ca84a8 add ffi/unsafe/global and switch openssl to use it
Continues the move away from using the FFI to access unsafe Racket
functionality.
2017-05-26 17:49:16 -06:00
Matthew Flatt
bf83d1126d add some unsafe operations as an alternative to FFI access
Accessing unsafe functionality through the FFI seemed like a good way
to avoid writing C code, but it made things more complicated instead
of easier, and it interacts badly with a more agressive shift away
from C (such as porting to Chez Scheme). So, add functions to the
primitive `#%unsafe` module, instead.
2017-05-26 16:26:06 -06:00
Matthew Flatt
7f1ab90806 raco exe on Mac OS: ensure that "PkgInfo" is writable
Relevant to #1680
2017-05-25 13:01:12 -06:00
Matthew Flatt
f27be30c15 fix error message 2017-05-25 13:01:08 -06:00
Jay McCarthy
07f35d248c Abort if munmap or protect_pages fails
On Linux, munmap can fail when you run out of mappable regions.

If protect_pages fails, then you can't install a write barrier
2017-05-25 13:38:33 -04:00
Milo Turner
cc25a27f87 fix id-set-symmetric-difference, same as 4716a6e fixed for sets 2017-05-24 15:55:03 -04:00
Stephen Chang
7620bfcb7c fix and actually run id-set tests 2017-05-24 13:25:15 -04:00
Stephen Chang
42152ed31c add neg-party arg to id-set-contract-check 2017-05-24 10:01:43 -04:00
Robby Findler
6a145244d6 add missing adjust-location call 2017-05-23 09:05:30 -05:00
Ben Greenman
b36c35ac7e typo: 'an mutable' => 'a mutable' 2017-05-21 02:00:00 -04:00
Ryan Culpepper
c082f130cb support string, bytes (bindings from racket) as stxclass refs
add compile-time table as alternative to stxclass binding
2017-05-18 12:54:26 -04:00
Daniel Feltey
1bdaf0b231 Fix typo for chaperone-vector* error messages 2017-05-17 12:50:05 -05:00
Daniel Feltey
8bc9cef7a9 Fix typo in vector contract implementation leading to wrong error message 2017-05-15 17:33:24 -05:00
Robby Findler
f2a29515d1 adjust invariant-assertion error message to avoid blame
closes #1681
2017-05-13 11:12:25 -05:00
Matthew Flatt
f43234e1cb add prop:authentic and (struct .... #:authentic ....)
An authentic structure type is one whose instances cannot be
impersonated or chaperoned. The intended use of `prop:authentic` is to
annotate a library-private data structure where impersonators are
never needed internally for the data structure, and the declaration
lets the compiler produce less code and fewer branches by omitting
impersonator support.
2017-05-12 12:40:57 -06:00
Robby Findler
65beb4de4c fix cons/dc's predicate 2017-05-12 11:26:49 -05:00
Robby Findler
8f34b702ab improve flat-contract test suite so that it checks
the predicate-ness of the contracts
2017-05-12 11:26:49 -05:00
Matthew Flatt
e6793c4598 fix variable-reference->module-path-index on primitive refs 2017-05-09 20:28:25 -06:00
Matthew Flatt
26c4dd6909 add #%unsafe exports to implement ffi/unsafe/atomic
Export functions through the usual `#%unsafe` primitive module,
instead of using the FFI to get at unsafe operations.
2017-05-09 09:32:34 -06:00
Matthew Flatt
e68e4bd6f6 minor configure --help format repairs 2017-05-09 09:32:34 -06:00
Robby Findler
79cef0a96e clean up a bunch of contract names 2017-05-06 22:10:41 -05:00
Matthew Flatt
de0d84f7b3 racket/serialize: repairs for structs that have auto fields
Closes #1650
2017-04-29 13:20:25 -07:00
Vincent St-Amour
13443dec92 Add chaperone-vector*, unsafe-chaperone-vector, and property-only vector chaperones.
By analogy with the procedure chaperone equivalents.
2017-04-28 14:27:53 -05:00
Vincent St-Amour
541015ba3b Update raco pkg new for v6.9.
(cherry picked from commit 351dcfe14d0f3aa7f7b5b1491d882c887a971c24)
2017-04-27 11:50:13 -05:00
Matthew Flatt
d469265a6e Makefile: support both cross-platform and non-cross installers
In non-cross mode, `-C` needs to go after `-G` and `-X` when setting
up a "bundle" directory to turn into an installer, because that mode
needs to use foreign libraries (such as SQLite) at build time, and it
can use the instances that are being set up for the installer.

Meanwhile, improve the advice for setting `PLAIN_RACKET` to use `-C`
for a cross-platform build mode, even though things tend to work
anyway without it.
2017-04-26 15:59:04 -06:00
Matthew Flatt
6de3659664 repair for hash-keys-subset?
When comparing a part of a hamt that is a collision node versus a
subtree node, a "hash code" was extracted from the collision node ---
but that's really a code for an integer key is that used for the
collision element. The comparison should instead use a code extracted
from the reference to the collision node (which is the code that is
common to all colliding keys).
2017-04-26 15:27:39 -06:00
Matthew Flatt
f8aeed279b Windows: fix 64-bit mzdyn.exp
Also, make the `raco exe` tests more accommodating to uncooperative
Windows configurations.
2017-04-25 16:31:51 -07:00
Matthew Flatt
c917434a86 improve cross-platform support
Detangle the target and host DLL and library directories by
making `get-lib-search-dirs` and `get-dll-dir` report the
host system's directories, and add `get-cross-lib-search-dirs`
and `get-cross-dll-dir`.

A new `-C`/`--cross` flag causes `racket` to save a host config and
collection directory and make them available via `(find-system-path
'host-{config,collects}-dir)`, while plus `(system-type 'cross)`
reports whether `-C` mode is in effect. Besides making the host paths
available, this change allows a same-platform build to run in
corss-platform mode.

The immediate problem to solve was the creation of Windows installers
on Windows, where recent changes to support 'gui-bin-dir configuration
need a clear distinction between the host Racket and the target Racket
being built, even if they're the same platform. (The "GRacket.exe"
executable didn't work, for example.)

The changes in this commit are more than needed for the immediate
problem, but they naturally build on the necessary `-C` flag, and they
support cross-platform package setup where native libraries are needed
during setup.
2017-04-25 08:31:26 -06:00
Matthew Flatt
83bf0e49ff add more auto-detected Visual Studio versions 2017-04-24 13:05:17 -06:00
Matthew Flatt
a71d87c5a9 optimizer: remove incorrect assertion 2017-04-21 14:28:57 -06:00
Matthew Flatt
9cb8c8fdd9 avoid O(n^2) GC time with ephemeron chains
Avoid the well-known possibility of quadratic handling of ephemeron
chains, where all ephemerons are immediately known, no keys are
immediately known, and each link in the chain has a value that refers
to the next link's key.

To aviod quadratic behior, attach a list of ephemerons to each page of
allocated objecst, where marking any object on the page triggers a
rescan of the ephemerons without waiting to rescan all ephemerons.
2017-04-20 20:48:55 -06:00
Matthew Flatt
3bc3fe9e26 fix dynamic-wind matching for continuation jumps
Thanks to Gustavo and Robby for tracking down the relevant feature
of a complex example that was found by random testing.
2017-04-19 07:00:34 -06:00
Matthew Flatt
fae55e83e2 history note for v6.9 2017-04-17 13:12:07 -06:00
Matthew Flatt
803d8ff0d5 fix launcher creation for gracket[-text] on Mac OS
The repair in 71a43f34c8 fixed the creation of some launchers, but it
broke GUI launchers with a relative reference on Mac OS.
2017-04-16 15:51:28 -06:00
Ryan Culpepper
995f320918 fix in-query result checks with grouping
closes racket/db#8

merge to release branch
2017-04-15 12:19:31 -04:00
Leif Andersen
922b5f06e9 Make log also accept a base. (#1667)
Make `log` in `racket/base` optionally accept a second argument.

The second argument is the log `base`. The docs also recommend
`fllogb` when precision is important.

* Error message when base is 1
* Added docs.
* Add tests.
2017-04-15 10:40:41 -04:00
Robby Findler
6492226411 add a #:name argument to flat-contract-with-explanation 2017-04-13 10:19:20 -05:00
Ben Greenman
1e29362dad typo: error message in parse-command-line 2017-04-12 14:51:32 -04:00
Matthew Flatt
662fd84eda raco: fix command name selection by prefix
Repairs a problem with 409321c03b.

Merge to v6.9
2017-04-10 08:22:49 -06:00
Matthew Flatt
016b8009c5 repair "info-cache.rktd" assumption of relative paths
Fix for 459a74455c to handle the case that a path
to record is not relative. The `raco pkg` tests
exposed the problem.
2017-04-09 10:53:05 -06:00
Matthew Flatt
459a74455c avoid platform-specific path conventions in "info-cache.rktd"
Store relative paths in "info-cache.rktd" (which corresponds,
roughly, to packages) in a platform-independent form, instead
of using the current platform's convention.

Using the current platform's covention works badly when
cross-compiling for Windows on Unix, since relative paths are used as
keys in the "info-cache.rktd" table. For example, updating a
pre-installed package on Windows mangles the mapping if the installer
is created from a cross-compiled installation.
2017-04-09 08:16:56 -06:00
Ben Greenman
3bb131ecb2 add #:generate keyword to build-flat-contract-property
the public function was missing the `#:generate` keyword,
 added this and documented why `#:exercise` is missing
2017-04-08 21:37:39 -04:00
Sam Tobin-Hochstadt
9d26d675a7 Provide srcloc when constructing define in define/contract. (#1660) 2017-04-08 14:38:59 -04:00
Vincent St-Amour
73d28d88d2 Post-release version for the v6.9 release 2017-04-07 13:30:52 -05:00
Matthew Flatt
5fb86dc55e fix ad-hoc hash-ref optimizaiton
Optimization to convert `(hash-ref <ht> <key> (lambda () <constant>))`
to `(hash-ref <ht> <key> <constant>)` didn't check that the `lambda`
for had zero argument.

Closes #1648
2017-03-30 18:45:26 -04:00
Matthew Flatt
92a0dcbcb0 fix problems with chaperoning/impersonating keyword functions 2017-03-29 12:26:48 -06:00
Ben Greenman
30aa951db8 gzip: use path-add-extension as default
instead of `string-append`-ing the extension,
 because that doesn't work for all path strings
2017-03-26 20:58:59 -04:00
Ben Greenman
2cbd44d64d add optional 'sep' argument to path-add-extension
New optional argument to 'path-add-extension',
 a byte string to replace for the '.' in the argument path.
2017-03-26 20:58:53 -04:00
Matthew Flatt
e22a5da06c find-relative-path: case-normalize for comparison by default
This change affects programs only on Windows. For example, `C:\a\b`
relative to `c:\A\c` is `..\b`, instead of not relative.

Closes #1603
2017-03-24 20:00:03 -06:00
Matthew Flatt
41e3deab97 racket/cmdline: fix table filtering when #:ps is used 2017-03-24 17:28:22 -06:00
Alex Knauth
7163c6ad98 generics: optional scope argument for private macros (#1644)
* generics: optional scope arg for private macros

To make them more friendly to macros that expand to generics

* add tests for generic-method-table macro
2017-03-24 15:52:44 -07:00
Gustavo Massaccesi
409321c03b raco: show all the matching commands for an ambiguous prefix 2017-03-24 13:16:36 -06:00
Matthew Flatt
424906af0a ffi/com: fix unsigned-int test
Closes #1633
2017-03-22 12:26:02 -06:00
Marc Burns
1309cf1649 Add procedures like port->X but close the port (#1634) 2017-03-16 15:52:43 -04:00
Robby Findler
9b987800fb adjust things so that integer-in contracts can have other names 2017-03-08 09:31:33 -06:00
Robby Findler
f5c5db3b3d fix a bug in recent and/c improvements and add proper printing for integer-in 2017-03-07 20:40:26 -06:00
Robby Findler
3a639d7794 improve interaction between natural?, exact-positive-integer?, exact-integer?,
and/c, and between/c (which implies <=/c and >=/c) so that they turn
themselves into integer-in when appropriate

for example, (contract-stronger? (integer-in 0 4) (and/c natural? (<=/c 4)))
returns #t
2017-03-07 16:38:35 -06:00
Robby Findler
87e024d55c allow #f as arguments to integer-in 2017-03-07 16:27:18 -06:00
Robby Findler
7c3412957a add the same fast path to contract? and chaperone-contract? that is already in flat-contract? 2017-03-07 16:27:18 -06:00
Robby Findler
36368628af adjust -> expansion to make it more friendly to possible inlining 2017-03-07 16:27:17 -06:00
Benjamin Greenman
6e746891ef clarify error message for take and drop (#1582) 2017-03-06 18:45:09 -05:00
Benjamin Greenman
d8b78e823e relax contract for (random min max [rand-gen]) (#1626)
Relax contract for `(random min max [rand-gen])` to accept any pair of
integers such that:
- `(< min max)`
- `(- max min)` is between 1 and 4294967087
2017-03-06 18:43:04 -05:00
Robby Findler
dbddb3785e add natural? to the known predicates with generators 2017-03-05 21:35:20 -06:00
Leif Andersen
1cbd75436b Eta expand natural?
Doing this eta expansion has the advantage that error messages
will point to `natural?` rather than `exact-nonnegative-integer?`
2017-03-03 09:58:19 -05:00
Matthew Flatt
1d61d9b752 add 'vm mode to system-type 2017-03-03 06:56:09 -07:00
Leif Andersen
1ebb3d5ef3 nonnegative-integer -> exact-nonnegative-integer 2017-03-02 19:24:12 -05:00
Leif Andersen
1ac2e77d00 Add natural? as an alias for nonnegative-integer? 2017-03-02 19:24:12 -05:00
Leif Andersen
c911e4b52d Add the following predicates to racket/math:
- positive-integer?
- negative-integer?
- nonpositive-integer?
- nonnegative-integer?

These are like their exact-* counterparts provided by racket/base,
but they work for inexact numbers, and not just exact ones.
2017-03-02 19:24:12 -05:00
Matthew Flatt
d08a4cddfb fix stack-overflow handing lin the compiler's letrec-check pass
Closes #1621
2017-02-27 09:43:59 -07:00
Matthew Flatt
f19d655cbc fix optimizer bug related to single-use functions
Fix problem with once-use tracking and delayed variable-use marking
that is performed for local function bodies. A delayed variable-use
registration might happen after a once-used variable is replaced by
its use.

This scenario is difficult to provoke, because the optimizer has to
first decide not to move a once-use function, and in a latter pass
decide to move it after all. There's not enough information to
retract the tentative use plus its transitive implications.

The solution is to avoid the generic once-use layer for `lambda` forms
whose uses are delayed (and that likely has a good effect on inlining
anyway). The other half of the solution is to avoid transitive use
marking on a once-used variable whose expression has been moved (and
there are no transitive things to skip, because that expression isn't
a `lambda` form).
2017-02-26 08:58:36 -07:00
Matthew Flatt
a7ac75f15d use RTLD_LOCAL when loading extensions on Mac OS
It appears that Mac OS wants `RTLD_LOCAL` in the dlopen() call,
otherwise dlsym() searches through all previously open shared objects
– even though dlopen() is given a specific library handle.
2017-02-25 13:57:48 -07:00
Matthew Flatt
3c563484c6 fix memory-management bug in struct->vector
Closes PR 15410
2017-02-25 08:32:08 -07:00
Matthew Flatt
481dc9b0e8 fix port line, col, and pos to stay at #f when set to #f 2017-02-23 19:56:21 -07:00
Matthew Flatt
39b2a61700 fix mutability checking in impersonator-struct
Thanks to Scott Moore for the repair.
2017-02-23 19:56:21 -07:00
Jay McCarthy
fafa9c2bbd Merge pull request #1618 from leafac/fix-git-checkout
Fix “git-checkout”
2017-02-13 10:29:51 -05:00
Leandro Facchinetti
7ae83ba1e6 Fix “git-checkout” by adding HTTP auto-reconnect 2017-02-11 08:55:41 -05:00
Robby Findler
0ace11ddcd fix bug in build-source-location
closes #1605
2017-02-10 20:43:11 -06:00
Alexis King
6632beeca9 Fix wrap-expr/c and expr/c to reflect the intended use
The expr/c syntax class, as well as its underlying implementation
function, wrap-expr/c, previously produced misleading error messages.
The main purpose of these tools is to ensure a user-provided expression
conforms to a macro-provided contract. However, contract errors produced
by these forms were consistent with situations where both value and
contract were provided by the same party.

This fixes the discrepancy by changing how these forms assign blame to
emulate contract errors that arise from improper function arguments,
since most expressions provided to macros are semantically similar to
function arguments. All examples within the documentation itself
reflect this use case.

These changes alter the contents of error messages raised by expr/c and
wrap-expr/c, which could theoretically break some test suites, but it’s
extremely unlikely that any non-test code would depend on the precise
wording of contract error messages, and the interface is otherwise
completely backwards-compatible.

fixes #1412
2017-02-08 11:04:04 -05:00
Matthew Flatt
a5e7972bde JIT: fix handling of index argument to bytes-set!
When the second argument to `bytes-set!` is a reference to a
module-level variable that is definitely defined but not a known
constant, then an incorrect reordering was used that would cause
the third argument value to get overwritten before the call.

Closes #1601
2017-02-08 07:52:52 -07:00
Matthew Flatt
b3223ad8d2 bytecode compiler: add missing stack check in SFS pass
C-implemented recursive pass needs stack-overflow
check and handling.

Closes #1607
2017-02-06 17:19:57 -07:00
Matthew Flatt
2333251a26 note OpenSSL upgrade for native libraries 2017-02-06 17:19:57 -07:00
Robby Findler
84048f6776 avoid call to coerce-contract when we know it is already a contract 2017-02-05 14:37:04 -06:00
Robby Findler
8c5c8da1a7 fix fast path to not ignore pre/post conditions and bail out appropriately 2017-02-05 14:36:43 -06:00
Sam Tobin-Hochstadt
71a43f34c8 Use correct base path for finding gracket. (#1609)
Fixes error in http://drdr.racket-lang.org/38697/pkgs/compiler-test/tests/compiler/embed/test.rkt#output1
2017-02-03 15:19:28 +00:00
Sam Tobin-Hochstadt
8a49a8e545 Fix for PLT_DELAY_FROM_ZO custodian. 2017-02-02 17:06:40 +00:00
Ryan Culpepper
2def574c3c syntax/parse: clean up "at"/"within"-term handling
Added comments and examples about "at" and "within" terms
Fixed ps->stx+index bugs related to struct and vector patterns
2017-02-02 01:06:14 -05:00
Ryan Culpepper
de60c00f56 syntax/parse: fix ps->stx+index; fixes #1602
Collapse CDR frames separated by ORD, POST, etc. For example,
(1 ORD 2 stx) should be same as (3 stx).
2017-02-02 00:25:20 -05:00
Stephen Chang
fe9f0e6e92 fix segfault when using preserved stx prop with non-interned-symbol key
closes #1594
2017-02-01 22:21:04 -05:00
Matthew Flatt
69d7636770 fix position counting with internal read shortcut
The primitive `read` uses a shortcut --- a private "ungetc"
implementation --- that did not count position correctly for
non-ASCII characters.

Closes #1599
2017-01-30 20:01:22 -07:00
Matthew Flatt
6c9dbea31f make pretty-print-newline work on any output port
The documentation says that it should work on any output port,
although there's special treatment of ports that originate
from `pretty-print` itself.

Closes #1579.
2017-01-30 05:41:49 -07:00
Matthew Flatt
572b96a6ef add 'gui-bin-dir as a separate configuration option
Allow the directory for GUI executables to be specified as different
from console executables. The defaults for those two are different
on Mac OS, and configuring them differently might be useful to
address #1575.

Although there is probably no demand on Windows or Unix for splitting
the console and GUI bin directories, this patch tries to make things
work sensible there. On Windows, there's a corner case where a
launcher that starts GRacket (especially with `-z`) is intended to be
a console executable. The launcher creator can be told that via a
`subsystem` option, but a new `#:console?` argument was needed for
`make-gracket-launcher-path` lets the path selector know.
2017-01-30 05:41:49 -07:00
Sam Tobin-Hochstadt
80abc0a020 Fix warning. 2017-01-30 12:40:23 +00:00
Gustavo Massaccesi
a21b33a760 mark struct operations as single valued and mark preserving
Also, the optimizer recognizes struct operations as procedures,
so it will reduce

  (procedure? my-struct?) ==> #t
2017-01-29 20:05:46 -03:00
Gustavo Massaccesi
601587c068 advance effect clocks after reductions
After some reductions, the new rator advance less the effect
clocks than the original rator. For example in

    (equal? x 7) ==> (eq? x 7)

    (my-struct? x) ==> #t or #f
2017-01-29 20:05:46 -03:00
Gustavo Massaccesi
b73e1dfd6c consider the flags of unclonable lambdas for reductions
The lambdas can be marked as single valued and/or mark preserving.
With this information is possible to remove unnecessary wrapping
like the `values` in

    (let ([f (lambda () '(1))])
      (display f f)
      (values (f)))

or in reductions like

   (car (list (f))) ==> (values (f)) ==> (f)

Moreover, this is useful to test that the optimizer has marked
correctly the function f as single valued and mark preserving.
2017-01-29 20:05:45 -03:00
Matthew Flatt
aa130df8b2 fix prop:custom-write printing on structure ports
When a `prop:custom-write` function prints to a given port for
recursive printing, don't reject a port that is a structure port.

Relevant to #1579
2017-01-27 18:04:20 -07:00
Matthew Flatt
03f2deeea9 fix module->namespace problem resoring bindings
If a module has any sort of complex bindings, such as a definition of
a macor-introduced identifiers, then `module->namespace` and variants
(like `variable-reference->namespace`) need to recreate suitable
bindings. Make sure that the module-path index for recreated bindings
is the run-time one, not the compile-time one.

Closes #1584
2017-01-27 17:30:35 -07:00
Gustavo Massaccesi
0a5c510b72 advance the vclock for a values with 0 or more than 1 argument
To avoid moving expressions that may have a side effect, the optimizer must
recognize that in this position this will cause an error and advance
the virtual clock.

Currently the only primitive that is flagged as SCHEME_PRIM_IS_OMITABLE and
may have multiple return values is `values`.

Thanks to Robby for finding the original version of the test.
2017-01-27 18:18:26 -03:00
Matthew Flatt
0e12201c4d fix bytecode writer for immediate compile-time values
When a hash table or other special value appears immediately on the
right-hand side of `define-values`, it needs to be protected by an
explicit quote when writing to bytecode.

Closes #1580
2017-01-27 09:07:53 -07:00
Matthew Flatt
89512edad9 fix JIT handling of struct type property predicates and accessors
When the JIT guesses that a rator will always be a struct type
property or accessor, the run-time check to confirm that guess
was broken.
2017-01-27 07:53:03 -07:00
Jay McCarthy
420330fef0 Protecting literal data, like vectors and hashes, from tagged paren styles 2017-01-25 17:47:39 -05:00
Vincent St-Amour
45bacf4917 Update raco pkg new for v6.8.
(cherry picked from commit 420f4795b6da2b8206ec9e2812d42123b8284fa1)
2017-01-24 14:50:13 -06:00
Georges Dupéron
e311d671de Applied changes requested by @rmculpepper for PR #1587 2017-01-23 20:32:40 -05:00
Georges Dupéron
6a07a3f986 Fixes several issues with syntax/parse, and adds some tests.
* byte-regexp? values should not be considered 3D syntax.
* hash? values are now allowed in serialized syntax properties with (template … #:properties (…))
* marshalling properties which were prefab structs called map on the result of struct->vector, changed it to struct->list as the struct "name" is always serializable.
2017-01-23 20:32:40 -05:00
Matthew Flatt
a9ae341105 in-bytes: use unsafe-bytes-ref
In the same way that `in-vector` uses `unsafe-vector-ref`,
make `in-bytes` expand to a use of `unsafe-bytes-ref`.
2017-01-22 07:57:46 -07:00
Matthew Flatt
aead07b5de bytecode compiler: fix misuse of "optimize" mode on a "resolved" form
Thanks to Robby for the test.
2017-01-20 21:35:09 -07:00
Matthew Flatt
736cdfb2c1 yet more repairs to the interaction of errors and let-values
Continuing the saga that includes 8190a7730d and d1ba9fbb6e, it turns
out that a 0-binding clause as the last one isn't so special after
all. A little later in the optimizer, now that we're sometimes moving
an error to the body, we can't assume that the body can be discard
if an error was detected.
2017-01-20 18:07:05 -07:00
Gustavo Massaccesi
d1ba9fbb6e fix wcm on error in let's
Repairs a problem with 8190a7730d, which can incorerctly
move an erroring experssion into tail position.
2017-01-20 15:04:11 -07:00
Matthew Flatt
8190a7730d fix optimizer bug related to errors and zero-values binding 2017-01-20 12:19:05 -07:00
Matthew Flatt
d0b5de398e fix internal function names 2017-01-20 10:44:25 -07:00
Matthew Flatt
80e8e0f9e0 fix a mismatch between the optimizer and validator
Thanks to Leif for the report and test case.
2017-01-18 15:39:38 -07:00
Matthew Flatt
ecaa14544f add v6.8 HISTORY note 2017-01-16 15:40:34 -07:00
Matthew Flatt
3f2de918d8 fix variable-reference->namespace for phase > 0
Set up bindings and shift phases as needed to make
`variable-reference->namespace` work in a run-time position when the
enclosing module is instantiated at a phase other than 0.

Thanks to Rohin Shah for the bug report.
2017-01-16 08:53:57 -07:00
Matthew Flatt
b138c340e1 fix extended {read,peek}-char-or-special
The changes in 08ca76b741 require the primitives to be reclassified
from non-CM to general.

Also, add an internal shortcut for checking arity.
2017-01-15 10:02:57 -07:00
Matthew Flatt
2cf6691439 expose read capabilities of string->number
Extend the `string->number` parser for use by readers, which need
error messages and/or extflonum results.
2017-01-13 08:09:19 -08:00
Matthew Flatt
08ca76b741 extend {read,peek}-char-or-special
Support an external implementation of `read-syntax` by exposing
functionality that is currently internal to `read-syntax`: a srcloc
argument to a "special"-producing port function and wrapping special
results to reliably distinguish them from characters.
2017-01-13 08:09:18 -08:00
Matthew Flatt
7ef20dd606 transplant-output-port: defend against weird ports
Avoid an error within `transplant-output-port` if the given output
port's position somehow goes down instead of up.

Merge to v6.8
2017-01-11 08:06:25 -07:00
Matthew Flatt
a860791d6f Windows: avoid using pipe code for file redirection
When Racket is run with stdout or stderr redirected to a file,
then it must be treated as a regular file, otherwise flushing
and position counting doesn't work right.

Merge to v6.8
2017-01-11 06:48:07 -08:00
Michael Myers
e2070b882d Replace arithmetic with bit operations
quotient/remainder is replaced with word-index and bit-index, expt with arithmetic-shift.
2017-01-10 21:59:22 -06:00
Gustavo Massaccesi
3eb86584c0 use flags of lambdas if they can't be inlined
Merge to 6.8 release.
2017-01-10 14:39:09 -03:00
Matthew Flatt
aa9d5e5614 expander: avoid misinterpreting unforced module context
Use the simple-scope shortcut only when the module context
is itself simple.

Merge to v6.8
2017-01-10 09:40:46 -07:00