[movitz-cvs] CVS update: movitz/compiler.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Sat Nov 13 16:13:03 UTC 2004


Update of /project/movitz/cvsroot/movitz
In directory common-lisp.net:/tmp/cvs-serv26776

Modified Files:
	compiler.lisp 
Log Message:
Fixed make-compiled-lexical-control-transfer to do the right thing
when jumping across dynamic bindings, finally.

Date: Sat Nov 13 17:13:02 2004
Author: ffjeld

Index: movitz/compiler.lisp
diff -u movitz/compiler.lisp:1.104 movitz/compiler.lisp:1.105
--- movitz/compiler.lisp:1.104	Wed Nov 10 18:37:20 2004
+++ movitz/compiler.lisp	Sat Nov 13 17:13:01 2004
@@ -8,7 +8,7 @@
 ;;;; Created at:    Wed Oct 25 12:30:49 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: compiler.lisp,v 1.104 2004/11/10 17:37:20 ffjeld Exp $
+;;;; $Id: compiler.lisp,v 1.105 2004/11/13 16:13:01 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -5742,9 +5742,8 @@
       (stack-delta from-env to-env)
     (assert stack-distance)
     (assert (null unwind-protects) ()
-      "Lexical unwind-protect not implemented, to-env: ~S." to-env)
-    (when (plusp num-dynamic-slots)
-      (warn "Lexical jump across ~D specials." num-dynamic-slots))
+      "Lexical unwind-protect not implemented, to-env: ~S. (this is not supposed to happen)"
+      to-env)
     (cond
      ((and (eq t stack-distance)
 	   (zerop num-dynamic-slots))
@@ -5762,7 +5761,14 @@
 			:env to-env
 			:result-mode (exit-result-mode to-env)
 			:form `(muerte::with-cloak (,return-mode)
-				 (muerte::dynamic-unwind ,num-dynamic-slots)))
+				 (muerte::with-inline-assembly (:returns :nothing)
+				   ;; Compute target dynamic-env
+				   (:locally (:movl (:edi (:edi-offset dynamic-env)) :eax))
+				   ,@(loop repeat num-dynamic-slots
+					 collect `(:movl (:eax 12) :eax))
+				   (:locally (:call (:edi (:edi-offset dynamic-unwind-next))))
+				   (:locally (:movl :eax (:edi (:edi-offset dynamic-env))))
+				   (:jc '(:sub-program () (:int 63))))))
 		      `((:load-lexical ,(save-esp-variable to-env) :esp)
 			(:jmp ',to-label)))))
      ((zerop num-dynamic-slots)
@@ -5782,7 +5788,14 @@
 			:env to-env
 			:result-mode (exit-result-mode to-env)
 			:form `(muerte::with-cloak (,return-mode)
-				 (muerte::dynamic-unwind ,num-dynamic-slots)))
+				 (muerte::with-inline-assembly (:returns :nothing)
+				   ;; Compute target dynamic-env
+				   (:locally (:movl (:edi (:edi-offset dynamic-env)) :eax))
+				   ,@(loop repeat num-dynamic-slots
+					 collect `(:movl (:eax 12) :eax))
+				   (:locally (:call (:edi (:edi-offset dynamic-unwind-next))))
+				   (:locally (:movl :eax (:edi (:edi-offset dynamic-env))))
+				   (:jc '(:sub-program () (:int 63))))))
 		      (make-compiled-stack-restore stack-distance
 						   (exit-result-mode to-env)
 						   return-mode)





More information about the Movitz-cvs mailing list