diff options
| author | Andrea Corallo | 2023-11-16 10:19:20 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2023-11-16 10:33:13 +0100 |
| commit | 46c2fffd891ae4392f6d5d2ec4a68011c06aa37d (patch) | |
| tree | 44167736db154f46f4b26c07f1e4ef0500dc98fd | |
| parent | 6733f45383bc1f57860d98803391cda076ed7cbb (diff) | |
| download | emacs-46c2fffd891ae4392f6d5d2ec4a68011c06aa37d.tar.gz emacs-46c2fffd891ae4392f6d5d2ec4a68011c06aa37d.zip | |
Clean-up some native-comp advice special handling.
* lisp/emacs-lisp/nadvice.el (advice--add-function): Clean-up
nativecomp special handling.
* lisp/emacs-lisp/advice.el (ad-add-advice): Likewise.
| -rw-r--r-- | lisp/emacs-lisp/advice.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 17 |
2 files changed, 0 insertions, 20 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 2a668f6ce0e..a6974e07cb2 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el | |||
| @@ -2067,9 +2067,6 @@ mapped to the closest extremal position). | |||
| 2067 | If FUNCTION was not advised already, its advice info will be | 2067 | If FUNCTION was not advised already, its advice info will be |
| 2068 | initialized. Redefining a piece of advice whose name is part of | 2068 | initialized. Redefining a piece of advice whose name is part of |
| 2069 | the cache-id will clear the cache." | 2069 | the cache-id will clear the cache." |
| 2070 | (when (and (featurep 'native-compile) | ||
| 2071 | (subr-primitive-p (symbol-function function))) | ||
| 2072 | (comp-subr-trampoline-install function)) | ||
| 2073 | (cond ((not (ad-is-advised function)) | 2070 | (cond ((not (ad-is-advised function)) |
| 2074 | (ad-initialize-advice-info function) | 2071 | (ad-initialize-advice-info function) |
| 2075 | (ad-set-advice-info-field | 2072 | (ad-set-advice-info-field |
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 6c5b11d2bd4..42027c01491 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -391,23 +391,6 @@ is also interactive. There are 3 cases: | |||
| 391 | 391 | ||
| 392 | ;;;###autoload | 392 | ;;;###autoload |
| 393 | (defun advice--add-function (how ref function props) | 393 | (defun advice--add-function (how ref function props) |
| 394 | (when (and (featurep 'native-compile) | ||
| 395 | (subr-primitive-p (gv-deref ref))) | ||
| 396 | (let ((subr-name (intern (subr-name (gv-deref ref))))) | ||
| 397 | ;; Requiring the native compiler to advice `macroexpand' cause a | ||
| 398 | ;; circular dependency in eager macro expansion. uniquify is | ||
| 399 | ;; advising `rename-buffer' while being loaded in loadup.el. | ||
| 400 | ;; This would require the whole native compiler machinery but we | ||
| 401 | ;; don't want to include it in the dump. Because these two | ||
| 402 | ;; functions are already handled in | ||
| 403 | ;; `native-comp-never-optimize-functions' we hack the problem | ||
| 404 | ;; this way for now :/ | ||
| 405 | (unless (memq subr-name '(macroexpand rename-buffer)) | ||
| 406 | ;; Must require explicitly as during bootstrap we have no | ||
| 407 | ;; autoloads. | ||
| 408 | (require 'comp-run) | ||
| 409 | (declare-function comp-subr-trampoline-install "comp-run") | ||
| 410 | (comp-subr-trampoline-install subr-name)))) | ||
| 411 | (let* ((name (cdr (assq 'name props))) | 394 | (let* ((name (cdr (assq 'name props))) |
| 412 | (a (advice--member-p (or name function) (if name t) (gv-deref ref)))) | 395 | (a (advice--member-p (or name function) (if name t) (gv-deref ref)))) |
| 413 | (when a | 396 | (when a |