diff options
author | Andy Wingo <wingo@pobox.com> | 2009-08-06 17:46:38 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-08-06 17:46:38 +0200 |
commit | 9b29d6079184d2d92fef5a1b7eba79f39fa3ef82 (patch) | |
tree | 03ecb217709780061b92a06c7154c068e693c8c6 /libguile/vm-i-scheme.c | |
parent | 80af1168751e59a3ee5c4a79febb2da23d36112d (diff) | |
download | guile-9b29d6079184d2d92fef5a1b7eba79f39fa3ef82.tar.gz |
loop detection in the house
* libguile/vm-i-scheme.c (vector-ref, vector-set): Sync registers if we
call out to C.
* module/language/tree-il/compile-glil.scm (flatten-lambda): Add an
extra argument, the self-label, which should be the gensym under which
the procedure is bound in a <fix> expression.
(flatten): If we see a call to a lexical ref to the self-label in a
tail position, rename and goto instead of goto/args, which will tear
down the frame -- or will, in the future. It's a primitive form of
loop detection.
* module/language/tree-il/primitives.scm (zero?): Expand to (= x 0).
Diffstat (limited to 'libguile/vm-i-scheme.c')
-rw-r--r-- | libguile/vm-i-scheme.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c index 675ec1a0a..0cace147d 100644 --- a/libguile/vm-i-scheme.c +++ b/libguile/vm-i-scheme.c @@ -315,7 +315,10 @@ VM_DEFINE_FUNCTION (129, vector_ref, "vector-ref", 2) && i < SCM_I_VECTOR_LENGTH (vect))) RETURN (SCM_I_VECTOR_ELTS (vect)[i]); else - RETURN (scm_vector_ref (vect, idx)); + { + SYNC_REGISTER (); + RETURN (scm_vector_ref (vect, idx)); + } } VM_DEFINE_INSTRUCTION (130, vector_set, "vector-set", 0, 3, 0) @@ -329,7 +332,10 @@ VM_DEFINE_INSTRUCTION (130, vector_set, "vector-set", 0, 3, 0) && i < SCM_I_VECTOR_LENGTH (vect))) SCM_I_VECTOR_WELTS (vect)[i] = val; else - scm_vector_set_x (vect, idx, val); + { + SYNC_REGISTER (); + scm_vector_set_x (vect, idx, val); + } NEXT; } |