mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 22:10:29 +02:00
inline dynwind guards for normal control flow
* module/language/tree-il.scm (<tree-il>): Add `pre' and `post' fields to <dynwind>, so that we can inline the guard bodies in the normal control-flow case. It also avoids duplicating code in compile-glil, which probably hides more bugs in 2.0. (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold) (make-tree-il-folder, post-order!, pre-order!): Update. * module/language/tree-il/analyze.scm (analyze-lexicals): Update. * module/language/tree-il/compile-glil.scm (flatten-lambda-case): Update to use `pre' and `post' instead of compiling code twice. * module/language/tree-il/debug.scm (verify-tree-il): Update. * module/language/tree-il/peval.scm (peval): Update. Instead of doing complicated things in <dynwind>, handle 'dynamic-wind primcalls. * module/language/tree-il/primitives.scm (*primitive-expand-table*): Remove 'dynamic-wind mess. Adapt '@dynamic-wind. * test-suite/tests/tree-il.test ("partial evaluation"): Update tests.
This commit is contained in:
parent
2f4aae6bce
commit
880e794812
8 changed files with 115 additions and 92 deletions
|
@ -1464,8 +1464,12 @@
|
|||
(pass-if-peval
|
||||
;; Non-constant guards get lexical bindings.
|
||||
(dynamic-wind foo (lambda () bar) baz)
|
||||
(let (pre post) (_ _) ((toplevel foo) (toplevel baz))
|
||||
(dynwind (lexical pre _) (toplevel bar) (lexical post _))))
|
||||
(let (w u) (_ _) ((toplevel foo) (toplevel baz))
|
||||
(dynwind (lexical w _)
|
||||
(call (lexical w _))
|
||||
(toplevel bar)
|
||||
(call (lexical u _))
|
||||
(lexical u _))))
|
||||
|
||||
(pass-if-peval
|
||||
;; Constant guards don't need lexical bindings.
|
||||
|
@ -1474,7 +1478,9 @@
|
|||
(lambda ()
|
||||
(lambda-case
|
||||
((() #f #f #f () ()) (toplevel foo))))
|
||||
(toplevel foo)
|
||||
(toplevel bar)
|
||||
(toplevel baz)
|
||||
(lambda ()
|
||||
(lambda-case
|
||||
((() #f #f #f () ()) (toplevel baz))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue