* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES):
* module/language/tree-il/optimize.scm (make-optimizer): Wire up the new
pass.
* module/language/tree-il/resolve-free-vars.scm: New pass.
* module/system/base/optimize.scm (available-optimizations): Enable new
pass at -O1.
* module/language/tree-il/letrectify.scm (letrectify): Inline "let"
bindings inside residualized "letrec*" forms, to allow the dominator
relationship to be reflected in the scope tree. Also, detect
"define-module*" invocations, and add these to the mod-vars set, so that
residualized "module-ensure-local-variable!" primcalls can clearly
denote their module without having to use "current-module".
* module/language/cps/contification.scm (compute-first-class-functions):
(compute-functions-called-by-label):
(compute-functions):
(compute-arities):
(compute-contification-candidates):
(compute-call-graph):
(compute-contification):
(apply-contification):
(contify): Given that the frontend will produce $callk now, allow it to
be contified if such callees are all called with the same continuation.
* module/language/tree-il/compile-cps.scm (module-call-stubs):
(module-call-label, convert, cps-convert/thunk): Arrange to call module
variables through out-of-line trampolines with unchecked arity. This
should speed up compile time in large files and reduce code size on hot
paths.
* module/language/cps/closure-conversion.scm: Use standard
compute-reachable-functions and intmap-select from utils to filter
reachable functions, allowing us to pick up callk. Adapt some uses to
expect callk for calls.
* module/language/cps/self-references.scm (resolve-self-references):
Subst the proc, if it's there.
* module/language/cps/split-rec.scm (compute-free-vars): Add a case for
callk.
* libguile/intrinsics.h:
* libguile/intrinsics.c (lookup_bound_public, lookup_bound_private): Two
new intrinsics.
(scm_bootstrap_intrinsics): Wire them up.
* libguile/jit.c (compile_call_scm_from_scmn_scmn):
(compile_call_scm_from_scmn_scmn_slow):
(COMPILE_X8_S24__N32__N32__C32): Add JIT support for new instruction
kind.
* libguile/vm-engine.c (call-scm<-scmn-scmn): New instruction, takes
arguments as non-immediate offsets, to avoid needless loads and register
pressure.
* module/language/cps/effects-analysis.scm: Add cases for new
primcalls.
* module/language/cps/compile-bytecode.scm (compile-function): Add new
primcalls.
* module/language/cps/reify-primitives.scm (cached-module-box): If the
variable is bound, call lookup-bound-public / lookup-bound-private as
appropriate instead of separately resolving the module, name, and doing
the bound check.
* module/language/tree-il/compile-bytecode.scm (emit-cached-module-box):
Use new instructions.
* module/system/vm/assembler.scm (define-scm<-scmn-scmn-intrinsic):
(lookup-bound-public, lookup-bound-private): Add assembler support.
* module/language/cps/reify-primitives.scm (cached-module-box): Include
public? in cache key, so we don't accidentally alias private and
exported names. Also include bound?, to avoid a window in which thread
A resolves and caches var V in preparation for setting it, but thread B
sees V for ref before it was initialized.
* module/language/cps.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/types.scm: Allow $kargs to follow $kfun. In that
case, the function must be well-known and callers are responsible for
calling with the appropriate arity.
* module/language/cps/compile-bytecode.scm: Emit "unchecked-arity" for
$kargs following $kfun.
* module/system/vm/assembler.scm: Adapt.
* module/language/tree-il/fix-letrec.scm (reorder-bindings):
(fix-letrec): Reorder definitions so that lambdas tend to stick
together, to avoid "complex" expressions interposing in lambda SCCs.
This mirrors Guix commit b168acae2a01fd84075cc134a6140594a978fde5.
* module/web/client.scm (tls-wrap)[unbuffered]: New procedure.
Pass the result of 'make-custom-binary-input/output-port' to
'unbuffered'.
This mirrors Guix commit 279d932b1ca7bfbb8657c41a84616dd0dfc6e0a8.
* module/web/client.scm (tls-wrap)[read!]: Read straight into BV
instead of calling 'get-bytevector-some' and 'unget-bytevector'.
* libguile/i18n.c (compare_strings): In all cases, convert to a
null-terminated string. While we're doing that, might as well use
utf-8.
* test-suite/tests/i18n.test ("text collation (French)"): Add test.
Thanks again to Rob Browning for the report.
* libguile/i18n.c (u32_locale_casecoll): Take lengths of incoming
strings as parameters rather than assuming "nul" termination.
(compare_u32_strings_ci): Pass string lengths as computed from the
Scheme strings.
* test-suite/tests/i18n.test ("text collation (English)"): Add a test
case.
Thanks a million to Rob Browning for the report.
When using automake and libtool to build DLLs on Cygwin, libtool
will rename libXXX to cygXXX. 'load-foreign-library' should
emulate libltdl behavior and search for DLLs using that convention.
* module/system/foreign-library.scm (lib->cyg): new helper function
(load-foreign-library): add rename-on-cygwin? option to rename
libraries using Cygwin semantics
* test-suite/tests/foreign.test: new test section 'lib->cyg'
* doc/ref/api-foreign.text: document new rename-on-cygwin? option
for load-foreign-library
This reverts commit 0f983e3db0.
After discussing with Mike we are going to punt the read-line changes
for now. Open the port in O_TEXT mode if you want to chomp the CR in
CFLF sequences.
* libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS
* module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS
* module/web/http.scm (read-header-line): take advantage of CRLF in read-line
(read-header): don't need to test for \return
* test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS
* doc/ref/api-io.texi: update doc for read-line
* doc/ref/posix.texi (File System): Update to document mkstemp only.
* libguile/filesys.c: Make a mkstemp that doesn't modify the input
template. Instead the caller has to get the file name from
port-filename.
(scm_mkstemp): Use the new mkstemp to implement mkstemp!. Can't
deprecate yet though as the replacement hasn't been there for long
enough.
* libguile/posix.c (scm_tempnam): Update to mention mkstemp instead.
* module/system/base/compile.scm (call-with-output-file/atomic): Use
mkstemp.
* test-suite/tests/posix.test:
* test-suite/tests/r6rs-files.test: Use mkstemp.
* NEWS: Update.
* libguile/posix-w32.h: prefer lowercase windows.h for MinGW cross-builds
* libguile/socket.c [HAVE_WINSOCK2_H]: use only winsock2.h for socket
declarations
The start_child procedure is used to spawn a child process. If it fails
to launch the given argv[0] as if it were a command, it has logic to
retry using the ComSpec as a command interpreter, treating argv[0] as
a batch file name. Usually, this fails because batch files would have
been handled in the first pass if they were valid. Also, this has
the unfortunate side effect of spawning a shell awaiting user input.
It is safer to remove this attempt.
* libguile/posix-w32.c (start_child): remove fallback processing
This test, which seems quite complicated to fix, causes the MinGW build
to hang. Disable it for now, but, come back to it later.
* test-suite/tests/popen.test (mingw?): new constant
(no duplicate): disable for mingw, for now