* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*effect-free-primitives*): Add string->number, number->string,
integer->char, and char->integer to allow for constant folding and
better effects analysis.
* module/language/tree-il/cse.scm (cse): When trying to fold
conditionals, only look at entries in the database that were added in
test context.
* test-suite/tests/cse.test ("cse"): Add a test case.
* module/ice-9/ftw.scm (scandir): Run the select? procedure on all
items, including subdirs and the `.' and `..' entries. Pass it the
basename of the file in question instead of the full name.
* test-suite/tests/ftw.test ("scandir"): Adapt expectation for the .test
selector. Add test for a selector that rejects everything.
Partly addresses <http://bugs.gnu.org/11197>.
Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.
* module/srfi/srfi-6.scm (open-input-string, open-output-string): New
procedures.
* test-suite/tests/srfi-6.test ("open-input-string")["read-char,
Unicode"]: New test.
("open-output-string")["λ"]: New test.
* libguile/strports.c (scm_mkstrport): Remove initialization of
`pt->ilseq_handler'.
* module/ice-9/pretty-print.scm (truncated-print)[ellipsis]: Set
%DEFAULT-PORT-CONVERSION-STRATEGY to 'error.
* test-suite/tests/ports.test ("string
ports")["%default-port-conversion-strategy is honored"]: New test.
["wrong encoding"]: Rename to...
["wrong encoding, error"]: ... this. Explicitly set
%DEFAULT-PORT-CONVERSION-STRATEGY to 'error. Return #f when no
exception is raised.
This commit removes code that was newly deprecated in stable-2.0.
Conflicts:
libguile/deprecated.c
libguile/deprecated.h
libguile/modules.c
module/ice-9/boot-9.scm
module/ice-9/deprecated.scm
* module/language/tree-il/analyze.scm (validate-arity): Fix for
applicable structs. Applicable structs are procedures, but not every
struct has a first slot, and not every struct with a procedure in its
first slot is applicable. Besides, the approach in this patch gives
better errors.
* module/language/tree-il/effects.scm (make-effects-analyzer): The
analyzer will take an optional second argument, a lookup procedure of
type sym -> exp. This can let the analyzer dig into calls to
lexically bound procedures.
* module/language/tree-il/cse.scm (singly-valued-expression?, cse):
Allow CSE to propagate lexicals to tail positions, if the expression
is singly-valued.
* module/language/tree-il/peval.scm (peval): If we can lift one common
test, see if we can lift others as well.
* test-suite/tests/peval.test: Add a test.
* module/language/tree-il/peval.scm (peval): Optimize common tests in
chains of "if" expressions, like those generated by matchers.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.
* module/language/tree-il/analyze.scm (proc-ref?)[special?]: New
procedure.
Return #t for any toplevel-ref of `_'.
* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
format string using gettext as top-level _"): New test.
* module/language/tree-il/analyze.scm (proc-ref?): Check for
SPECIAL-NAME in the <module-ref> and <lexical-ref> cases too.
* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
format string using gettext as module-ref _", "non-literal format
string using gettext as lexical _"): New tests.
* libguile/frames.c (scm_frame_source, scm_frame_previous):
* libguile/stacks.c (scm_make_stack):
* module/ice-9/boot-9.scm (exception-printers):
* module/system/vm/frame.scm (frame-call-representation): Fix more
assumptions that frame-procedure is a program, or even a procedure.
* libguile/frames.c (scm_frame_instruction_pointer):
* module/system/vm/frame.scm (frame-bindings):
(frame-next-source, frame-call-representation): Fix a few locations
that thought that the frame-procedure will always be a VM
procedure. This will not not be the case when traversing the stack of
an application of a non-procedure.
* libguile/vm-i-system.c (call, tail-call, mv-call): Instead of
special-casing structs and smobs at these call sites, just set up the
stack, and jump to a generic apply loop if the proc is not a program.
* libguile/vm-engine.c: The generic apply loop is here. Also, the boot
program is now simply a boot continuation, and can handle any number
of arguments.
* libguile/vm.c (make_boot_program): Update the code that makes the boot
continuation.
* module/texinfo.scm (texi-command-specs): Add a new kind of texinfo
command, inline-text-args, a sort of a cross between inline-args,
which are unparsed, and inline-text, which is. Perhaps this should
supersede inline-args at some point. In any case, add acronym as an
inline-text-args element.
(inline-content?, arguments->attlist, complete-start-command)
(parse-inline-text-args, make-dom-parser): Adapt for
inline-text-args.
* module/texinfo/serialize.scm (inline-text-args): Add serialization for
@acronym.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add some
tests.
* module/ice-9/vlist.scm (make-block): If we are making a hash table,
allocate it inline with the contents. Otherwise don't even add a
pointer to the block.
(block-hash-table?): New internal accessor.
(block-ref*): Remove. Vhash entries are no longer wrapped.
(block-ref):
(block-hash-table-next-offset):
(block-hash-table-set-next-offset!):
(block-hash-table-ref):
(block-hash-table-set!):
(block-hash-table-add!): Adapt to take content vector explicitly, and
to expect the hash table inline with the contents. Some of these
accessors are new. Adapt callers.
(assert-vlist): New helper.
(vlist-cons): Update comment.
(vhash?): Update scheme to allocate the hash table and chain links
inline with the contents.
(%vhash-fold*, %vhash-assoc): Rewrite to be more performant.
* module/language/tree-il/peval.scm (<operand>, make-operand)
(make-bound-operands, peval): Avoid emitting needless aliases in
degenerate cases of let.
(visit-operand): If we visit an operand with a fresh counter and have
to abort, record that fact.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.
* module/ice-9/vlist.scm (set-block-next-free!): Define this instead of
increment-block-next-free!.
(block-append!): Refactor to take an offset, and only append if the
offset is the next free value, and there is space in the block.
(block-cons): Refactor to not be a loop. The partial evaluator would
have to understand effects analysis in order to be able to unroll it,
and there's at most one recursion.
Recovers the performance loss resulting from the previous commit.
* module/ice-9/vlist.scm: Use define-inlinable instead of define-inline,
to ensure strict argument evaluation. There is a slight performance
penalty, but I hope subsequent hacks make it up.
* module/language/tree-il/cse.scm: New pass, some simple common
subexpression elimination with effects analysis.
* test-suite/tests/cse.test: New test.
* test-suite/Makefile.am:
* module/Makefile.am: Adapt.
* module/language/tree-il/peval.scm: Use effects analysis from (language
tree-il effects) instead of our own constant-expression?. Eagerly
mark assigned lexicals as non-copyable.