mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
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.
This commit is contained in:
parent
49fa4980bb
commit
abfe04835b
6 changed files with 2 additions and 44 deletions
|
@ -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 ())
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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 . _))
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -812,20 +812,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)))
|
||||
|
||||
|
||||
|
||||
|
||||
;;;
|
||||
|
|
|
@ -200,11 +200,6 @@
|
|||
emit-string->number
|
||||
emit-string->symbol
|
||||
emit-symbol->keyword
|
||||
emit-cons
|
||||
emit-car
|
||||
emit-cdr
|
||||
emit-set-car!
|
||||
emit-set-cdr!
|
||||
emit-add
|
||||
emit-add/immediate
|
||||
emit-sub
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue