[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 3db6ace 05/14: * Define `comp-symbol-func-to-fun'
From: |
Andrea Corallo |
Subject: |
feature/native-comp 3db6ace 05/14: * Define `comp-symbol-func-to-fun' |
Date: |
Thu, 9 Jul 2020 11:57:52 -0400 (EDT) |
branch: feature/native-comp
commit 3db6ace804472ccde368e173df21484f19049317
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* Define `comp-symbol-func-to-fun'
* lisp/emacs-lisp/comp.el (comp-symbol-func-to-fun): New function.
(comp-func-in-unit): Make use of the `comp-symbol-func-to-fun'.
---
lisp/emacs-lisp/comp.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index ef9dc5b..22575e4 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -443,13 +443,16 @@ structure.")
finally return t)
t))
+(defsubst comp-symbol-func-to-fun (symbol-funcion)
+ "Given a function called SYMBOL-FUNCION return its `comp-func'."
+ (gethash (gethash symbol-funcion (comp-ctxt-sym-to-c-name-h
+ comp-ctxt))
+ (comp-ctxt-funcs-h comp-ctxt)))
+
(defsubst comp-function-pure-p (f)
"Return t if F is pure."
(or (get f 'pure)
- (when-let ((func (gethash (gethash f
- (comp-ctxt-sym-to-c-name-h
- comp-ctxt))
- (comp-ctxt-funcs-h comp-ctxt))))
+ (when-let ((func (comp-symbol-func-to-fun f)))
(comp-func-pure func))))
(defsubst comp-alloc-class-to-container (alloc-class)
@@ -2110,9 +2113,7 @@ Backward propagate array placement properties."
"Given FUNC return the `comp-fun' definition in the current context.
FUNCTION can be a function-name or byte compiled function."
(if (symbolp func)
- (gethash (gethash func
- (comp-ctxt-sym-to-c-name-h comp-ctxt))
- (comp-ctxt-funcs-h comp-ctxt))
+ (comp-symbol-func-to-fun func)
(cl-assert (byte-code-function-p func))
(gethash func (comp-ctxt-byte-func-to-func-h comp-ctxt))))
- feature/native-comp updated (2593bbe -> 5f13016), Andrea Corallo, 2020/07/09
- feature/native-comp 0b81044 02/14: * Clean-up some const folding logic and add `comp-function-pure-p', Andrea Corallo, 2020/07/09
- feature/native-comp b31b0eb 03/14: * Rework some test logic for generality, Andrea Corallo, 2020/07/09
- feature/native-comp 3d43d45 01/14: Merge remote-tracking branch 'savannah/master' into HEAD, Andrea Corallo, 2020/07/09
- feature/native-comp 4348969 06/14: * test/src/comp-test-funcs.el (comp-tests-aref-aset-f) : Fix UB., Andrea Corallo, 2020/07/09
- feature/native-comp 5688739 07/14: * Add `comp-call-op-p', Andrea Corallo, 2020/07/09
- feature/native-comp 9aaca82 12/14: * Add `comp-disabled-passes', Andrea Corallo, 2020/07/09
- feature/native-comp e6ab4e3 04/14: * Add a test targeting forward propagation, Andrea Corallo, 2020/07/09
- feature/native-comp 3db6ace 05/14: * Define `comp-symbol-func-to-fun',
Andrea Corallo <=
- feature/native-comp 7622740 08/14: * Introduce a new pass ipa-pure, Andrea Corallo, 2020/07/09
- feature/native-comp b4de6ba 09/14: * Optimize pure functions defined by the compilation environment, Andrea Corallo, 2020/07/09
- feature/native-comp 5f13016 14/14: Merge remote-tracking branch 'savannah/master' into wip2, Andrea Corallo, 2020/07/09
- feature/native-comp a53b446 10/14: Add some tests for pure function optimization, Andrea Corallo, 2020/07/09
- feature/native-comp 92e744d 11/14: ; * test/src/comp-test-funcs-dyn.el: Fix comment header., Andrea Corallo, 2020/07/09
- feature/native-comp 02bf2e0 13/14: * Disable ipa-pure in comp-tests-tco, Andrea Corallo, 2020/07/09