Commit Graph

17 Commits

Author SHA1 Message Date
Matthew Flatt
21fc705234 adjust GC to preserve eq? on flonums
original commit: d405416eb2ec6d5dd147afc7a2af5a6c2f0a8130
2019-01-22 05:24:05 -07:00
Matthew Flatt
6e999d02c3 add ordered guardians
Also, avoid quadratic time in GC for guardian chains.

original commit: 273f79a7be5c04370c399e6b1d8af799efc8b33f
2019-01-22 05:19:38 -07:00
dybvig
f7c414bda3 Various updates, mostly to the compiler, including a new lambda
commonizatio pass and support for specifying default record
equal and hash procedures:

- more staid and consistent Mf-cross main target
    Mf-cross
- cpletrec now replaces the incoming prelexes with new ones so
  that it doesn't have to alter the flags on the incoming ones, since
  the same expander output is passed through the compiler twice while
  compiling a file with macro definitions or libraries.  we were
  getting away without this just by luck.
    cpletrec.ss
- pure? and ivory? now return #t for a primref only if the prim is
  declared to be a proc, since some non-proc prims are mutable, e.g.,
  $active-threads and $collect-request-pending.
    cp0.ss
- $error-handling-mode? and $eol-style? are now properly declared to
  be procs rather than system state variables.
    primdata.ss
- the new pass $check-prelex-flags verifies that prelex referenced,
  multiply-referenced, and assigned flags are set when they
  should be.  (it doesn't, however, complain if a flag is set
  when it need not be.)  when the new system parameter
  $enable-check-prelex-flags is set, $check-prelex-flags is
  called after each major pass that produces Lsrc forms to verify
  that the flags are set correctly in the output of the pass.
  this parameter is unset by default but set when running the
  mats.
    cprep.ss, back.ss, compile.ss, primdata.ss,
    mats/Mf-base
- removed the unnecessary set of prelex referenced flag from the
  build-ref routines when we've just established that it is set.
    syntax.ss, compile.ss
- equivalent-expansion? now prints differences to the current output
  port to aid in debugging.
    mat.ss
- the nanopass that patches calls to library globals into calls to
  their local counterparts during whole-program optimization now
  creates new prelexes and sets the prelex referenced, multiply
  referenced, and assigned flags on the new prelexes rather than
  destructively setting flags on the incoming prelexes.  The
  only known problems this fixes are (1) the multiply referenced
  flag was not previously being set for cross-library calls when
  it should have been, resulting in overly aggressive inlining
  of library exports during whole-program optimization, and (2)
  the referenced flag could sometimes be set for library exports
  that aren't actually used in the final program, which could
  prevent some unreachable code from being eliminated.
    compile.ss
- added support for specifying default record-equal and
  record-hash procedures.
    primdata.ss, cmacros.ss, cpnanopass.ss, prims.ss, newhash.ss,
    gc.c,
    record.ms
- added missing call to relocate for subset-mode tc field, which
  wasn't burning us because the only valid non-false value, the
  symbol system, is in the static generation after the initial heap
  compaction.
    gc.c
- added a lambda-commonization pass that runs after the other
  source optimizations, particularly inlining, and a new parameter
  that controls how hard it works.  the value of commonization-level
  ranges from 0 through 9, with 0 disabling commonization and 9
  maximizing it.  The default value is 0 (disabled).  At present,
  for non-zero level n, the commonizer attempts to commonize
  lambda expressions consisting of 2^(10-n) or more nodes.
  commonization of one or more lambda expressions requires that
  they have identical structure down to the leaf nodes for quote
  expressions, references to unassigned variables, and primitives.
  So that various downstream optimizations aren't disabled, there
  are some additional restrictions, the most important of which
  being that call-position expressions must be identical.  The
  commonizer works by abstracting the code into a helper that
  takes the values of the differing leaf nodes as arguments.
  the name of the helper is formed by concatenating the names of
  the original procedures, separated by '&', and this is the name
  that will show up in a stack trace.  The source location will
  be that of one of the original procedures.  Profiling inhibits
  commonization, because commonization requires profile source
  locations to be identical.
    cpcommonize.ss (new), compile.ss, interpret.ss, cprep.ss,
    primdata.ss, s/Mf-base,
    mats/Mf-base
- cpletrec now always produces a letrec rather than a let for
  single immutable lambda bindings, even when not recursive, for
  consistent expand/optimize output whether the commonizer is
  run or not.
    cpletrec.ss,
    record.ms
- trans-make-ftype-pointer no longer generates a call to
  $verify-ftype-address if the address expression is a call to
  ftype-pointer-address.
    ftype.ss

