Commit Graph

761 Commits

Author SHA1 Message Date
Matthew Flatt
ddf4322ef2 ignore result of mktime
The result of `mktime` is -1 for an error. The result is also -1 if
the time is 1 second before the epoch. That's not useful, so ignore
it.

original commit: aa8ca31cef223128fd8ed1abdc76beb31a0e077a
2019-11-23 19:54:30 -05:00
Gustavo Massaccesi
6789fd84c1 Use system flag of primitives to avoid check in primvars.ms
With this flag the primitive is not tested in primvars.ms but other
parts of the compiler can use the signature/flags.

Also, add a signature to every system boolean primitive.

  primvars.ms, primdata.ss

original commit: ee023c673bda6557bc223de7f8b0e732600619bc
2019-11-15 17:03:00 -03:00
Matthew Flatt
8c82d4e5b7 fix continuation-attachment optimization and non-single-value primitives
original commit: 6180395ad38887c6278e96a6cea9e0a4aad2453a
2019-11-05 17:49:50 -07:00
Matthew Flatt
f0dc15c335 mark single-valued internal primitives
Probably makes no difference right now, since these internal functons
rarely show up in the process of optimizing user programs, but just in
case.

original commit: b54a288b31731368dbcf57c95b78f0a162c29147
2019-10-28 11:41:37 -06:00
Matthew Flatt
9ae0e9b971 fix call/cc inside call-...-continuation-attachment
Can't simply use a continuation reified by an attachment
operation, because it is probably a 1-shot continuation
that needs to be promoted.

original commit: 8201aff06df8011ffbc41f217d50e4c430d75bb5
2019-10-24 05:40:55 -06:00
Matthew Flatt
f52283de7e semi-inline call/cc in tail position
Effectively, change a `call/cc` call to `let/cc` when it appears in
the tail position of a function. This change takes advantage of
continuation-reification support that was built for continuation
attachments.

original commit: 4c015a5b55f7d04839a0efd8e5554fc237e4663b
2019-10-23 08:33:01 -06:00
Matthew Flatt
bed6036b26 fix test for folding of mutable field access
original commit: e173ef6374751631dd16441dad3feadd7dcbfe1e
2019-10-16 09:08:13 -06:00
Matthew Flatt
e53a4a8de2 disallow constant folding of mutable field access
original commit: 7ac8cd69fc709200c1c0064f8031855a950ea8d3
2019-10-16 08:52:12 -06:00
Matthew Flatt
4341bba898 don't try to constant-fold $record-ref
It's not safe, so atempting to fold is not safe.

original commit: 0178656e87155947426bca6edf4e26bab6626ae0
2019-10-13 18:07:27 -06:00
Matthew Flatt
b34084640b pseudo-random-generator-seed! should allow 0
original commit: 1802cca10ec6abfe4bc177a4d4d9fa0d9a201517
2019-10-07 20:08:41 -06:00
Matthew Flatt
18d18b7ff6 add pseudo-random generator API
The MRG32k3a generator is fast when using unboxed floating-point
arithemtic. Since the Scheme compiler doesn't yet support that,
build MRG32k3a into the kernel and provide access via
`pseudo-random-generator` functions.

original commit: 3dd74679a6c2705440488d8c07c47852eb50a94b
2019-10-07 10:58:39 -06:00
Matthew Flatt
174c416f9e repair for opportunistic 1-shot
If normal 1-shot continuations are mixed with opportunistic 1-shot
continuations created by `call-setting-continuation-attachment`, then
promoting an opportunistic 1-shot at a GC is wrong unless the whole
chain is promoted.

original commit: 2dfac475666763b60935e382386af4438f3029e0
2019-09-24 11:41:50 -06:00
Matthew Flatt
c2e78cd676 skip unnecessary check for reified frame
Since we've effectively inlined the check, make the
`reify-cc` intrinsic always just reify.

original commit: 747a8a0165c62f63cd6560dbaa9cc8b09fc9ec50
2019-09-19 12:12:34 -06:00
Matthew Flatt
4e3b829227 add $app
Using `#3%$app` disables a `procedure?` check in an application.

original commit: d7960da9e3c3a864a4df42cb8bb71d9b205aeb95
2019-09-19 07:30:42 -06:00
Matthew Flatt
ee7efa1dc3 unbreak 64-bit Windows build
Fix typo in d8cb953259.

original commit: ebfa3460fd58c47df8eaf70d67db119147364bc2
2019-09-13 10:22:15 -06:00
Matthew Flatt
77ea4ccb78 add scheme-fork-version-number
Include an extra part in the Chez Scheme version number, which both
helps indicates the Racket fork and versions it.

original commit: 00678e29bb9f05de2ccaec8585126e967cdcc6f4
2019-09-13 07:09:13 -06:00
Matthew Flatt
f1a839069d fix __collect_safe and arguments/results in x86_64 floating-point registers
original commit: d8cb953259faeb8cbab8f66c365ac87eb37ad0f6
2019-09-13 06:09:47 -06:00
Matthew Flatt
114a0c44ea sync experr
original commit: 8e84522597b67b5c046d7431da4b592332ce3785
2019-09-13 06:09:47 -06:00
Matthew Flatt
c57de26c1d add call-consuming-continuation-attachment
Also, rename `call-with-current-continuation-attachment` to
`call-getting-continuation-attachment`.

