Commit Graph

176 Commits

Author SHA1 Message Date
Matthew Flatt
3a2659968a prefer closest binding name for procedures
In some cases, such as

 (define g (let ([f (lambda (x) x)]) f))

the inner name `f` could get replaced by the outer name `g`.
Prefer the inner name so that macros can use a `let` wrapper
to reliably name a procedure.

cherry-picked from mflatt/ChezScheme#letname

original commit: fb75f08cfa9690f94ae2abaa237278b287367d68
2018-06-22 09:33:12 -06:00
Matthew Flatt
261cb9ce1d Merge branch 'pthread' of github.com:mflatt/ChezScheme
original commit: 72597bafba6ff6290ac801aea1390e50252d8f7a
2018-01-22 17:09:55 -07:00
Matthew Flatt
4a2dc8d182 Merge branch 'rendezvous' of github.com:mflatt/ChezScheme
original commit: cccdcf961dfd3de8e2e7d0da651ef827bc128258
2018-01-22 17:08:49 -07:00
Matthew Flatt
1e95b761f1 Add __thread foreign-call convention
See the `foreign-callable` docs for a good example use.

original commit: 3645f7568c7ab9ca6a9459a870338b51605a2c6c
2018-01-22 17:06:19 -07:00
Matthew Flatt
a590b5ec35 add collect-rendezvous
original commit: 73cf31d3625e519493918faba650bbfc303f1712
2018-01-22 17:01:46 -07:00
Matthew Flatt
0c55348453 Merge branch 'fdstart' of github.com:mflatt/ChezScheme
original commit: 67f4cfc11da128038a7d631b77af8909a8901247
2018-01-15 19:40:49 -07:00
Matthew Flatt
1f77eaf2af add load-compiled-from-port and Sregister_boot_file_fd
original commit: 0865b4637fce16079cb9ad8d3eb6211f1bf08c9f
2018-01-15 19:39:20 -07:00
Andy Keep
ef497bf210 Merge branch 'bounds' of https://github.com/mflatt/ChezScheme into mflatt-bounds
original commit: b619c426142eaa8ae410138e17d16bd1e7f133e9
2018-01-15 13:10:29 -05:00
Andy Keep
3cedf42ed2 - added tests to ensure the optimize-level version 2 of map and for-each raise
a non-procedure exception when the first argument is not a procedure, even
  when the rest of the program is compiled at optimize level 3.
    4.ms, root-experr-compile-0-f-f-f, patch-compile-0-t-f-f,
    patch-compile-0-f-t-f, patch-interpret-0-f-t-f, patch-interpret-0-f-f-f,
    patch-interpret-3-f-t-f, patch-interpret-3-f-f-f

original commit: 7916447d1a482ec91ae63927692053d727d9b459
2018-01-15 13:07:23 -05:00
Andy Keep
1a35e17a60 Merge branch '17-12-Map-Error' of https://github.com/gus-massa/ChezScheme into gus-massa-17-12-Map-Error
original commit: 154ed6a4113b3f440e9d5a8348270d2ca1ace807
2018-01-13 12:28:11 -05:00
Gustavo Massaccesi
eb9d65d88c avoid building the result list in a map that is called for effect
cp0.ss

# Conflicts:
#	s/cp0.ss

original commit: 12353c17917f0979e72740592891ce928b40963f
2018-01-10 17:59:16 -03:00
Gustavo Massaccesi
d593fe4a78 Check that first argument of map is a procedure in cp02 expansion
to raise the same error that the non expanded version
  cp0.ss

