[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 57/58: Merge branch 'master' into lightning
From: |
Andy Wingo |
Subject: |
[Guile-commits] 57/58: Merge branch 'master' into lightning |
Date: |
Tue, 7 Aug 2018 06:58:39 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 41100f77864d58690fe511ff19879d08504bef32
Merge: 0a01963 215617c
Author: Andy Wingo <address@hidden>
Date: Tue Aug 7 12:43:25 2018 +0200
Merge branch 'master' into lightning
This includes a manual cherry-pick of relevant stable-2.2 commits up to
4c91de3e45e7c98d5b7c484509fe5c59bd70f9fd.
.dir-locals.el | 3 +-
NEWS | 162 +++++++++++++++++-
doc/ref/api-data.texi | 2 +-
doc/ref/api-evaluation.texi | 10 +-
doc/ref/api-lalr.texi | 4 +-
doc/ref/api-macros.texi | 4 +-
doc/ref/api-peg.texi | 2 +-
doc/ref/guile.texi | 3 +-
doc/ref/libguile-foreign-objects.texi | 4 +-
doc/ref/match.texi | 92 +++++++++-
doc/ref/srfi-modules.texi | 22 ++-
doc/ref/vm.texi | 4 +-
doc/ref/web.texi | 41 +++--
doc/release.org | 14 +-
libguile/Makefile.am | 9 +-
libguile/filesys.c | 18 +-
libguile/libguile-2.2-gdb.scm | 30 +++-
libguile/load.c | 9 +-
libguile/loader.c | 14 +-
libguile/modules.c | 17 ++
libguile/numbers.c | 2 +-
libguile/posix.c | 28 +++-
libguile/r6rs-ports.c | 18 +-
libguile/strings.c | 6 +
libguile/vm-engine.c | 38 +++--
libguile/vm.c | 18 +-
module/Makefile.am | 1 +
module/ice-9/boot-9.scm | 128 +++++++-------
module/ice-9/command-line.scm | 4 +-
module/ice-9/threads.scm | 11 +-
module/language/cps/types.scm | 239 +++++++++++++++++++-------
module/language/elisp/compile-tree-il.scm | 11 +-
module/language/elisp/falias.scm | 20 +++
module/language/elisp/spec.scm | 16 +-
module/language/tree-il/analyze.scm | 34 +++-
module/language/tree-il/compile-cps.scm | 1 +
module/language/tree-il/peval.scm | 6 +-
module/oop/goops.scm | 6 +-
module/rnrs/io/simple.scm | 6 +-
module/scripts/compile.scm | 19 ++-
module/srfi/Makefile.am | 52 ------
module/srfi/srfi-18.scm | 50 +++---
module/srfi/srfi-19.scm | 20 +--
module/srfi/srfi-71.scm | 267 ++++++++++++++++++++++++++++++
module/system/base/message.scm | 9 +-
module/system/base/target.scm | 12 +-
module/system/base/types.scm | 34 +++-
module/system/vm/linker.scm | 6 +-
module/web/client.scm | 159 +++++++++---------
test-suite/Makefile.am | 2 +
test-suite/tests/i18n.test | 66 +++++---
test-suite/tests/posix.test | 19 ++-
test-suite/tests/r6rs-ports.test | 12 +-
test-suite/tests/srfi-18.test | 18 +-
test-suite/tests/srfi-71.test | 46 +++++
test-suite/tests/tree-il.test | 84 +++++++++-
test-suite/tests/types.test | 31 +++-
test-suite/tests/vm.test | 54 ++++++
58 files changed, 1549 insertions(+), 468 deletions(-)
diff --cc libguile/vm-engine.c
index 4c92803,4b55906..41b62bb
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@@ -318,10 -321,10 +318,11 @@@ VM_NAME (scm_thread *thread
*/
VM_DEFINE_OP (0, halt, "halt", OP1 (X32))
{
- /* Boot closure in r0, empty frame in r1/r2, proc in r3, values from
r4. */
-
- uint32_t nvals = FRAME_LOCALS_COUNT_FROM (4);
+ size_t frame_size = 3;
+ /* Empty frame, then values. */
+ size_t first_value = frame_size;
+ uint32_t nvals = FRAME_LOCALS_COUNT_FROM (first_value);
+ union scm_vm_stack_element *fp;
SCM ret;
if (nvals == 1)
@@@ -333,12 -336,13 +334,13 @@@
VM_ASSERT (nvals <= (UINTPTR_MAX >> 8), abort ());
ret = scm_words ((nvals << 8) | scm_tc7_values, nvals + 1);
for (n = 0; n < nvals; n++)
- SCM_SET_CELL_OBJECT (ret, n+1, FP_REF (4 + n));
+ SCM_SET_CELL_OBJECT (ret, n+1, FP_REF (first_value + n));
}
- VP->ip = SCM_FRAME_VIRTUAL_RETURN_ADDRESS (VP->fp);
- VP->sp = SCM_FRAME_PREVIOUS_SP (VP->fp);
- VP->fp = SCM_FRAME_DYNAMIC_LINK (VP->fp);
+ fp = VP->fp;
+ VP->fp = SCM_FRAME_DYNAMIC_LINK (fp);
- VP->ip = SCM_FRAME_RETURN_ADDRESS (fp);
++ VP->ip = SCM_FRAME_VIRTUAL_RETURN_ADDRESS (fp);
+ VP->sp = SCM_FRAME_PREVIOUS_SP (fp);
return ret;
}
@@@ -364,11 -368,13 +366,12 @@@
UNPACK_24 (op, proc);
UNPACK_24 (ip[1], nlocals);
- PUSH_CONTINUATION_HOOK ();
-
old_fp = VP->fp;
- VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1);
- SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp);
- SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (VP->fp, ip + 2);
- SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (VP->fp, 0);
+ new_fp = SCM_FRAME_SLOT (old_fp, proc - 1);
+ SCM_FRAME_SET_DYNAMIC_LINK (new_fp, old_fp);
- SCM_FRAME_SET_RETURN_ADDRESS (new_fp, ip + 2);
++ SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (new_fp, ip + 2);
++ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (new_fp, 0);
+ VP->fp = new_fp;
RESET_FRAME (nlocals);
@@@ -404,11 -412,13 +407,12 @@@
UNPACK_24 (ip[1], nlocals);
label = ip[2];
- PUSH_CONTINUATION_HOOK ();
-
old_fp = VP->fp;
- VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1);
- SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp);
- SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (VP->fp, ip + 3);
- SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (VP->fp, 0);
+ new_fp = SCM_FRAME_SLOT (old_fp, proc - 1);
+ SCM_FRAME_SET_DYNAMIC_LINK (new_fp, old_fp);
- SCM_FRAME_SET_RETURN_ADDRESS (new_fp, ip + 3);
++ SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (new_fp, ip + 3);
++ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (new_fp, 0);
+ VP->fp = new_fp;
RESET_FRAME (nlocals);
@@@ -2383,9 -2391,11 +2387,11 @@@
*/
VM_DEFINE_OP (184, return_from_interrupt, "return-from-interrupt", OP1
(X32))
{
- VP->sp = sp = SCM_FRAME_PREVIOUS_SP (VP->fp);
- ip = SCM_FRAME_VIRTUAL_RETURN_ADDRESS (VP->fp);
- VP->fp = SCM_FRAME_DYNAMIC_LINK (VP->fp);
+ union scm_vm_stack_element *fp = VP->fp;
+
- ip = SCM_FRAME_RETURN_ADDRESS (fp);
++ ip = SCM_FRAME_VIRTUAL_RETURN_ADDRESS (fp);
+ VP->fp = SCM_FRAME_DYNAMIC_LINK (fp);
+ VP->sp = sp = SCM_FRAME_PREVIOUS_SP (fp);
NEXT (0);
}
diff --cc libguile/vm.c
index 0e60b29,cc95a2c..cb42783
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@@ -989,25 -1011,27 +989,26 @@@ cons_rest (scm_thread *thread, uint32_
}
static void
-push_interrupt_frame (scm_thread *thread)
+push_interrupt_frame (scm_thread *thread, uint8_t *mra)
{
- union scm_vm_stack_element *old_fp;
+ union scm_vm_stack_element *old_fp, *new_fp;
+ size_t frame_overhead = 3;
size_t old_frame_size = frame_locals_count (thread);
SCM proc = scm_i_async_pop (thread);
- /* No PUSH_CONTINUATION_HOOK, as we can't usefully
- POP_CONTINUATION_HOOK because there are no return values. */
-
- /* Three slots: two for RA and dynamic link, one for proc. */
- alloc_frame (thread, old_frame_size + 3);
+ /* Reserve space for frame and callee. */
+ alloc_frame (thread, old_frame_size + frame_overhead + 1);
old_fp = thread->vm.fp;
- thread->vm.fp = SCM_FRAME_SLOT (old_fp, old_frame_size + frame_overhead -
1);
- SCM_FRAME_SET_DYNAMIC_LINK (thread->vm.fp, old_fp);
- new_fp = SCM_FRAME_SLOT (old_fp, old_frame_size + 1);
++ new_fp = SCM_FRAME_SLOT (old_fp, old_frame_size + frame_overhead - 1);
+ SCM_FRAME_SET_DYNAMIC_LINK (new_fp, old_fp);
/* Arrange to return to the same handle-interrupts opcode to handle
any additional interrupts. */
- SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (thread->vm.fp, thread->vm.ip);
- SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (thread->vm.fp, mra);
- SCM_FRAME_SET_RETURN_ADDRESS (new_fp, thread->vm.ip);
++ SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (new_fp, thread->vm.ip);
++ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (new_fp, mra);
+ SCM_FRAME_LOCAL (new_fp, 0) = proc;
- SCM_FRAME_LOCAL (thread->vm.fp, 0) = proc;
+ thread->vm.fp = new_fp;
}
struct return_to_continuation_data
@@@ -1370,15 -1398,13 +1371,14 @@@ scm_call_n (SCM proc, SCM *argv, size_
call_fp = vp->sp + call_nlocals;
return_fp = call_fp + frame_size + return_nlocals;
- SCM_FRAME_SET_RETURN_ADDRESS (return_fp, vp->ip);
+ SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (return_fp, vp->ip);
+ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (return_fp, 0);
SCM_FRAME_SET_DYNAMIC_LINK (return_fp, vp->fp);
- SCM_FRAME_LOCAL (return_fp, 0) = vm_boot_continuation;
vp->ip = (uint32_t *) vm_boot_continuation_code;
- vp->fp = call_fp;
- SCM_FRAME_SET_RETURN_ADDRESS (call_fp, vp->ip);
+ SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (call_fp, vp->ip);
+ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (call_fp, 0);
SCM_FRAME_SET_DYNAMIC_LINK (call_fp, return_fp);
SCM_FRAME_LOCAL (call_fp, 0) = proc;
for (i = 0; i < nargs; i++)
- [Guile-commits] 53/58: r6rs-ports: 'put-bytevector' accepts 64-bit integers., (continued)
- [Guile-commits] 53/58: r6rs-ports: 'put-bytevector' accepts 64-bit integers., Andy Wingo, 2018/08/07
- [Guile-commits] 47/58: Update release docs., Andy Wingo, 2018/08/07
- [Guile-commits] 42/58: vm: Fix stack-marking bug in multi-threaded programs., Andy Wingo, 2018/08/07
- [Guile-commits] 52/58: compile: Update copyright year., Andy Wingo, 2018/08/07
- [Guile-commits] 25/58: Add SRFI 71: Extended LET-syntax for multiple values., Andy Wingo, 2018/08/07
- [Guile-commits] 37/58: types: Recognize 'scm_t_port_type' and decode port type name., Andy Wingo, 2018/08/07
- [Guile-commits] 48/58: Make srfi-71 visible through 'cond-expand'., Andy Wingo, 2018/08/07
- [Guile-commits] 46/58: build: Really build srfi/srfi-71.scm., Andy Wingo, 2018/08/07
- [Guile-commits] 43/58: Serialize accesses to submodule hash tables., Andy Wingo, 2018/08/07
- [Guile-commits] 50/58: compile: Add '-x' flag., Andy Wingo, 2018/08/07
- [Guile-commits] 57/58: Merge branch 'master' into lightning,
Andy Wingo <=
- [Guile-commits] 44/58: Update copyright years in '--version' and the manual., Andy Wingo, 2018/08/07
- [Guile-commits] 55/58: srfi-19: Remove unused procedure., Andy Wingo, 2018/08/07
- [Guile-commits] 35/58: web: Export http-request., Andy Wingo, 2018/08/07
- [Guile-commits] 56/58: Fix R6RS call-with-{input, output}-file to open textual ports., Andy Wingo, 2018/08/07
- [Guile-commits] 54/58: Add -Wshadowed-toplevel., Andy Wingo, 2018/08/07