original commit: e2a00e6d641b92918c4911c27ba14949748fd291
2019-09-11 17:07:11 -06:00
Matthew Flatt
b842a134fd continuation-attachment performance
Add a shortcut check when refiying the continuation frame in tail
position, which is significantly cheaper when the frame is already
there. We pay down the check by skipping an attachment-lists check
that is not needed if the frame is newly reified.

Aslo, add a one-shot continuation-frame cache, which makes a shallow
temporary attachment cheaper, as in

 (let loop ([i N])
   (if (zero? i)
       0
       (loop (call-setting-continuation-attachment
              i
              (lambda ()
                (f (sub1 i)))))))

The cache is just one frame. Keeping a chain of allocated-by-not-GCed
frames doesn't pay off.

Meanwhile, remove the leftover `$shift-attachment` library entry.

original commit: 1f454f536b1d7efe20fe9e793cda31e54e31e5f4
2019-09-11 09:34:42 -06:00
Matthew Flatt
502b0b5f50 repair for locked-object handling and multiply-locked values
Weak pairs, ephemeron pairs, some symbols, and some ports were handled
incorerctly when locked multiple times.

original commit: 847fc1c84496f67cd363c8411d0023339f4d6246
2019-09-01 08:57:14 -06:00
Matthew Flatt
2f4d59de0f remove unused binding
original commit: a4732d58666d80e78af5e1cde4c796d3eeae20e7
2019-09-01 07:13:23 -06:00
Matthew Flatt
c195288251 scalable object locking
The `unlock-object` operation was O(N) with N currently locked objects
--- so, O(N^2) to lock N objects and then unlock them --- because
locked objects were stored in and searched in a global list. Also, GC
was O(N) at any generation with N locked objects across generations,
since every locked object was scanned.

Fix these poblems so that locking and unlocking is practically O(1)
and GC is not poportional to locked objects. More precisely, locking
and unlocking is now O(C) for locking an individual object C times to
be balanced by C unlocks. (Since multiple locks on a single object
is rare, this performance seems good enough.)

The implementation replaces the global list with segment-specific
lists. Backpointers are managed using the general generational
support, so that unmodified, old-generation locked objects do not
need to be swept duing a new-generation collection.

original commit: a57d256ca73a3d507792c471facb7e35afbe88b3
2019-09-01 07:03:16 -06:00
Jon Zeppieri
625c466ee7 Adds hashtable-ref-cell
... and eq-hashtable-cell and symbol-hashtable-ref-cell,
which are just like hashtable-cell, except that if the given
key isn't present, they return #f instead of mutating the table.

