diff options
| author | Andrea Corallo | 2020-05-18 20:51:46 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-18 21:04:36 +0100 |
| commit | 2aec16ab754aa803efd2e23a54485e34a56bf76c (patch) | |
| tree | 9d7f3fd04eaf52d89aaf9bdc45cc985909acb7e2 | |
| parent | 2ac619458520f1399088740e5e13751d362e55a0 (diff) | |
| download | emacs-2aec16ab754aa803efd2e23a54485e34a56bf76c.tar.gz emacs-2aec16ab754aa803efd2e23a54485e34a56bf76c.zip | |
* Pacify with the byte-compiler
* lisp/emacs-lisp/comp.el (comp-num-cpus): New special variable.
(comp-effective-async-max-jobs): Make use of `comp-num-cpus'.
(comp-call-optim-form-call): Remove unnecessary parameter.
(comp-call-optim-func): Reflect `comp-call-optim-form-call'
parameter removal.
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index f23a0b29afc..f94544877ed 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -1964,7 +1964,7 @@ Backward propagate array placement properties." | |||
| 1964 | ;; the full compilation unit. | 1964 | ;; the full compilation unit. |
| 1965 | ;; For this reason this is triggered only at comp-speed == 3. | 1965 | ;; For this reason this is triggered only at comp-speed == 3. |
| 1966 | 1966 | ||
| 1967 | (defun comp-call-optim-form-call (callee args self) | 1967 | (defun comp-call-optim-form-call (callee args) |
| 1968 | "" | 1968 | "" |
| 1969 | (cl-flet ((fill-args (args total) | 1969 | (cl-flet ((fill-args (args total) |
| 1970 | ;; Fill missing args to reach TOTAL | 1970 | ;; Fill missing args to reach TOTAL |
| @@ -2017,11 +2017,11 @@ Backward propagate array placement properties." | |||
| 2017 | do (pcase insn | 2017 | do (pcase insn |
| 2018 | (`(set ,lval (callref funcall ,f . ,rest)) | 2018 | (`(set ,lval (callref funcall ,f . ,rest)) |
| 2019 | (when-let ((new-form (comp-call-optim-form-call | 2019 | (when-let ((new-form (comp-call-optim-form-call |
| 2020 | (comp-mvar-constant f) rest self))) | 2020 | (comp-mvar-constant f) rest))) |
| 2021 | (setcar insn-cell `(set ,lval ,new-form)))) | 2021 | (setcar insn-cell `(set ,lval ,new-form)))) |
| 2022 | (`(callref funcall ,f . ,rest) | 2022 | (`(callref funcall ,f . ,rest) |
| 2023 | (when-let ((new-form (comp-call-optim-form-call | 2023 | (when-let ((new-form (comp-call-optim-form-call |
| 2024 | (comp-mvar-constant f) rest self))) | 2024 | (comp-mvar-constant f) rest))) |
| 2025 | (setcar insn-cell new-form))))))) | 2025 | (setcar insn-cell new-form))))))) |
| 2026 | 2026 | ||
| 2027 | (defun comp-call-optim (_) | 2027 | (defun comp-call-optim (_) |
| @@ -2296,17 +2296,17 @@ processes from `comp-async-compilations'" | |||
| 2296 | do (remhash file-name comp-async-compilations)) | 2296 | do (remhash file-name comp-async-compilations)) |
| 2297 | (hash-table-count comp-async-compilations)) | 2297 | (hash-table-count comp-async-compilations)) |
| 2298 | 2298 | ||
| 2299 | (let (num-cpus) | 2299 | (defvar comp-num-cpus) |
| 2300 | (defun comp-effective-async-max-jobs () | 2300 | (defun comp-effective-async-max-jobs () |
| 2301 | "Compute the effective number of async jobs." | 2301 | "Compute the effective number of async jobs." |
| 2302 | (if (zerop comp-async-jobs-number) | 2302 | (if (zerop comp-async-jobs-number) |
| 2303 | (or num-cpus | 2303 | (or comp-num-cpus |
| 2304 | (setf num-cpus | 2304 | (setf comp-num-cpus |
| 2305 | ;; Half of the CPUs or at least one. | 2305 | ;; Half of the CPUs or at least one. |
| 2306 | ;; FIXME portable? | 2306 | ;; FIXME portable? |
| 2307 | (max 1 (/ (string-to-number (shell-command-to-string "nproc")) | 2307 | (max 1 (/ (string-to-number (shell-command-to-string "nproc")) |
| 2308 | 2)))) | 2308 | 2)))) |
| 2309 | comp-async-jobs-number))) | 2309 | comp-async-jobs-number)) |
| 2310 | 2310 | ||
| 2311 | (defun comp-run-async-workers () | 2311 | (defun comp-run-async-workers () |
| 2312 | "Start compiling files from `comp-files-queue' asynchronously. | 2312 | "Start compiling files from `comp-files-queue' asynchronously. |