original commit: cf10634c29c5f873e1e77b1868dd58071650dba3
2018-01-10 17:57:06 -03:00
Matthew Flatt
ca082aa7e8 Merge branch 'bounds' of github.com:mflatt/ChezScheme
original commit: fc9b765ed576903919e09f676612359bbbf2231f
2018-01-07 09:18:24 -07:00
Matthew Flatt
1dba8c4624 fix bounds check on immutables values and an immediate index
original commit: fc064b5b91bc5c7da8b7c71441a37e3c05523986
2018-01-07 08:48:57 -07:00
Matthew Flatt
f4f0bfff11 Merge branch 'genid' of github.com:mflatt/ChezScheme
original commit: bd3c746343c6850ed62eb5fcd2674292e4480fa4
2018-01-04 18:47:47 -07:00
Matthew Flatt
3526ab71fa add expand-omit-library-invocations
original commit: 35dbfdaa9ea3832f2ded108b7edcaead61922007
2018-01-04 18:32:27 -07:00
Matthew Flatt
cf87f8c4f6 add current-generate-id
original commit: be555fa7605f17f8613b1c02fe9f5e187a7cfeb9
2018-01-04 18:32:27 -07:00
Bob Burger
350f87ba4d fix bug in date->time-utc caused by incorrect use of difftime in Windows
original commit: 4748dad50c7f0e9b3ba002c27990d4c88c0189fc
2017-12-29 16:48:30 -05:00
Andy Keep
b1a19f79bb Merge branch 'master' into evenodd
original commit: 1c0f190d28f2304a57e5db051a3dea69a914e903
2017-12-28 21:03:59 -05:00
Matthew Flatt
9a51376b5a even? and odd?: reject exceptional flonums, since they're not integers
original commit: 94a28793313c714520635bd09359ef8bde2d52a8
2017-12-28 17:00:04 -06:00
Bob Burger
1a8a6dee21 fix comment about Sscheme_program
original commit: abb991bcd87f64eeae9a3848959191a4da5d6542
2017-12-28 10:54:03 -05:00
Matthew Flatt
c40206fb7a Merge branch 'evenodd' of github.com:mflatt/ChezScheme
original commit: 6f1447cce5be0c105e925197b6f5afab1d5205a2
2017-12-28 07:05:19 -06:00
Matthew Flatt
a092b4d404 even? and odd?: reject exceptional flonums, since they're not integers
original commit: 550c5dd04c102cb11f4f91fda867148d3888f11b
2017-12-28 06:43:36 -06:00
Matthew Flatt
8af0a5de94 Merge branch 'livefix' of github.com:mflatt/ChezScheme
original commit: 7292d4a04806da0f7f07de9404aeedaf00158a4e
2017-12-21 05:35:55 -07:00
Matthew Flatt
3ba909f3c6 avoid quadratics in call-live information
Using a tree representation enables sharing to avoid a quadratic-sized
compiled form and intermediate quadtraic-time/space representations
for a program like this one, where there are N calls each with an
average of N/2 live variables:

 (define vars
   (let loop ([i 10000])
     (cond
      [(zero? i) '()]
      [else (cons (gensym) (loop (sub1 i)))])))

 (time
  (begin
   (compile
    `(lambda ,vars
       ,@(map (lambda (v) `(,v)) vars)))
   (void)))

Keeping the variables in tree form (since they're already collected
that way) and memoizing reduces on the tree allows sharing to be
constructed and preserved. The tree approach persists even to the
runtime mask for live variables.

original commit: 35942accb14d1226189605548a9e05ca95e3f0b6
2017-12-21 05:34:11 -07:00
Gustavo Massaccesi
7a8d824b3d fix a few signatures
s/primdata.ss

original commit: 0886e9807c7ded82dd836b54c963ea8c966d5c54
2017-12-15 20:17:27 -03:00
Gustavo Massaccesi
dc0be2bfbe fix mat of substring-fill!
after the recent change, the result of substring-fill! is void
  5_5.ms

original commit: a2cd9856be74008cc23b6ca3476339e79a1cd5ff
2017-12-15 19:28:43 -03:00
Andy Keep
f1b9fc95da Fixing output of substring-fill! and vector-fill!
- fixed substring-fill! and vector-fill! to return void, reflecting the
  documented return value of unspecified value.  Also changes substring-fill!
  to use define-who instead of repeating 'substring-fill! in all the error
  messages.
    5_4.ss, 5_6.ss

original commit: 3f65788b5422693f3648a9e2fe575f464eb31ccd
2017-12-12 08:43:01 -05:00
Bob Burger
3863e63ef9 added support for Visual Studio 2017.15.5
original commit: 33eaccf5d0105186d66faa76e8463bab9369bf1a
2017-12-07 17:18:22 -05:00
Matthew Flatt
33d037f6a6 Merge branch 'procloc' of github.com:mflatt/ChezScheme
original commit: 552758ee584d142f5e92612676869cd4fde64ede
2017-12-06 08:37:50 -07:00
Matthew Flatt
9f1f5b793f add generate-procedure-source-information
original commit: 45df1f3a517c040a45aaea8f0bd4c9d859310187
2017-12-05 20:40:22 -07:00
Andy Keep
280e3632bb Merge branch 'master' into 17-10-Enumerate
original commit: 1ca717c9ece587f08a654772a72f1452357ca389
2017-12-05 12:22:07 -05:00
Gustavo Massaccesi
1ecfb04a58 fix bytevector-[u/s]16-native-set! signature
original commit: 5d4e2fa1b2cf1ad7011b94b2b5262f734d5f0530
2017-12-05 12:43:49 -03:00
Matthew Flatt
74dbc7d6f5 Merge branch 'arity-wrapper' of github.com:mflatt/ChezScheme
original commit: 3694a08fedfaf7e00eb52c1bbb55ce6df3e081e4
2017-12-02 08:27:01 -07:00
Matthew Flatt
4c2528653e add make-arity-wrapper-procedure
A program can use `make-arity-wrapper-procedure` to synthesize a
function that reports a given arity mask (without calling `compile`).

