Log sequence specialization failures in `for' loops.
Using this logging, Optimization Coach can recommend adding `in-list' and co. to `for' loops in hot code.
This commit is contained in:
parent
8638a661cc
commit
ce59724778
|
@ -171,6 +171,9 @@
|
||||||
;; taints down to all the relevant identifiers and expressions:
|
;; taints down to all the relevant identifiers and expressions:
|
||||||
(arm-for-clause clause syntax-arm))
|
(arm-for-clause clause syntax-arm))
|
||||||
|
|
||||||
|
(define sequence-specialization-logger
|
||||||
|
(make-logger 'sequence-specialization (current-logger)))
|
||||||
|
|
||||||
(define (expand-clause orig-stx clause)
|
(define (expand-clause orig-stx clause)
|
||||||
(define (unpack stx)
|
(define (unpack stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
@ -294,7 +297,17 @@
|
||||||
(and post-guard (not (pred id ...)))
|
(and post-guard (not (pred id ...)))
|
||||||
(loop-arg ...)))]
|
(loop-arg ...)))]
|
||||||
[[(id ...) rhs]
|
[[(id ...) rhs]
|
||||||
|
#t
|
||||||
(let ([introducer (make-syntax-introducer)])
|
(let ([introducer (make-syntax-introducer)])
|
||||||
|
;; log non-specialized clauses, for performance tuning
|
||||||
|
(when (log-level? sequence-specialization-logger 'debug)
|
||||||
|
(log-message sequence-specialization-logger
|
||||||
|
'debug
|
||||||
|
(format "non-specialized for clause: ~a:~a:~a"
|
||||||
|
(syntax-source #'rhs)
|
||||||
|
(syntax-line #'rhs)
|
||||||
|
(syntax-column #'rhs))
|
||||||
|
#'rhs))
|
||||||
(with-syntax ([[(id ...) rhs] (introducer (syntax-local-introduce clause))])
|
(with-syntax ([[(id ...) rhs] (introducer (syntax-local-introduce clause))])
|
||||||
(arm-for-clause
|
(arm-for-clause
|
||||||
(syntax-local-introduce
|
(syntax-local-introduce
|
||||||
|
|
Loading…
Reference in New Issue
Block a user