original commit: c1ab89fc2152ba41f50c0a5b0e5857fc48fc63c1
2019-07-26 16:02:55 -06:00
Matthew Flatt
ce9df2f827 Merge github.com:cisco/ChezScheme
original commit: c5d71168eb4315f7e8ec9c0acf615fa0b9a2fc88
2019-07-26 04:29:00 -06:00
Alexander Shopov
3fec9b8bba Try to eliminate dead stores (#444)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
original commit: 84a6a6ab36294c73dbdc617d19c42fada42c3a15
2019-07-25 15:05:48 -04:00
Alexander Shopov
f3cc313d96 Add additional check to prevent going before start of buffer (#446)
p is a pointer that iterates over path, which is buffer.
We should not try to get to an address preceding its start.
Since there was an execution path that leads to that,
guard against it with an additional check.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
original commit: de8d0e742f44c80735a682bd05019246c2087d56
2019-07-25 15:00:18 -04:00
5pyd3r
0df195f066 fix ee_read_char to handle ^@ properly
original commit: e962a03987470d0a3937446c10af3a94793ffc43
2019-07-25 14:48:38 -04:00
tokomikea
2647c0df24 export ee-backward-delete-sexp binding in the expression-editor module. (#439)
original commit: a851ea3299044c58f559e700004c590dfed462e9
2019-07-25 14:41:55 -04:00
Bob Burger
6ab0111073 Merge branch 'bsd'
# Conflicts:
#	LOG

original commit: b6f861e6266f42f8cb0c4d2db9c3ebed5b98e35c
2019-07-25 14:35:27 -04:00
Alexander Shopov
8c891262a1 Use setenv rather than putenv on non WIN32 environments
Signed-off-by: Alexander Shopov <ash@kambanaria.org>

original commit: 8bf1e18853d5feeb64aadb631c35641cd0ab4748
2019-07-25 16:06:48 +02:00
Matthew Flatt
ed8794d83d fix check for arity wrapper and non-fixnum-width arg count
Closes racket/racket#2746

original commit: 633cab4d38d8d22a0425f5554d80faba925dfdde
2019-07-17 16:43:32 -06:00
Matthew Flatt
368d079d24 adjust build for BSDs, MinGW cross-compile, and more configuration
Includes joint work with @abmclin, @pmatos, and @jessealama.

original commit: 2649600c68ff57efb63d6d5d10c9d9f73368f59a
2019-07-06 13:16:57 -06:00
Matthew Flatt
463677304a configure with --libkernel as the default
original commit: f5f609214c3ee8eed083f05b508095df1aac40de
2019-07-05 07:30:51 -06:00
Matthew Flatt
71846161f9 Merge branch 'bsd' of github.com:mflatt/ChezScheme
original commit: 198477a40c2c580924d95491e63d80e1f9a39c0d
2019-07-05 07:30:37 -06:00
Matthew Flatt
1de465c474 add --kernelobj configure option
Although `--kernelobj` is the default, allow it to be specified
explicitly, in case it makes sense eventually to change the default.

original commit: 46813ea67dd115d87924422373ea684b75e2772c
2019-07-04 13:28:53 -06:00
Matthew Flatt
c38194c0ca adjust build for BSDs, MinGW cross-compile, and more configuration
Includes joint work with @abmclin, @pmatos, and @jessealama.

original commit: 70559d074f70dcadec5cea3619f75f91fcda77eb
2019-07-03 18:54:04 -06:00
Alexander B. McLin
dcffbe1d8b Change make to $(MAKE) so it works more reliably on FreeBSD
and other platforms using non-GNU make systems.

original commit: 281a2b3ae12c13f15c14c2ba8968d40c28caacbf
2019-07-02 11:30:59 -06:00
Alexander B. McLin
6a56c06b1d change update-revision to use #!/bin/sh
Previously it was using #!/bin/bash as its interpreter. It is not
compatible with FreeBSD because bash is not installed by default.

The update-revision script is #!/bin/sh compatible and there are
other examples of #!/bin/sh scripts in the codebase so the change
is consistent with them.

original commit: 0ad188cdbd618b369e7fe6d2b9446251fe92e891
2019-07-02 11:30:59 -06:00
Paulo Matos
a3f325bbea mark functions that never return as NORETURN
original commit: 6377313ecb063273b573139c9e91de263e191e60
2019-07-02 11:30:59 -06:00
Matthew Flatt
91ba34b886 fix open-string-input-port on immutable strings
original commit: 58663d92a353969e3b27de2e1a44df571036e1b2
2019-07-02 13:17:39 -04:00
Matthew Flatt
98381f0206 Merge branch 'strport' of github.com:mflatt/ChezScheme
original commit: 4ae71d2bac241154aad565a6006454fb394fc9fb
2019-07-01 16:56:05 -06:00
Matthew Flatt
7974eac7dc Merge github.com:cisco/ChezScheme
original commit: d9c77749cc1901a9f5fabb4d78055675f5333be3
2019-07-01 16:55:14 -06:00
Matthew Flatt
5053fbb98d fix open-string-input-port on immutable strings
original commit: 48b0ace8b6fba756d8573698db4244472c64255f
2019-07-01 16:44:45 -06:00
Matthew Flatt
5f92ffa3c4 improve asin acos on +inf.0 and -inf.0
Avoid tripping into +nan.0 by using 0 instead of 0.0
for the imaginary part of a real number and by using
`atan` with two arguments instead of one.

original commit: e3f499adfbcbe94726fe11869ca23176fa2c3b78
2019-06-28 15:58:17 -06:00
Matthew Flatt
d31368fc09 improve expt on exact non-integer second argument
Correct the case that converting the second argument to an inexact
numbe produces an integer by losing precision.

original commit: 467db7fa1f1d068e9bad250b93044d157cd3806d
2019-06-28 14:33:18 -06:00
Matthew Flatt
35a0dfcafe improve precision of complex-number divide
original commit: 4c9a7f6abb1258158d48fcdb656de300902cf3c7
2019-06-28 10:42:57 -06:00
Matthew Flatt
57c997042e repair for make-object-finder with threads
The `(cdr tc-ptr-offsets)` in the recrusrion was wrong, but use
`thread->objects` and `thread->stack-objects` to work more generally.

original commit: fd620699dc620d3d1a522800a7dfaff6cc0393bb
2019-06-26 12:32:02 -06:00
Matthew Flatt
dd0fe4ac40 unbreak MSVC build
Move `NORETURN` of 2e3a618b00 to start of function declaration, where
it works for both GCC and MSVC.

original commit: 10fc4a2406ecd34fa686d9d643ee63d7c12d6f97
2019-06-23 05:57:53 -06:00
Matthew Flatt
9f1fe73797 change build to use archives instead of merging objects
Merging ".o" files to one "kernel.o" can be convenient for further
linking, but it requires running `ld` directly. Running `ld` directly
sometimes runs into a mismatch between the C compiler and the default
`ld`. It's better to use the more typical approach of collecting
objects into an archive.

original commit: 7d5b60c7566570655e567495d86d546101cf8fb4
2019-06-21 18:53:33 -06:00