[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 15/19: Tree-IL-to-CPS lowers to high-level object reprs:
From: |
Andy Wingo |
Subject: |
[Guile-commits] 15/19: Tree-IL-to-CPS lowers to high-level object reprs: pairs |
Date: |
Thu, 22 Jun 2023 10:12:48 -0400 (EDT) |
wingo pushed a commit to branch main
in repository guile.
commit 4fb4bebe419a70842d48baafad548851a5c24c1e
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Thu Jun 22 11:23:22 2023 +0200
Tree-IL-to-CPS lowers to high-level object reprs: pairs
* module/language/tree-il/compile-cps.scm: Lower to cons, car, set-car!,
etc.
---
module/language/tree-il/compile-cps.scm | 27 ++++-----------------------
1 file changed, 4 insertions(+), 23 deletions(-)
diff --git a/module/language/tree-il/compile-cps.scm
b/module/language/tree-il/compile-cps.scm
index e83192062..7979f4ff1 100644
--- a/module/language/tree-il/compile-cps.scm
+++ b/module/language/tree-il/compile-cps.scm
@@ -421,25 +421,6 @@
(letk kheap-object ($kargs () () ($branch knot-pair k src pred #f (x))))
(build-term ($branch knot-pair kheap-object src 'heap-object? #f (x)))))
-(define-primcall-converter cons
- (lambda (cps k src op param head tail)
- (with-cps cps
- (letv pair)
- (letk kdone
- ($kargs () ()
- ($continue k src ($values (pair)))))
- (letk ktail
- ($kargs () ()
- ($continue kdone src
- ($primcall 'scm-set!/immediate '(pair . 1) (pair tail)))))
- (letk khead
- ($kargs ('pair) (pair)
- ($continue ktail src
- ($primcall 'scm-set!/immediate '(pair . 0) (pair head)))))
- (build-term
- ($continue khead src
- ($primcall 'allocate-words/immediate '(pair . 2) ()))))))
-
(define-primcall-converter car
(lambda (cps k src op param pair)
(ensure-pair
@@ -448,7 +429,7 @@
(with-cps cps
(build-term
($continue k src
- ($primcall 'scm-ref/immediate '(pair . 0) (pair)))))))))
+ ($primcall 'car #f (pair)))))))))
(define-primcall-converter cdr
(lambda (cps k src op param pair)
@@ -458,7 +439,7 @@
(with-cps cps
(build-term
($continue k src
- ($primcall 'scm-ref/immediate '(pair . 1) (pair)))))))))
+ ($primcall 'cdr #f (pair)))))))))
(define-primcall-converter set-car!
(lambda (cps k src op param pair val)
@@ -469,7 +450,7 @@
(with-cps cps
(build-term
($continue k src
- ($primcall 'scm-set!/immediate '(pair . 0) (pair val)))))))))
+ ($primcall 'set-car! #f (pair val)))))))))
(define-primcall-converter set-cdr!
(lambda (cps k src op param pair val)
@@ -480,7 +461,7 @@
(with-cps cps
(build-term
($continue k src
- ($primcall 'scm-set!/immediate '(pair . 1) (pair val)))))))))
+ ($primcall 'set-cdr! #f (pair val)))))))))
(define-primcall-converter %box-ref
(lambda (cps k src op param box)
- [Guile-commits] branch main updated (aa2cfe7cf -> 85f85a0fc), Andy Wingo, 2023/06/22
- [Guile-commits] 04/19: Move f64->scm lowering to lower-primcalls, Andy Wingo, 2023/06/22
- [Guile-commits] 05/19: Add support for higher-level object representations in type analysis, Andy Wingo, 2023/06/22
- [Guile-commits] 03/19: Wire in lower-primitives pass, Andy Wingo, 2023/06/22
- [Guile-commits] 07/19: Fix effects analysis bug for synthesized definitions at allocations, Andy Wingo, 2023/06/22
- [Guile-commits] 02/19: New CPS pass: lower-primcalls, Andy Wingo, 2023/06/22
- [Guile-commits] 06/19: Add effects analysis for new high-level object accessors, Andy Wingo, 2023/06/22
- [Guile-commits] 08/19: Add CSE auxiliary definitions for cons, set-car! etc, Andy Wingo, 2023/06/22
- [Guile-commits] 16/19: Tree-IL-to-CPS lowers to high-level object reprs: structs, Andy Wingo, 2023/06/22
- [Guile-commits] 13/19: Tree-IL-to-CPS lowers to high-level object representations: boxes, Andy Wingo, 2023/06/22
- [Guile-commits] 15/19: Tree-IL-to-CPS lowers to high-level object reprs: pairs,
Andy Wingo <=
- [Guile-commits] 18/19: Tree-IL-to-CPS lowers to high-level object reprs: strings, Andy Wingo, 2023/06/22
- [Guile-commits] 19/19: Tree-IL-to-CPS lowers to high-level object reprs: vectors, Andy Wingo, 2023/06/22
- [Guile-commits] 01/19: Fix target-max-size-t/scm to not be a fraction (oops), Andy Wingo, 2023/06/22
- [Guile-commits] 09/19: Remove useless code in CSE, Andy Wingo, 2023/06/22
- [Guile-commits] 12/19: Closure conversion produces high-level object representations, Andy Wingo, 2023/06/22
- [Guile-commits] 10/19: DCE ignores setters to dead objects, Andy Wingo, 2023/06/22
- [Guile-commits] 17/19: Tree-IL-to-CPS lowers to high-level object reprs: bytevectors, Andy Wingo, 2023/06/22
- [Guile-commits] 11/19: Contification uses 'cons primcall, Andy Wingo, 2023/06/22
- [Guile-commits] 14/19: Tree-IL-to-CPS lowers to high-level object reprs: atomic boxes, Andy Wingo, 2023/06/22