When the continuation parser makes a transition from interpreted to
authorChris Hanson <org/chris-hanson/cph>
Wed, 8 Aug 1990 00:58:42 +0000 (00:58 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 8 Aug 1990 00:58:42 +0000 (00:58 +0000)
compiled frames or vice-versa, the history subproblem must be stepped.
The reasons for this are that:

1. When interpreted code is called from compiled code, a new history
subproblem is pushed.  This subproblem must be discarded when making
the transition back to the compiled code stack frame.

2. When compiled code is called from interpreted code, the existing
history subproblem is preserved for use if the compiled code
tail-recurses back into interpreted code.  This subproblem must be
discarded when making the transition back to the interpreted code
stack frame.

v7/src/runtime/conpar.scm
v7/src/runtime/histry.scm
v7/src/runtime/version.scm
v8/src/runtime/conpar.scm

index f57b6abbdddea72b5972a742514facc59bde05cb..7c011c7b65ceb9ecfd438486930b8646b280d907 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/conpar.scm,v 14.15 1990/06/28 18:09:25 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/conpar.scm,v 14.16 1990/08/08 00:57:07 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -209,7 +209,10 @@ MIT in each case. |#
                      (parser-state/dynamic-state state)
                      (parser-state/fluid-bindings state)
                      (parser-state/interrupt-mask state)
-                     (if history-subproblem? history undefined-history)
+                     (if (and history-subproblem?
+                              (stack-frame-type/subproblem? type))
+                         history
+                         undefined-history)
                      previous-history-offset
                      previous-history-control-point
                      (+ (vector-length elements) n-elements)
@@ -461,7 +464,7 @@ MIT in each case. |#
   (set! stack-frame-type/return-to-interpreter
        (make-stack-frame-type false
                               false
-                              false
+                              true
                               1
                               parser/standard-next))
   (set! word-size
@@ -517,11 +520,8 @@ MIT in each case. |#
     (standard-frame 'HALT 2)
     (standard-frame 'JOIN-STACKLETS 2)
     (standard-frame 'POP-RETURN-ERROR 2)
-    (standard-frame 'REENTER-COMPILED-CODE 2)
     (standard-frame 'RESTORE-VALUE 2)
-    (standard-frame 'COMPILER-INTERRUPT-RESTART 3)
-    (standard-frame 'COMPILER-LINK-CACHES-RESTART 8)
-\f
+
     (standard-subproblem 'IN-PACKAGE-CONTINUE 2)
     (standard-subproblem 'ACCESS-CONTINUE 2)
     (standard-subproblem 'PRIMITIVE-COMBINATION-1-APPLY 2)
@@ -544,17 +544,6 @@ MIT in each case. |#
     (standard-subproblem 'REPEAT-DISPATCH 4)
     (standard-subproblem 'PRIMITIVE-COMBINATION-3-FIRST-OPERAND 4)
     (standard-subproblem 'PRIMITIVE-COMBINATION-3-APPLY 4)
-    (standard-subproblem 'COMPILER-REFERENCE-RESTART 4)
-    (standard-subproblem 'COMPILER-SAFE-REFERENCE-RESTART 4)
-    (standard-subproblem 'COMPILER-ACCESS-RESTART 4)
-    (standard-subproblem 'COMPILER-UNASSIGNED?-RESTART 4)
-    (standard-subproblem 'COMPILER-UNBOUND?-RESTART 4)
-    (standard-subproblem 'COMPILER-REFERENCE-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-SAFE-REFERENCE-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-UNASSIGNED?-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-ASSIGNMENT-RESTART 5)
-    (standard-subproblem 'COMPILER-DEFINITION-RESTART 5)
-    (standard-subproblem 'COMPILER-ASSIGNMENT-TRAP-RESTART 5)
     (standard-subproblem 'MOVE-TO-ADJACENT-POINT 6)
     (standard-subproblem 'COMBINATION-SAVE-VALUE length/combination-save-value)
     (standard-subproblem 'REPEAT-PRIMITIVE length/repeat-primitive)
@@ -563,13 +552,35 @@ MIT in each case. |#
       (standard-subproblem 'COMBINATION-APPLY length)
       (standard-subproblem 'INTERNAL-APPLY length)
       (standard-subproblem 'INTERNAL-APPLY-VAL length))
+\f
+    (let ((compiler-frame
+          (lambda (name length)
+            (stack-frame-type name false true length parser/standard-next)))
+         (compiler-subproblem
+          (lambda (name length)
+            (stack-frame-type name true true length parser/standard-next))))
+
+      (let ((length (length/application-frame 4 0)))
+       (compiler-subproblem 'COMPILER-LOOKUP-APPLY-TRAP-RESTART length)
+       (compiler-subproblem 'COMPILER-OPERATOR-LOOKUP-TRAP-RESTART length))
+
+      (compiler-frame 'COMPILER-INTERRUPT-RESTART 3)      (compiler-frame 'COMPILER-LINK-CACHES-RESTART 8)
+      (compiler-frame 'REENTER-COMPILED-CODE 2)
+
+      (compiler-subproblem 'COMPILER-ACCESS-RESTART 4)
+      (compiler-subproblem 'COMPILER-ASSIGNMENT-RESTART 5)
+      (compiler-subproblem 'COMPILER-ASSIGNMENT-TRAP-RESTART 5)
+      (compiler-subproblem 'COMPILER-DEFINITION-RESTART 5)
+      (compiler-subproblem 'COMPILER-LOOKUP-APPLY-RESTART
+                          (length/application-frame 4 1))
+      (compiler-subproblem 'COMPILER-REFERENCE-RESTART 4)
+      (compiler-subproblem 'COMPILER-REFERENCE-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-SAFE-REFERENCE-RESTART 4)
+      (compiler-subproblem 'COMPILER-SAFE-REFERENCE-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNASSIGNED?-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNASSIGNED?-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNBOUND?-RESTART 4))
 
-    (standard-subproblem 'COMPILER-LOOKUP-APPLY-RESTART
-                        (length/application-frame 4 1))
-
-    (let ((length (length/application-frame 4 0)))
-      (standard-subproblem 'COMPILER-LOOKUP-APPLY-TRAP-RESTART length)
-      (standard-subproblem 'COMPILER-OPERATOR-LOOKUP-TRAP-RESTART length))
     (stack-frame-type 'HARDWARE-TRAP
                      true
                      false
index 445498e6d0684ad5e9c680a38a9a1791b78c5ba5..ae69efcea08d3b551dfd3dcd2d7811f2ee44b289 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/histry.scm,v 14.2 1989/10/26 06:46:19 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/histry.scm,v 14.3 1990/08/08 00:58:12 cph Rel $
 
-Copyright (c) 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -212,7 +212,7 @@ MIT in each case. |#
          (loop (next-reduction current) step)))))
 
 (define (dummy-compiler-reduction? reduction)
-  (and (null? (reduction-expression reduction))
+  (and (false? (reduction-expression reduction))
        (eq? (ucode-return-address pop-from-compiled-code)
            (reduction-environment reduction))))
 
@@ -233,4 +233,5 @@ MIT in each case. |#
   (set! the-empty-history
        (cons (vector-ref (get-fixed-objects-vector)
                          (fixed-objects-vector-slot 'DUMMY-HISTORY))
-             '())))
\ No newline at end of file
+             '()))
+  unspecific)
\ No newline at end of file
index eba6a74bc598bbdf0b6214d65eb854caaf17942f..9441ab952d33fdd0650c16aa4aca16433af2b686 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.90 1990/07/20 01:24:13 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/version.scm,v 14.91 1990/08/08 00:58:42 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -45,7 +45,7 @@ MIT in each case. |#
                     '()))
   (add-system! microcode-system)
   (add-event-receiver! event:after-restore snarf-microcode-version!)
-  (add-identification! "Runtime" 14 90))
+  (add-identification! "Runtime" 14 91))
 (define microcode-system)
 
 (define (snarf-microcode-version!)
index a0ed15bac7079ad3189fcc6e323d0f51b25ca1e4..fbc7d19d4729a3781d5fc59b5e6a9b3bd00d85ff 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/conpar.scm,v 14.15 1990/06/28 18:09:25 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/conpar.scm,v 14.16 1990/08/08 00:57:07 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -209,7 +209,10 @@ MIT in each case. |#
                      (parser-state/dynamic-state state)
                      (parser-state/fluid-bindings state)
                      (parser-state/interrupt-mask state)
-                     (if history-subproblem? history undefined-history)
+                     (if (and history-subproblem?
+                              (stack-frame-type/subproblem? type))
+                         history
+                         undefined-history)
                      previous-history-offset
                      previous-history-control-point
                      (+ (vector-length elements) n-elements)
@@ -461,7 +464,7 @@ MIT in each case. |#
   (set! stack-frame-type/return-to-interpreter
        (make-stack-frame-type false
                               false
-                              false
+                              true
                               1
                               parser/standard-next))
   (set! word-size
@@ -517,11 +520,8 @@ MIT in each case. |#
     (standard-frame 'HALT 2)
     (standard-frame 'JOIN-STACKLETS 2)
     (standard-frame 'POP-RETURN-ERROR 2)
-    (standard-frame 'REENTER-COMPILED-CODE 2)
     (standard-frame 'RESTORE-VALUE 2)
-    (standard-frame 'COMPILER-INTERRUPT-RESTART 3)
-    (standard-frame 'COMPILER-LINK-CACHES-RESTART 8)
-\f
+
     (standard-subproblem 'IN-PACKAGE-CONTINUE 2)
     (standard-subproblem 'ACCESS-CONTINUE 2)
     (standard-subproblem 'PRIMITIVE-COMBINATION-1-APPLY 2)
@@ -544,17 +544,6 @@ MIT in each case. |#
     (standard-subproblem 'REPEAT-DISPATCH 4)
     (standard-subproblem 'PRIMITIVE-COMBINATION-3-FIRST-OPERAND 4)
     (standard-subproblem 'PRIMITIVE-COMBINATION-3-APPLY 4)
-    (standard-subproblem 'COMPILER-REFERENCE-RESTART 4)
-    (standard-subproblem 'COMPILER-SAFE-REFERENCE-RESTART 4)
-    (standard-subproblem 'COMPILER-ACCESS-RESTART 4)
-    (standard-subproblem 'COMPILER-UNASSIGNED?-RESTART 4)
-    (standard-subproblem 'COMPILER-UNBOUND?-RESTART 4)
-    (standard-subproblem 'COMPILER-REFERENCE-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-SAFE-REFERENCE-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-UNASSIGNED?-TRAP-RESTART 4)
-    (standard-subproblem 'COMPILER-ASSIGNMENT-RESTART 5)
-    (standard-subproblem 'COMPILER-DEFINITION-RESTART 5)
-    (standard-subproblem 'COMPILER-ASSIGNMENT-TRAP-RESTART 5)
     (standard-subproblem 'MOVE-TO-ADJACENT-POINT 6)
     (standard-subproblem 'COMBINATION-SAVE-VALUE length/combination-save-value)
     (standard-subproblem 'REPEAT-PRIMITIVE length/repeat-primitive)
@@ -563,13 +552,35 @@ MIT in each case. |#
       (standard-subproblem 'COMBINATION-APPLY length)
       (standard-subproblem 'INTERNAL-APPLY length)
       (standard-subproblem 'INTERNAL-APPLY-VAL length))
+\f
+    (let ((compiler-frame
+          (lambda (name length)
+            (stack-frame-type name false true length parser/standard-next)))
+         (compiler-subproblem
+          (lambda (name length)
+            (stack-frame-type name true true length parser/standard-next))))
+
+      (let ((length (length/application-frame 4 0)))
+       (compiler-subproblem 'COMPILER-LOOKUP-APPLY-TRAP-RESTART length)
+       (compiler-subproblem 'COMPILER-OPERATOR-LOOKUP-TRAP-RESTART length))
+
+      (compiler-frame 'COMPILER-INTERRUPT-RESTART 3)      (compiler-frame 'COMPILER-LINK-CACHES-RESTART 8)
+      (compiler-frame 'REENTER-COMPILED-CODE 2)
+
+      (compiler-subproblem 'COMPILER-ACCESS-RESTART 4)
+      (compiler-subproblem 'COMPILER-ASSIGNMENT-RESTART 5)
+      (compiler-subproblem 'COMPILER-ASSIGNMENT-TRAP-RESTART 5)
+      (compiler-subproblem 'COMPILER-DEFINITION-RESTART 5)
+      (compiler-subproblem 'COMPILER-LOOKUP-APPLY-RESTART
+                          (length/application-frame 4 1))
+      (compiler-subproblem 'COMPILER-REFERENCE-RESTART 4)
+      (compiler-subproblem 'COMPILER-REFERENCE-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-SAFE-REFERENCE-RESTART 4)
+      (compiler-subproblem 'COMPILER-SAFE-REFERENCE-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNASSIGNED?-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNASSIGNED?-TRAP-RESTART 4)
+      (compiler-subproblem 'COMPILER-UNBOUND?-RESTART 4))
 
-    (standard-subproblem 'COMPILER-LOOKUP-APPLY-RESTART
-                        (length/application-frame 4 1))
-
-    (let ((length (length/application-frame 4 0)))
-      (standard-subproblem 'COMPILER-LOOKUP-APPLY-TRAP-RESTART length)
-      (standard-subproblem 'COMPILER-OPERATOR-LOOKUP-TRAP-RESTART length))
     (stack-frame-type 'HARDWARE-TRAP
                      true
                      false