In addition, `set-arity-wrapper-procedure!` suports modifying the
implementation of a synthesized procedure. Although similar
functionality could be achieved with `(lambda args (apply (unbox proc)
args))`, an arity wrapper procedure can dispatch to another procedure
without allocating a list for the arguments.

The interpreter now uses an internal variant of arity wrappers to
cooperate with `procedure-arity-mask`.

original commit: 295255a326afbf3f120f95c2ccc6e95b74fdd5e2
2017-12-02 08:24:42 -07:00
Andy Keep
07987daf04 Merge branch 'master' into 17-10-Enumerate
original commit: ad54c2dddd68ca5aec37f0837f72cbfdaac6bb7b
2017-11-24 09:27:36 -05:00
Matthew Flatt
bb1a3b0c45 Merge branch 'cas' of github.com:mflatt/ChezScheme
original commit: d9a3e7a9906649406673f49c951137db2a94de8c
2017-11-14 11:18:28 -07:00
Matthew Flatt
93c36a5d38 Merge branch 'fp-struct' of github.com:mflatt/ChezScheme
original commit: 8516339dcdacc19bfb451039e0b31146dc5b3a04
2017-11-14 11:17:36 -07:00
Matthew Flatt
682985ebea Merge branch 'orderfnl' of github.com:mflatt/ChezScheme
original commit: 8a40efa133c07dede4d8ed78f0bdd54625c1fb90
2017-11-14 11:16:44 -07:00
Matthew Flatt
0356a56eae support struct args to foreign procedures
Intermediate version: converting to use stack allocation
for `&` arguments and results in a callable, only x86_64
and x86 updated so far.

original commit: 645e1ec56376548cdef1849ba7ff2f56a926af45
2017-11-14 10:47:36 -07:00
Matthew Flatt
b796bc6719 add box-cas! and vector-cas!
original commit: d5cd34c1497541c71c8b746d5db6b3e35ee717e5
2017-11-13 07:04:15 -07:00
dyb
893dfe5d35 maybe-compile-{file,program,library} and automatic import
compilation now treat a malformed object file as if it were
not present and needs to be regenerated.  A malformed object
file (particularly a truncated one) might occur if the compiling
processes is killed or aborts before it has a chance to delete
a partial object file.
  syntax.ss,
  7.ms

original commit: c2cb8c79a925c0eb2f9d589e3a497712800bd1dc
2017-11-07 21:49:08 -05:00
dyb
59d2ca053c Merge branch 'master' of github.com:cisco/chezscheme
original commit: 5cfeee1f12507b70a1aa9fe1fd2094c8ff592bca
2017-10-30 21:02:54 -04:00
dyb
64b0db8e30 fixed gather-filedata's sort of profile entries. for any two
entries x and y in the list produced by the sort call, if x's
bfp = y's bfp, x should come before y if x's efp < y's efp.
The idea is that enclosing entries should always come later
in the list.  this affects only languages where two expressions
can start at the same character position.
  pdhtml.ss
expanded capability of ez-grammar with support for simpl
parsing of binary operators w/precedence and associativity
and automatically generated markdown grammar descriptions.
ez-grammar-test.ss now also doubles as a test of pdhtml for
algebraic languages.
  mats/examples.ms,
  examples/ez-grammar.ss, examples/ez-grammar-test.ss,
  examples/Makefile

original commit: 53b8d16a1e86f3956585dbec0c7b573e485f7844
2017-10-30 21:01:43 -04:00
Bob Burger
029fe628f3 updated newrelease to handle mats/Mf-*nt
original commit: 02a321479626d2a9e9f5ee0d5b4862eaed4859c8
2017-10-30 17:32:37 -04:00
dyb
9b6b6d32ee attempt to stabilize timing tests let-values source-caching
test and ephemeron gc test while resensitizing the former
  8.ms, 4.ms