original commit: b6a3dcc814b64faacc9310fec4a4531fb3f18dcd
2018-01-29 09:20:07 -05:00
Matthew Flatt
9d8cc87758 add locate-source cache and line+column components to source objects
Add optional beginning-line and beginning-column components to a
source object, so that line and column information can be recorded
independent of the file. Add `locate-source-object-source` to use
the recorded information. Add a cache for `locate-source` as enabled by
the `use-cache?` optional argument, which can avoid compilation times
that are quadratic in the number of `let-values` or `define-values`
forms.

original commit: b36fab81d5041a54ce01a422395eee79d2f930bc
2017-08-01 05:23:56 -06:00
Matthew Flatt
59c772ba48 add make-ephemeron-eq-hashtable, etc.
Revert the use of ephemeron pairs in weak hashtables, since the
difference is visible via guardians. Add hashtable based on ephemerons
(to avoid key-in-value problems) as an explicit variant.

original commit: 31ac6d78592e1a9ba6bfbe802260e3d56d4cf772
2017-07-06 16:27:23 -06:00
dyb
2bc65b5d6d check_dirty_ephemeron now puts ephemerons whose keys haven't yet
been seen on the pending list rather than the trigger lists.
  gc.c
removed scan of space_ephemeron from check_heap because check_heap
as written can't handle the two link fields properly.
  gcwrapper.c
in the ephemerons mat that checks interaction between mutation and
collection, added generation arguments to the first two collect
calls so they always collect into the intended generation.
  4.ms
updated allx and bullyx patches
  patch*

original commit: 43b54f64949cf992e52cf18bacc2a09f4a199227
2017-05-29 20:21:01 -04:00
Matthew Flatt
da7a81e8cd improve some function names, comments, and declarations
original commit: 795c391b8417d6aec3d7888e292efbac415029f7
2017-05-24 09:38:59 -06:00
Matthew Flatt
28f98ebc0b fix typo in comment
original commit: 001603fdf9c171e36d620999d5e4760ab333f119
2017-05-24 09:38:59 -06:00
Matthew Flatt
0d5340c061 fix interaction of ephemerons and generations; use for weak hashtables
original commit: 6f7147e505aae5c2b9139eea6df8a9c25a35289d
2017-05-24 09:38:24 -06:00
Matthew Flatt
18cdcd977e add ephemerons
original commit: 8a09c2c3f032e6e30b1ef393d2334963aa70507e
2017-05-24 09:38:24 -06:00
Bob Burger
831ea8ad18 changed copyright year to 2017
7.ss, scheme.1.in, comments of many files

original commit: 06f858f9a505b9d6fb6ca1ac97234927cb2dc641
2017-04-06 11:41:33 -04:00
Kent Dybvig
c503362914 - various tweaks to the immutable object support; also taught cp0
to simplify ($fxu< (most-positive-fixnum) e) => (fx< e 0) so we
  don't have any incentive in special casing length checks where
  the maximum length happens to be (most-positive-fixnum).
    5_4.ss, 5_6.ss, bytevector.ss, cmacros.ss, cp0.ss, cpnanopass.ss,
    mkheader.ss, primdata.ss, prims.ss,
    fasl.c, gc.c, types.h
    root-experr*, patch*

original commit: 9eb63deda025fd4560b54746b21a881c01af46d6
2017-03-15 14:49:58 -04:00
Kent Dybvig
9cd0199a39 merge @mflatt immutable-vector, immutable-string, immutable-bytevector,
immutable-fxvector, and immutable-box support

original commit: 547fce9b99c6566d5cb3f7af9ca84654e798486e
2017-03-15 11:09:57 -04:00
Kent Dybvig
9a16156574 eliminated some direct assumptions that a vector's type/length field
is a fixnum and added meta-asserts to verify that it is in a couple of
others, to facilitate future changes to vector typing.  vectors are
now treated essentially like fxvectors, strings, and bytevectors.
  cmacros.ss, cpnanopass.ss, prims.ss, mkheader.ss,
  alloc.c, gc.c, scheme.c

original commit: 564542d32bbae6b33cef808613238d5a4a2a8ee2
2017-03-12 23:54:38 -04:00
Matthew Flatt
21fe925d06 add procedure-arity-mask
original commit: 4bd061000ab903feb3fe8e3b96ecbcb10c59dba9
2017-02-22 07:16:53 -07:00
Bob Burger
0d0e876fb7 fixed a couple typos in comments
original commit: 9e2347eeb2bd57b35f96f0f1938ef84d624ed6a4
2016-06-23 16:43:39 -04:00
dyb
1356af91b3 initial upload of open-source release
original commit: 47a210c15c63ba9677852269447bd2f2598b51fe
2016-04-26 10:04:54 -04:00