summaryrefslogtreecommitdiff
path: root/make-host-2.lisp
diff options
context:
space:
mode:
authorDouglas Katzman <dougk@google.com>2023-04-17 16:43:35 -0400
committerDouglas Katzman <dougk@google.com>2023-04-17 16:54:48 -0400
commite483e8c6ce700c5588651472831296c61dfa821e (patch)
treeb3c7f18cc071c5d481723d48955889eef9ae36b0 /make-host-2.lisp
parentcdfba90e68d2f0226a3017fa04d8e875093104f2 (diff)
Try (and fail) to reimplement "missed compiler macro" warning
There were/are limitations with the mechanism, e.g. compiling "file_a" which could have benefited from a compiler-macro in "file_b", then quitting and retarting lisp before compiling "file_b" should somehow warn. This is particularly a problem for sandboxed builds where each build executor compiles 1 file. To do it, info about missed optimizations has to be part of the fasl. I was able to get either the existing regression tests to pass, or the warnings from genesis to be right, but not both. I left it where the tests pass, but I gave up for the moment on doing it right. If nothing else, this rectifies the poor decision of using globaldb for the compiler's dynamic data. It meant that COMPILE on the simplest of functions could touch a ton of GC cards for no particularly good reason, as each mentioned symbol might accrete a new PACKED-INFO instance.
Diffstat (limited to 'make-host-2.lisp')
-rw-r--r--make-host-2.lisp41
1 files changed, 0 insertions, 41 deletions
diff --git a/make-host-2.lisp b/make-host-2.lisp
index d00d5fc74..d3a1c1858 100644
--- a/make-host-2.lisp
+++ b/make-host-2.lisp
@@ -75,47 +75,6 @@
(find-symbol (string name) "COMMON-LISP")
name))))
-(when sb-c::*track-full-called-fnames*
- (let (possibly-suspicious likely-suspicious)
- (sb-int:call-with-each-globaldb-name
- (lambda (name)
- (let* ((cell (sb-int:info :function :emitted-full-calls name))
- (inlinep (eq (sb-int:info :function :inlinep name) 'inline))
- (source-xform (sb-int:info :function :source-transform name))
- (info (sb-int:info :function :info name)))
- (if (and cell
- (or inlinep
- source-xform
- (and info (sb-c::fun-info-templates info))
- (sb-int:info :function :compiler-macro-function name)))
- (cond (inlinep
- ;; A full call to an inline function almost always indicates
- ;; an out-of-order definition. If not an inline function,
- ;; the call could be due to an inapplicable transformation.
- (push (cons name cell) likely-suspicious))
- ;; structure constructors aren't inlined by default,
- ;; though we have a source-xform.
- ((and (listp source-xform) (eq :constructor (cdr source-xform))))
- (t
- (push (cons name cell) possibly-suspicious)))))))
- (flet ((show (label list)
- (when list
- (format t "~%~A suspicious calls:~:{~%~4d ~S~@{~% ~S~}~}~%"
- label
- (mapcar (lambda (x) (list* (ash (cadr x) -2) (car x) (cddr x)))
- (sort list #'> :key #'cadr))))))
- ;; Called inlines not in the presence of a declaration to the contrary
- ;; indicate that perhaps the function definition appeared too late.
- (show "Likely" likely-suspicious)
- ;; Failed transforms are considered not quite as suspicious
- ;; because it could either be too late, or that the transform failed.
- (show "Possibly" possibly-suspicious))
- ;; As each platform's build becomes warning-free,
- ;; it should be added to the list here to prevent regresssions.
- (when (and likely-suspicious
- (target-featurep '(:and (:or :x86 :x86-64) (:or :linux :darwin))))
- (warn "Expected zero inlinining failures"))))
-
;; After cross-compiling, show me a list of types that checkgen
;; would have liked to use primitive traps for but couldn't.
#+nil