various formatting and comment corrections
  workarea,
  s/Mf-base, bytevector.ss, cpnanopass.ss, date.ss,
  5_6.ms, examples.ms

original commit: 19e2505fc6477fce2d1d0e61187bd504b58ea994
2017-10-29 17:48:43 -04:00
dyb
0d236d959c fixed LOG entry
original commit: 328cb00845cc52fa89c3e558bfdab2fcf8f3bee1
2017-10-27 23:21:28 -04:00
dyb
983e8b6c00 Numerous changes to improve register/frame allocation speed for
procedures with large numbers of variables:
- added pass-time tracking for pre-cpnanopass passes to compile.
    compile.ss
- added inline handler for fxdiv-and-mod
    cp0.ss, primdata.ss
- changed order in which return-point operations are done (adjust
  sfp first, then store return values, then restore local saves) to
  avoid storing return values to homes beyond the end of the stack
  in cases where adjusting sfp might result in a call to dooverflood.
    cpnanopass.ss, np-languages.ss
- removed unused {make-,}asm-return-registers bindings
    cpnanopass.ss
- corrected the max-fv value field of the lambda produced by the
  hand-coded bytevector=? handler.
    cpnanopass.ss
- reduced live-pointer and inspector free-variable mask computation
  overhead
    cpnanopass.ss
- moved regvec cset copies to driver so they aren't copied each
  time a uvar is assigned to a register.  removed checks for
  missing register csets, since registers always have csets.
    cpnanopass.ss
- added closure-rep else clause in record-inspector-information!.
    cpnanopass.ss
- augmented tree representation with a constant representation
  for full trees to reduce the overhead of manipulating trees or
  subtress with all bits set.
    cpnanopass.ss
- tree-for-each now takes start and end offsets; this cuts the
  cost of traversing and applying the action when the range of
  applicable offsets is other than 0..tree-size.
    cpnanopass.ss
- introduced the notion of poison variables to reduce the cost of
  register/frame allocation for procedures with large sets of local
  variables.  When the number of local variables exceeds a given
  limit (currently hardwired to 1000), each variable with a large
  live range is considered poison.  A reasonable set of variables
  with large live ranges (the set of poison variables) is computed
  by successive approximation to avoid excessive overhead.  Poison
  variables directly conflict with all spillables, and all non-poison
  spillables indirectly conflict with all poison spillables through
  a shared poison-cset.  Thus poison variables cannot live in the
  same location as any other variable, i.e., they poison the location.
  Conflicts between frame locations and poison variables are handled
  normally, which allows poison variables to be assigned to
  move-related frame homes.  Poison variables are spilled prior to
  register allocation, so conflicts between registers and poison
  variables are not represented.  move relations between poison
  variables and frame variables are recorded as usual, but other
  move relations involving poison variables are not recorded.
    cpnanopass.ss, np-languages.ss
- changed the way a uvar's degree is decremented by remove-victim!.
  instead of checking for a conflict between each pair of victim
  and keeper and decrementing when the conflict is found, remove-victim!
  now decrements the degree of each var in each victim's conflict
  set.  while this might decrement other victims' degrees unnecessarily,
  it can be much less expensive when large numbers of variables are
  involved, since the number of conflicts between two non-poison
  variables should be small due to the selection process for
  (non-)poison variables and the fact that the unspillables introduced
  by instruction selection should also have few conflicts.  That
  is, it reduces the worst-case complexity of decrementing degrees
  from O(n^2) to O(n).
    cpnanopass.ss
- took advice in compute-degree! comment to increment the uvars in
  each registers csets rather than looping over the registers for
  each uvar asking whether the register conflicts with the uvar.
    cpnanopass.ss
- assign-new-frame! now zeros out save-weight for local saves, since
  once they are explicitly saved and restored, they are no longer
  call-live and thus have no save cost.
    cpnanopass.ss
- desensitized the let-values source-caching timing test slightly
    8.ms
- updated allx, bullyx patches
    patch*

original commit: 3a49d0193ae57b8e31ec6a00b5b49db31a52373f
2017-10-27 23:16:47 -04:00
Gustavo Massaccesi
425b39da5b fix enumerate signature
original commit: f28167b985190ebab58a1c58d7693077ee29e96a
2017-10-15 23:11:21 -03:00
Andy Keep
59e6db7a61 Merge branch 'master' of github.com:cisco/ChezScheme
original commit: 1febe9b1a1e1cde4b7be8bc562153ee4b42afd8c
2017-10-14 00:00:19 -04:00