Robin Templeton [Tue, 5 Aug 2014 03:13:03 +0000 (23:13 -0400)]
use defsubst
Robin Templeton [Tue, 5 Aug 2014 03:11:43 +0000 (23:11 -0400)]
defsubst
Robin Templeton [Tue, 5 Aug 2014 03:11:29 +0000 (23:11 -0400)]
compiler macros
Robin Templeton [Tue, 5 Aug 2014 03:08:12 +0000 (23:08 -0400)]
defconst, defvar: proclaim special at compile-time
Robin Templeton [Tue, 5 Aug 2014 03:06:59 +0000 (23:06 -0400)]
elisp @@ macro
Robin Templeton [Tue, 5 Aug 2014 03:06:26 +0000 (23:06 -0400)]
compile-elisp fn
Robin Templeton [Thu, 24 Jul 2014 22:58:38 +0000 (18:58 -0400)]
fix `nil?' type inference
Robin Templeton [Fri, 18 Jul 2014 21:43:20 +0000 (17:43 -0400)]
fix symbol-function
Robin Templeton [Fri, 18 Jul 2014 21:42:59 +0000 (17:42 -0400)]
restore special operator handling
Robin Templeton [Fri, 18 Jul 2014 21:42:07 +0000 (17:42 -0400)]
define-module for elisp special modules
Robin Templeton [Fri, 18 Jul 2014 21:41:48 +0000 (17:41 -0400)]
constant-interning fix
Robin Templeton [Tue, 24 Jun 2014 04:10:10 +0000 (00:10 -0400)]
defvar affects default value
Robin Templeton [Tue, 24 Jun 2014 04:01:56 +0000 (00:01 -0400)]
symbol default value procedures
Robin Templeton [Fri, 20 Jun 2014 03:37:36 +0000 (23:37 -0400)]
read nil/t as #nil/#t
Robin Templeton [Wed, 18 Jun 2014 02:42:14 +0000 (22:42 -0400)]
tree-il evaluator
Robin Templeton [Tue, 3 Jun 2014 00:01:55 +0000 (20:01 -0400)]
elisp updates
Robin Templeton [Sat, 14 Jun 2014 20:16:32 +0000 (16:16 -0400)]
guile-snarf fix
Robin Templeton [Wed, 18 Jun 2014 02:41:45 +0000 (22:41 -0400)]
prefer compilers earlier in list
Robin Templeton [Sat, 14 Jun 2014 07:35:27 +0000 (03:35 -0400)]
Revert "Add thread-local lock-free, TLS-free freelists."
This reverts commit
aef1fcf94e635c51bc1d0849ad1f60a1d1274276.
Conflicts:
libguile/threads.c
Robin Templeton [Sat, 14 Jun 2014 07:33:22 +0000 (03:33 -0400)]
allow arbitrary constants in cps
BT Templeton [Fri, 23 Aug 2013 07:01:36 +0000 (03:01 -0400)]
guile-private-ref
* module/language/elisp/compile-tree-il.scm (compile-guile-private-ref):
New special operator.
BT Templeton [Wed, 31 Jul 2013 02:50:24 +0000 (22:50 -0400)]
multiple obarrays
* libguile/symbols.c (lookup_uninterned_symbol)
(lookup_interned_latin1_symbol, lookup_interned_utf8_symbol)
(scm_i_str2symbol): Take an `obarray' argument. All callers changed.
(scm_make_obarray, scm_find_symbol, scm_intern, scm_unintern)
(scm_obarray_for_each): New functions.
Robin Templeton [Wed, 11 Jun 2014 02:57:05 +0000 (22:57 -0400)]
check symbols constants uninterned
Robin Templeton [Tue, 10 Jun 2014 22:48:07 +0000 (18:48 -0400)]
intern arbitrary constants
Robin Templeton [Tue, 10 Jun 2014 20:03:17 +0000 (16:03 -0400)]
libguile/Makefile.am (snarfcppopts): Remove CFLAGS
Andy Wingo [Sun, 20 Jul 2014 18:52:06 +0000 (20:52 +0200)]
Better simplification of literal constants that continue to branches
* module/language/cps/simplify.scm (eta-reduce): Constants that continue
to branches eta-reduce to the true or false branch.
Andy Wingo [Sun, 20 Jul 2014 18:19:01 +0000 (20:19 +0200)]
CPS will not see "not" primcalls
* module/language/tree-il/compile-cps.scm (convert): Remove "not"
primcalls.
* module/language/cps/effects-analysis.scm (values):
* module/language/cps/types.scm: Remove special cases for the "not"
primcall.
Andy Wingo [Sun, 6 Jul 2014 10:38:26 +0000 (12:38 +0200)]
Simplify pass rewrite scope tree to reflect dominator tree
* module/language/cps/simplify.scm (redominate): Add micropass to
rewrite the scope tree to reflect the dominator tree. Will enable
better eta reduction.
Andy Wingo [Sun, 6 Jul 2014 10:17:58 +0000 (12:17 +0200)]
Remove dead case in CSE
* module/language/cps/cse.scm (apply-cse): Remove a case that couldn't
occur.
Andy Wingo [Mon, 21 Jul 2014 15:30:16 +0000 (17:30 +0200)]
CSE allocate-struct fix
* module/language/cps/cse.scm (compute-equivalent-subexpressions):
Fix handling of allocate-struct in tail position.
Andy Wingo [Mon, 21 Jul 2014 15:03:51 +0000 (17:03 +0200)]
Fix typo in arities.scm
* module/language/cps/arities.scm (fix-arities*): Fix typo.
Andy Wingo [Mon, 21 Jul 2014 10:19:33 +0000 (12:19 +0200)]
Stabilize renumber.scm:sort-conts.
* module/language/cps/renumber.scm (sort-conts): Prevent spurious
continuation reordering.
Andy Wingo [Mon, 21 Jul 2014 19:37:20 +0000 (21:37 +0200)]
maybe_annotate_source does not annotate negative positions
* libguile/read.c (maybe_annotate_source): Don't annotate with negative
lines or columns.
Andy Wingo [Mon, 21 Jul 2014 19:36:30 +0000 (21:36 +0200)]
Soft port fill-input doesn't alter line or column
* libguile/vports.c (sf_fill_input): Save and restore the line/column
info around the ungetc.
Andy Wingo [Mon, 21 Jul 2014 19:35:49 +0000 (21:35 +0200)]
scm_ungetc_unlocked should not result in negative columns
* libguile/ports.c (scm_ungetc_unlocked): Use DECCOL in all cases, to
avoid negative columns.
Andy Wingo [Mon, 21 Jul 2014 09:47:43 +0000 (11:47 +0200)]
Fix allocate-slots for $kreceive with multiple predecessors
* module/language/cps/slot-allocation.scm (allocate-slots): For
continuations of $call, $callk, and $values with multiple
predecessors, recalculate the set of live slots. Fixes miscompilation
of ice-9/futures.scm:process-future!, broken since the previous patch,
now that $kreceive continuations can have multiple predecessors.
Andy Wingo [Sat, 5 Jul 2014 13:46:48 +0000 (15:46 +0200)]
Block sorting to keep loop bodies together
* module/language/cps/renumber.scm (compute-new-labels-and-vars):
(compute-tail-path-lengths, sort-conts): Arrange to visit successors
in such a way that if branches are unsorted, the longest path length
will appear first. This keeps loop bodies together.
Andy Wingo [Fri, 4 Jul 2014 10:05:31 +0000 (12:05 +0200)]
logbit? strength reduction
* module/language/cps/type-fold.scm (fold-and-reduce): Don't require
types to check out; it could be that the reduced expression can
exhibit the same type-check effects. Reduce for all continuations,
even $kreceive. Pass dfg to reducer.
(mul): Check types.
(logbit?): New reducer.
Andy Wingo [Fri, 4 Jul 2014 09:54:03 +0000 (11:54 +0200)]
Fix logand range analysis.
* module/language/cps/types.scm (logand): Fix range analysis.
Andy Wingo [Fri, 4 Jul 2014 09:14:16 +0000 (11:14 +0200)]
Fix range analysis for mul and div
* module/language/cps/types.scm (mul): Avoid producing nans in the
resulting range.
(div): Fix range analysis.
Andy Wingo [Fri, 4 Jul 2014 08:46:31 +0000 (10:46 +0200)]
Type-driven strength reduction
* module/language/cps/type-fold.scm (*primcall-reducers*):
(define-primcall-reducer, define-unary-primcall-reducer):
(define-binary-primcall-reducer, mul): Beginnings of strength
reduction.
(fold-and-reduce): Rename from compute-folded.
(fold-constants*): Adapt.
Andy Wingo [Fri, 4 Jul 2014 07:18:36 +0000 (09:18 +0200)]
Small type-fold cleanup
* module/language/cps/type-fold.scm (fold-constants*): Remove stale
branches that were there when we only type folded on limited-size
branches.
Andy Wingo [Thu, 3 Jul 2014 13:03:40 +0000 (15:03 +0200)]
Compiler emits br-if-logtest
* module/language/cps/compile-bytecode.scm (compile-fun):
* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/language/cps/type-fold.scm (logtest):
* module/language/cps/types.scm (logtest):
* module/system/vm/assembler.scm (system):
* module/system/vm/disassembler.scm (compute-labels): Add backend
support for the logtest instruction.
Andy Wingo [Thu, 3 Jul 2014 12:50:50 +0000 (14:50 +0200)]
Add br-if-logtest opcode
* libguile/vm-engine.c (br-if-logtest): New opcode.
* module/system/vm/disassembler.scm (code-annotation): Add branch
annotation support.
Andy Wingo [Thu, 3 Jul 2014 12:45:12 +0000 (14:45 +0200)]
Optimizer support for logtest and logbit?
* module/language/cps/effects-analysis.scm: Add entries for logtest and
logbit?.
* module/language/cps/types.scm (logtest, logbit?): New checkers and
inferrers.
* module/language/tree-il/peval.scm (peval): Convert (zero? (logand a
b)) to (logtest a b), in anticipation of opcode support for logtest.
*
module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*effect-free-primitives*): Add logtest and logbit?.
Andy Wingo [Thu, 3 Jul 2014 09:24:37 +0000 (11:24 +0200)]
Convert slot allocation to use intsets
* module/language/cps/dfg.scm (compute-live-variables): Convert to use
intsets, and fold in compute-maximum-fixed-point.
(print-dfa): Update.
* module/language/cps/slot-allocation.scm (dead-after-def?)
(dead-after-use?, allocate-slots): Convert to use intsets.
Andy Wingo [Thu, 3 Jul 2014 08:37:20 +0000 (10:37 +0200)]
Add bitvector->intset.
* module/language/cps/intset.scm (bitvector->intset): New interface.
Andy Wingo [Thu, 3 Jul 2014 07:37:30 +0000 (09:37 +0200)]
Restrict intsets and maps to non-negative integers
* module/language/cps/intmap.scm (intmap-add):
* module/language/cps/intset.scm (intset-add): Restrict to only hold
non-negative integers.
Andy Wingo [Thu, 3 Jul 2014 07:20:11 +0000 (09:20 +0200)]
Adapt visit-prompt-control-flow to use intsets.
* module/language/cps/dfg.scm (compute-reachable): Use intsets.
(compute-interval): Adapt.
(visit-prompt-control-flow): Adapt.
Andy Wingo [Thu, 3 Jul 2014 07:03:45 +0000 (09:03 +0200)]
CSE comments
* module/language/cps/cse.scm (compute-available-expressions): Add
clarifying comment.
Andy Wingo [Thu, 3 Jul 2014 07:02:31 +0000 (09:02 +0200)]
Add intset-subtract.
* module/language/cps/intset.scm (intset-subtract): New interface.
Andy Wingo [Tue, 1 Jul 2014 09:30:29 +0000 (11:30 +0200)]
Fix intset on 32-bit machines
* module/language/cps/intset.scm (*leaf-bits*): Define to 4 on 32-bit
machines, to stay in fixnum range.
Andy Wingo [Mon, 30 Jun 2014 13:30:39 +0000 (15:30 +0200)]
Remove size limit in elide-type-checks
* module/language/cps/dce.scm (elide-type-checks!): Remove limit on
label-count, now that complexity is under control.
Andy Wingo [Sun, 29 Jun 2014 17:49:41 +0000 (19:49 +0200)]
Fix intmap-intersect corner case
* module/language/cps/intmap.scm (intmap-intersect): Fix a corner case,
as was recently fixed for intsets.
Andy Wingo [Sun, 29 Jun 2014 17:25:54 +0000 (19:25 +0200)]
CSE truth inference pass uses intsets
* module/language/cps/cse.scm (compute-truthy-expressions): Rewrite to
use intsets instead of bitvectors.
(apply-cse): Adapt.
Andy Wingo [Sun, 29 Jun 2014 17:47:25 +0000 (19:47 +0200)]
Result of intsect-intersect will share structure with A if it can
* module/language/cps/intset.scm (intset-intersect): Ensure that the
result shares structure with A if possible, as intmaps do.
Andy Wingo [Sun, 29 Jun 2014 17:40:43 +0000 (19:40 +0200)]
Fix an intset-intersect corner case
* module/language/cps/intset.scm (intset-intersect): Avoid creating
invalid intsets when lowering an intset with a higher shift.
Andy Wingo [Sun, 29 Jun 2014 17:31:27 +0000 (19:31 +0200)]
Fix intset pruning for empty intsets
* module/language/cps/intset.scm (make-intset/prune): Fix empty intset
case.
Andy Wingo [Sun, 29 Jun 2014 12:29:20 +0000 (14:29 +0200)]
Remove namesets.
This was a failed experiment. It had good space complexity but terrible
time complexity.
* module/Makefile.am: Update.
* module/language/cps/nameset.scm: Remove.
Andy Wingo [Sun, 29 Jun 2014 12:20:52 +0000 (14:20 +0200)]
Rewrite type inference to use intmaps
* module/language/cps/types.scm: Rewrite to use intmaps instead of
namesets.
Andy Wingo [Sun, 29 Jun 2014 08:41:57 +0000 (10:41 +0200)]
New module (language cps intmap)
* module/language/cps/intmap.scm: New file.
* module/Makefile.am: Add to build.
Andy Wingo [Sun, 29 Jun 2014 12:20:26 +0000 (14:20 +0200)]
Rewrite CSE to use intsets.
* module/language/cps/cse.scm: Rewrite using intsets.
Andy Wingo [Sun, 29 Jun 2014 12:09:04 +0000 (14:09 +0200)]
New module: (language cps intset)
* module/Makefile.am: Add to build.
* module/language/cps/intset.scm: New file.
Andy Wingo [Sat, 28 Jun 2014 13:24:29 +0000 (15:24 +0200)]
Fix bit-count* bug
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
2005 refactor (!) in which the second arg was erroneously taken from
the first arg.
* test-suite/tests/bitvectors.test: Add test.
* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
Andy Wingo [Thu, 19 Jun 2014 06:49:05 +0000 (08:49 +0200)]
Rewrite type inference pass to use namesets
* module/Makefile.am: Build types.scm early, but don't block the rest of
the build on it.
* module/language/cps/types.scm: Rewrite to use namesets.
* module/language/cps/dce.scm:
* module/language/cps/type-fold.scm: Adapt to interface changes.
Andy Wingo [Sun, 8 Jun 2014 16:50:07 +0000 (18:50 +0200)]
New module: (language cps nameset)
* module/language/cps/nameset.scm: New file.
* module/Makefile.am: Add new file.
Andy Wingo [Sun, 15 Jun 2014 20:02:29 +0000 (22:02 +0200)]
Refactor dominator computation
* module/language/cps/cse.scm:
* module/language/cps/dfg.scm (compute-idoms, compute-dom-edges): Move
these procedures from cse.scm to dfg.scm.
Remove loop-detection code; that can come back later but it is
bitrotten for now.
Andy Wingo [Sun, 8 Jun 2014 12:46:18 +0000 (14:46 +0200)]
Constant folding for (list) and (vector) in peval
* module/language/tree-il/peval.scm (peval): Add cases for (list) -> '()
and (vector) -> #().
Ludovic Courtès [Mon, 9 Jun 2014 17:26:38 +0000 (19:26 +0200)]
Use the right GC version macros.
Reported by Doug Evans <xdje42@gmail.com>.
* libguile/gc.c (scm_storage_prehistory): Use GC_VERSION_MICRO, not
GC_ALPHA_VERSION.
Andy Wingo [Sun, 1 Jun 2014 01:43:12 +0000 (21:43 -0400)]
Remove $kif
* module/language/cps.scm: Remove $kif.
* module/language/cps/compile-bytecode.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/renumber.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm:
* module/language/cps/verify.scm: Adapt.
Andy Wingo [Sun, 1 Jun 2014 01:13:33 +0000 (21:13 -0400)]
CPS conversion produces $branch nodes, not $kif
* module/language/tree-il/compile-cps.scm (unbound?, convert): Create
$branch nodes instead of $kif nodes.
Andy Wingo [Tue, 27 May 2014 15:49:42 +0000 (11:49 -0400)]
Add $branch expression type
* module/language/cps.scm ($branch): New expression type; will replace
$kif.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/primitives.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/type-fold.scm:
* module/language/cps/types.scm:
* module/language/cps/verify.scm: Adapt to $branch expression type.
Andy Wingo [Fri, 30 May 2014 15:54:56 +0000 (11:54 -0400)]
Fix source-line-for-user for unknown line
* module/system/vm/debug.scm (source-line-for-user): Fix to allow for
unknown lines.
Andy Wingo [Wed, 28 May 2014 16:50:15 +0000 (12:50 -0400)]
Fix off-by-one in dump-dfg
* module/language/cps/dfg.scm (dump-dfg): Fix bug where the last
continuation wasn't printed.
Andy Wingo [Wed, 28 May 2014 14:46:19 +0000 (10:46 -0400)]
Fix compute-predecessors bug in frame.scm
* module/system/vm/frame.scm (compute-predecessors): Fix bug in
resolving targets of backwards branches.
Andy Wingo [Fri, 16 May 2014 14:57:58 +0000 (16:57 +0200)]
Update effects-analysis docstring.
* module/language/cps/effects-analysis.scm: Update docs.
Andy Wingo [Fri, 16 May 2014 14:17:53 +0000 (16:17 +0200)]
Redefine memory kind part of effects to be enumeration, not flags
* module/language/cps/effects-analysis.scm (define-enumeration): New
helper.
(&memory-kind-mask): Define as an enumeration, not a bitfield. Add
&unknown-memory-kinds.
(&all-effects, effect-clobbers?, make-prompt-tag, expression-effects):
Adapt.
Note that this change requires dce.go and cse.go to be recompiled.
Andy Wingo [Wed, 14 May 2014 14:59:08 +0000 (16:59 +0200)]
DCE uses type analysis to elide type checks
* module/language/cps/dce.scm (elide-type-checks!, compute-live-code):
Replace old ad-hoc type check elision with one driven from type
analysis. Type check elision only operates on smallish functions, to
avoid n**2 explosion in type inference.
Andy Wingo [Wed, 14 May 2014 19:42:09 +0000 (21:42 +0200)]
Limit impact of O(n^2) type analysis by imposing limit
* module/language/cps/types.scm (infer-types): Add #:max-label-count
argument.
* module/language/cps/type-fold.scm (compute-folded, fold-constants*):
Disable for big functions. Perhaps we can relax this if we find an
O(n log n) way to represent types.
Andy Wingo [Wed, 14 May 2014 14:15:15 +0000 (16:15 +0200)]
Compile language/cps/types.scm early
* module/Makefile.am (BOOT_SOURCES, BOOT_GOBJECTS): New variables.
(CLEANFILES, nobase_mod_DATA, nobase_ccache_DATA, EXTRA_DIST)
(ETAGS_ARGS): Use the new variables.
(CPS_LANG_SOURCES): Remove language/cps/types.scm, as it is a boot
file.
Andy Wingo [Wed, 14 May 2014 14:02:08 +0000 (16:02 +0200)]
Enable type folding
* module/language/cps/compile-bytecode.scm (optimize): Enable type
folding.
Andy Wingo [Tue, 13 May 2014 14:14:35 +0000 (16:14 +0200)]
Type and range inference for CPS
* module/language/cps/types.scm: New file, implementing type and range
inference over CPS.
* module/language/cps/type-fold.scm: New file, implementing abstract
constant folding for CPS.
* module/Makefile.am: Add the new files.
* module/language/cps/compile-bytecode.scm: Wire up type-fold, but
currently disabled.
Andy Wingo [Mon, 12 May 2014 07:41:58 +0000 (09:41 +0200)]
Add syntax-parameterize indentation to .dir-locals.el.
* .dir-locals.el: Add syntax-parameterize indentation.
Andy Wingo [Thu, 8 May 2014 08:39:49 +0000 (10:39 +0200)]
Rewrite effects analysis to be precise for fields.
* module/language/cps/effects-analysis.scm: Rewrite so that instead of
the depends/causes effects, there is just &type-check, &allocation,
&read, and &write. The object kind is a separate part of the
bitfield, and the field in the object (if appropriate) is another
field. Effects are still a fixnum. This enables precise effects for
vectors and structs on all architectures.
This kind of effects analysis was not possible in Tree-IL because
Tree-IL relied on logior-ing effects of subexpressions, whereas with
CPS we have no sub-expressions and we do flow analysis instead.
(effect-clobbers?): Replace effects-commute? with this inherently
directional and precise predicate.
* module/language/cps/cse.scm (compute-always-available-expressions):
(compute-equivalent-subexpressions): Adapt to effects analysis
change.
* module/language/cps/dce.scm (compute-live-code): Likewise.
Andy Wingo [Wed, 7 May 2014 15:10:15 +0000 (17:10 +0200)]
CSE effects analysis cleanup
* module/language/cps/cse.scm (compute-always-available-expressions):
Use constant? instead of zero?, to avoid punching through the effects
abstraction.
Andy Wingo [Wed, 7 May 2014 13:28:50 +0000 (15:28 +0200)]
Add dump-dfg pretty-printer
* module/language/cps/dfg.scm (dump-dfg): New pretty-printer. Under
construction.
Andy Wingo [Wed, 7 May 2014 13:28:12 +0000 (15:28 +0200)]
Synthetic definitions take advantage of CSE'd vars
* module/language/cps/cse.scm (compute-available-expressions):
Simplify initialization.
(compute-equivalent-subexpressions): When synthesizing definitions,
use substed vars. Add synthetic definitions after processing an
expression, to take advantage of the substed vars.
Andy Wingo [Wed, 7 May 2014 13:25:13 +0000 (15:25 +0200)]
Fix thinko in synthesize-definition-effects!
* module/language/cps/effects-analysis.scm (synthesize-definition-effects!):
Fix a boneheaded thinko that caused all primcalls to be marked as
causing car, cdr, vector, struct, and box effects.
Andy Wingo [Sun, 4 May 2014 20:51:34 +0000 (22:51 +0200)]
Fix frame-call-representation for frames from apply-hook
* module/system/vm/frame.scm (frame-call-representation): Fix when
called on frames that are created from the apply hook.
Andy Wingo [Sun, 4 May 2014 20:41:48 +0000 (22:41 +0200)]
Program printing tweaks
* module/system/vm/program.scm (print-program): New public interface --
the guts of write-program, but refactored to be able to work when only
given an addr.
(write-program): Use print-program.
* module/system/vm/frame.scm (frame-call-representation): Remove attempt
to abbreviate procedure representations; was confusing because the
result would write as a string, quotes and all.
Andy Wingo [Sun, 4 May 2014 12:09:42 +0000 (14:09 +0200)]
Refactorings to apply-hook and push-continuation-hook
* libguile/vm-engine.c (vm_engine): Always invoke the apply hook after
the ip has been reset. Avoids problems in frame-bindings, which
builds its bindings map based on the IP. Invoke push-continuation
before linking the new frame, so that more locals are available to the
frame inspector.
* module/system/vm/traps.scm (trap-in-procedure): No need for a
push-cont handler, as the apply handler will exit the frame.
Andy Wingo [Sun, 4 May 2014 09:46:18 +0000 (11:46 +0200)]
frame-address, frame-stack-pointer return offsets
* libguile/frames.c (scm_frame_address, scm_frame_stack_pointer): Return
offsets instead of absolute pointers. This is robust in the presence
of stack relocation.
* module/system/repl/debug.scm (print-registers): Adapt to print sp and
fp as integers.
Andy Wingo [Sun, 4 May 2014 09:18:54 +0000 (11:18 +0200)]
frame-call-representation has #:top-frame? as keyword argument
* module/system/vm/frame.scm (frame-call-representation): Change
top-frame? argument to be a keyword instead of an optional argument.
* module/system/vm/trace.scm (print-application): Adapt caller.
Andy Wingo [Fri, 2 May 2014 18:06:30 +0000 (20:06 +0200)]
Set-car! on a dead pair does not force the pair to be live
* module/language/cps/dce.scm (constant-type, lookup-type)
(default-type-checker, *primcall-type-checkers*)
(define-primcall-type-checker, define-simple-primcall-types)
(check-primcall-arg-types): Define a really lame type analysis that
can elide some expressions causing &type-check.
(compute-live-code): Wire up the type checker.
Andy Wingo [Sat, 3 May 2014 10:21:20 +0000 (12:21 +0200)]
Add auxiliary definitions for boxes
* module/language/cps/cse.scm (compute-equivalent-subexpressions): Add
auxiliary definitions for boxes.
Andy Wingo [Fri, 2 May 2014 15:47:20 +0000 (17:47 +0200)]
CSE does scalar replacement of aggregates
* module/language/cps/effects-analysis.scm (effects-clobber): New
helper.
(length): Only depend on &cdr.
(synthesize-definition-effects!): New interface.
* module/language/cps/cse.scm (compute-available-expressions): Don't
count out constructors here -- we'll do that below.
(compute-defs): Add a comment.
(compute-equivalent-subexpressions): Synthesize getter calls at
constructor/setter sites, so that (set-car! x y) can cause a
future (car x) to just reference y. The equiv-labels set now stores
the defined vars, so there is no need for the defs vector.
(cse, apply-cse): Adapt to compute-equivalent-subexpressions change.
Andy Wingo [Fri, 2 May 2014 15:29:39 +0000 (17:29 +0200)]
More inlinable effects-analysis procedures
* module/language/cps/effects-analysis.scm (exclude-effects)
(effect-free?, constant?): Define to be inlinable.
(allocate-struct/immediate): Add effects.
Andy Wingo [Fri, 2 May 2014 09:13:34 +0000 (11:13 +0200)]
Update NEWS
* NEWS: Update.
Andy Wingo [Thu, 1 May 2014 19:14:42 +0000 (21:14 +0200)]
Rewrite boot-9 map to be recursive and pure
* module/ice-9/boot-9.scm (map): Rewrite to be recursive and pure
instead of iterative and effectful. At best this is faster; at worst
it is slower. In any case it resolves continuation-related issues.
* module/srfi/srfi-1.scm (fold): Specialize the two-arg case.
(map): Rewrite to be recursive.
* test-suite/tests/r5rs_pitfall.test (8.3): Update for new expected map
behavior.
Andy Wingo [Thu, 1 May 2014 12:26:20 +0000 (14:26 +0200)]
Fix inner and outer stack cuts to match on procedure code
* doc/ref/api-debug.texi (Stack Capture): Update make-stack docs.
* libguile/programs.h:
* libguile/programs.c (scm_program_address_range): New internal
procedure.
* libguile/stacks.c (narrow_stack): Interpret a pair of integers as an
address range. If a cut is a procedure, attempt to resolve it to an
address range.
(scm_make_stack): Update docstring.
* module/system/vm/program.scm (program-address-range): New exported
procedure.
* module/statprof.scm (statprof, gcprof): Use program-address-range to
get the outer-cut, for efficiency.