Export the symbols naming locations and c1forms from C-DATA

This commit is contained in:
Juan Jose Garcia Ripoll 2009-12-29 18:06:37 +01:00
parent bf78e2ef29
commit f2c0bae755
4 changed files with 54 additions and 14 deletions

View file

@ -140,7 +140,8 @@
(unless (or *compiler-constants* (not *use-static-constants-p*))
(let ((static-constants 0))
(flet ((turned-static-p (record)
(destructuring-bind (object (&whole location vv-tag index object-copy))
(destructuring-bind (object (&whole location vv-tag index object-copy)
index-copy)
(let ((builder (static-constant-expression object)))
(when builder
(let* ((next-index (incf static-constants))
@ -163,15 +164,18 @@
(defun replace-optimizable-constants ()
(let ((found nil))
(flet ((turned-inline-p (record)
(destructuring-bind (object (&whole location vv-tag index object-copy))
(let ((x (assoc object +optimizable-constants+)))
(when x
(setf found t)
(format *dump-output* "~&;;; Replacing constant ~A with ~A"
object (second x))
(setf (second location) (second x)
(first location) (first x))
t)))))
(print record)
(destructuring-bind (object (&whole location vv-tag index object-copy)
index-copy)
record
(let ((x (assoc object +optimizable-constants+)))
(when x
(setf found t)
(format *dump-output* "~&;;; Replacing constant ~A with ~A"
object (second x))
(setf (second location) (second x)
(first location) (first x))
t)))))
(setf *permanent-objects*
(delete-if #'turned-inline-p *permanent-objects*)
*temporary-objects*

View file

@ -18,5 +18,5 @@
(execute-pass 'pass-consistency)
(execute-pass 'pass-delete-no-side-effects)
(execute-pass 'pass-delete-unused-bindings)
(execute-pass 'pass-decide-var-rep-types)
(execute-pass 'pass-assign-labels))
(execute-pass 'pass-assign-labels)
(execute-pass 'pass-decide-var-rep-types))

View file

@ -35,11 +35,47 @@
"MAKE-C1FORM*"
"LOCATION-TYPE" "LOCATION-PRIMARY-TYPE"
"PPRINT-C1FORM" "PPRINT-C1FORMS"
;;
;; Symbols naming possible locations
;;
"TEMP" "LCL" "VV" "VV-TEMP" "TRASH"
"FIXNUM-VALUE" "CHARACTER-VALUE"
"LONG-FLOAT-VALUE" "DOUBLE-FLOAT-VALUE" "SINGLE-FLOAT-VALUE"
"VALUE" "VALUE0" "VALUES+VALUE0" "RETURN" "ACTUAL-RETURN"
"VA-ARG" "CL-VA-ARG" "KEYVARS"
"CALL" "CALL-NORMAL" "CALL-INDIRECT"
"COERCE-LOC"
"FDEFINITION" "MAKE-CCLOSURE"
"JMP-TRUE" "JMP-FALSE" "JMP-ZERO" "JMP-NONZERO"
;;
;; Symbols naming C1FORMS
;;
"SET-MV" "BIND" "BIND-SPECIAL" "UNBIND" "PROGV-EXIT"
"FRAME-POP" "FRAME-SET" "FRAME-SAVE-NEXT" "FRAME-JMP-NEXT"
"FRAME-ID"
"CALL-LOCAL" "CALL-GLOBAL" "JMP"
"FUNCTION-EPILOGUE" "FUNCTION-PROLOGUE" "BIND-REQUIREDS"
"VARARGS-BIND" "VARARGS-POP" "VARARGS-REST" "VARARGS-UNBIND"
"STACK-FRAME-OPEN" "STACK-FRAME-PUSH" "STACK-FRAME-PUSH-VALUES"
"STACK-FRAME-POP-VALUES" "STACK-FRAME-APPLY" "STACK-FRAME-CLOSE"
"DEBUG-ENV-OPEN" "DEBUG-ENV-CLOSE" "DEBUG-ENV-PUSH-VARS"
"DEBUG-ENV-POP-VARS"
"DO-FLET/LABELS"
)
(:import-from "SI" "*COMPILER-CONSTANTS*"))
(defpackage "C-BACKEND"
(defpackage "C-PASSES"
(:use "FFI" "CL" "C-DATA")
(:export "EXECUTE-PASS"
"PASS-CONSISTENCY"
"PASS-DELETE-NO-SIDE-EFFECTS"
"PASS-ASSIGN-LABELS"
"PASS-DELETE-UNUSED-BINDINGS"))
(defpackage "C-BACKEND"
(:use "FFI" "CL" "C-DATA" "C-PASSES")
(:export "CTOP-WRITE" "DUMP-ALL" "DATA-DUMP"
"WT-FILTERED-DATA"))

View file

@ -59,7 +59,7 @@
;;; VARARGS-UNBIND nargs-loc varargs-loc min max nkeys check
;;;
(in-package "COMPILER")
(in-package "C-PASSES")
(defparameter *dump-output* (open "dump.log" :direction :output
:if-exists :supersede