summaryrefslogtreecommitdiff
path: root/libguile/vm-i-system.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-03-03 21:46:38 +0100
committerAndy Wingo <wingo@pobox.com>2012-03-03 21:46:38 +0100
commitd5dbe0c1d5c0d53a652285ca565fa6c30a668f7f (patch)
tree6622edaaaa1003997122f1db7b54cf8b8ff8e648 /libguile/vm-i-system.c
parentdeaae8e9d7cbd0f8fc794fab5f4b4923d432ced0 (diff)
downloadguile-d5dbe0c1d5c0d53a652285ca565fa6c30a668f7f.tar.gz
optimize dynamic-wind when we know winders are thunks
* libguile/vm-i-system.c (wind): * module/language/tree-il/compile-glil.scm (flatten-lambda-case): Instead of making `wind' call `scm_thunk_p' on the winder and unwinder at runtime, make it the responsibility of the compiler to emit code to call thunk? and error, but only if the compiler cannot prove them to be thunks. * libguile/vm-engine.c (vm_engine): Remove a now-unused error block.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r--libguile/vm-i-system.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index f30ed9d02..2fce8346d 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -1616,17 +1616,9 @@ VM_DEFINE_INSTRUCTION (86, wind, "wind", 0, 2, 0)
SYNC_REGISTER ();
/* Push wind and unwind procedures onto the dynamic stack. Note that neither
are actually called; the compiler should emit calls to wind and unwind for
- the normal dynamic-wind control flow. */
- if (SCM_UNLIKELY (scm_is_false (scm_thunk_p (wind))))
- {
- finish_args = wind;
- goto vm_error_not_a_thunk;
- }
- if (SCM_UNLIKELY (scm_is_false (scm_thunk_p (unwind))))
- {
- finish_args = unwind;
- goto vm_error_not_a_thunk;
- }
+ the normal dynamic-wind control flow. Also note that the compiler
+ should have inserted checks that they wind and unwind procs are
+ thunks, if it could not prove that to be the case. */
scm_dynstack_push_dynwind (&current_thread->dynstack, wind, unwind);
NEXT;
}