summaryrefslogtreecommitdiff
path: root/module/language
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-01-07 18:24:15 +0100
committerAndy Wingo <wingo@pobox.com>2018-01-07 18:44:53 +0100
commitabfe04835b292b326f75faf61fdae4a795d1039c (patch)
tree51991e8710b9afe3ebd1bb7d7de5893b62b0fa9e /module/language
parent49fa4980bb58d8421acc0711d7acc8eaaf088050 (diff)
downloadguile-abfe04835b292b326f75faf61fdae4a795d1039c.tar.gz
Remove special optimizer and backend support for pairs
* module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/cse.scm (compute-equivalent-subexpressions): * module/language/cps/dce.scm (compute-live-code): * module/language/cps/effects-analysis.scm: * module/language/cps/types.scm: Remove support for cons, car, etc primcalls. * module/language/cps/effects-analysis.scm (&car, &cdr): Remove undefined exports. * module/system/vm/assembler.scm: Remove emit-cons, etc exports.
Diffstat (limited to 'module/language')
-rw-r--r--module/language/cps/compile-bytecode.scm4
-rw-r--r--module/language/cps/cse.scm5
-rw-r--r--module/language/cps/dce.scm3
-rw-r--r--module/language/cps/effects-analysis.scm15
-rw-r--r--module/language/cps/types.scm14
5 files changed, 2 insertions, 39 deletions
diff --git a/module/language/cps/compile-bytecode.scm b/module/language/cps/compile-bytecode.scm
index 59784921a..12ef69b77 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -327,10 +327,6 @@
(($ $primcall 'string-set! #f (string index char))
(emit-string-set! asm (from-sp (slot string)) (from-sp (slot index))
(from-sp (slot char))))
- (($ $primcall 'set-car! #f (pair value))
- (emit-set-car! asm (from-sp (slot pair)) (from-sp (slot value))))
- (($ $primcall 'set-cdr! #f (pair value))
- (emit-set-cdr! asm (from-sp (slot pair)) (from-sp (slot value))))
(($ $primcall 'push-fluid #f (fluid val))
(emit-push-fluid asm (from-sp (slot fluid)) (from-sp (slot val))))
(($ $primcall 'pop-fluid #f ())
diff --git a/module/language/cps/cse.scm b/module/language/cps/cse.scm
index f3c333c1a..17a648962 100644
--- a/module/language/cps/cse.scm
+++ b/module/language/cps/cse.scm
@@ -253,16 +253,13 @@ false. It could be that both true and false proofs are available."
(add-definitions
((b <- box #f o) (o <- box-ref #f b))
((box-set! #f b o) (o <- box-ref #f b))
- ((o <- cons #f x y) (x <- car #f o)
- (y <- cdr #f o))
+
((scm-set! p s i x) (x <- scm-ref p s i))
((scm-set!/tag p s x) (x <- scm-ref/tag p s))
((scm-set!/immediate p s x) (x <- scm-ref/immediate p s))
((word-set! p s i x) (x <- word-ref p s i))
((word-set!/immediate p s x) (x <- word-ref/immediate p s))
- ((set-car! #f o x) (x <- car #f o))
- ((set-cdr! #f o y) (y <- cdr #f o))
((s <- allocate-struct #f v n) (v <- struct-vtable #f s))
((s <- allocate-struct/immediate n v) (v <- struct-vtable #f s))
((struct-set! #f s i x) (x <- struct-ref #f s i))
diff --git a/module/language/cps/dce.scm b/module/language/cps/dce.scm
index 0a3a311df..2a054d71a 100644
--- a/module/language/cps/dce.scm
+++ b/module/language/cps/dce.scm
@@ -188,8 +188,7 @@ sites."
(and (causes-effect? fx &write)
(match exp
(($ $primcall
- (or 'set-car! 'set-cdr!
- 'box-set!
+ (or 'box-set!
'scm-set! 'scm-set!/tag 'scm-set!/immediate
'word-set! 'word-set!/immediate) _
(obj . _))
diff --git a/module/language/cps/effects-analysis.scm b/module/language/cps/effects-analysis.scm
index e180102c3..f2335b462 100644
--- a/module/language/cps/effects-analysis.scm
+++ b/module/language/cps/effects-analysis.scm
@@ -56,8 +56,6 @@
&fluid
&prompt
- &car
- &cdr
&vector
&box
&module
@@ -383,19 +381,6 @@ the LABELS that are clobbered by the effects of LABEL."
(&write-field
(annotation->memory-kind ann) idx)))))
-;; Pairs.
-(define-primitive-effects
- ((cons a b) (&allocate &pair))
- ((list . _) (&allocate &pair))
- ((car x) (&read-field &pair 0) &type-check)
- ((set-car! x y) (&write-field &pair 0) &type-check)
- ((cdr x) (&read-field &pair 1) &type-check)
- ((set-cdr! x y) (&write-field &pair 1) &type-check)
- ((memq x y) (&read-object &pair) &type-check)
- ((memv x y) (&read-object &pair) &type-check)
- ((list? arg) (&read-field &pair 1))
- ((length l) (&read-field &pair 1) &type-check))
-
;; Variables.
(define-primitive-effects
((box v) (&allocate &box))
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index dfd7b92fb..eab830a8e 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -815,20 +815,6 @@ minimum, and maximum."
;;;
-;;; Pairs.
-;;;
-
-(define-simple-types
- ((cons &all-types &all-types) &pair)
- ((car &pair) &all-types)
- ((set-car! &pair &all-types))
- ((cdr &pair) &all-types)
- ((set-cdr! &pair &all-types)))
-
-
-
-
-;;;
;;; Variables.
;;;