* libguile/goops.c (SCM_GOOPS_UNBOUND, SCM_GOOPS_UNBOUNDP): Remove
internal macros.
(scm_make_unbound, scm_unbound_p): Remove internal functions.
(scm_sys_clear_fields_x): Add "unbound" parameter, for the init
value.
* module/oop/goops.scm (*unbound*): Define in Scheme as a simple
heap-allocated value.
(unbound?): New definition.
(%allocate-instance): Pass *unbound* to %clear-fields!.
(make-class, slot-definition-init-value)
(slot-definition-init-form, make-closure-variable): Use *unbound*
instead of (make-unbound), which is now gone.
* module/oop/goops/active-slot.scm (compute-get-n-set): Use *unbound*
instead of make-unbound. This module uses the GOOPS internals module;
perhaps we should export make-unbound or something...
* module/oop/goops/save.scm (make-unbound): Export our own make-unbound
definition, for use by residualized save code.
* module/language/ecmascript/base.scm (<undefined>, *undefined*): Use a
unique object kind and instance for the undefined value.
* libguile/vm.c (scm_i_vm_mark_stack): Fill the stack with
SCM_UNSPECIFIED instead of SCM_UNBOUND.
* libguile/vm-engine.c (allocate-struct, struct-ref, struct-set!): New
instructions, to complement their "immediate" variants.
* module/language/cps/compile-bytecode.scm (compile-fun):
* module/system/vm/assembler.scm (system): Wire up the new instructions.
Fixes <http://bugs.gnu.org/17634>.
Reported by Josep Portella Florit <jpf@primfilat.com>.
* module/language/tree-il/peval.scm (inlined-application): When inlining
an application whose operator is a lambda expression with optional
arguments that rely on default initializers, expand into a series of
nested let expressions, to ensure that previous arguments are in scope
when the default initializers are evaluated.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
Fixes <http://bugs.gnu.org/18299>.
Reported by Frank Terbeck <ft@bewatermyfriend.org>.
* module/language/tree-il/analyze.scm (format-string-argument-count):
Add case for ~p.
* test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too
few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few
arguments"): New tests.
* module/language/cps/types.scm (&all-types): Represent true and false
as separate bits, so that #f can be removed from types on true
branches. Adapt all users.
* module/language/cps/type-fold.scm (&scalar-types):
(fold-and-reduce): Adapt to boolean type representation change.
* module/language/cps/simplify.scm (redominate): Add micropass to
rewrite the scope tree to reflect the dominator tree. Will enable
better eta reduction.
* 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.
* 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.
* 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.
* 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?.
* 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.
This was a failed experiment. It had good space complexity but terrible
time complexity.
* module/Makefile.am: Update.
* module/language/cps/nameset.scm: Remove.
* 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.
* 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.