From: stassats <sta...@us...> - 2014-01-29 14:22:20
|
The branch "master" has been updated in SBCL: via 217de4b7f641c43d87380236fcb730a0d2328aac (commit) from 1d730f458618cec59c95d13f2972b5db06e51bbd (commit) - Log ----------------------------------------------------------------- commit 217de4b7f641c43d87380236fcb730a0d2328aac Author: Stas Boukarev <sta...@gm...> Date: Wed Jan 29 18:21:53 2014 +0400 Optimize functions calling wrapper-of. SB-PCL::WRAPPER-OF is just a synonym for LAYOUT-OF and it's declared inline, but it's used before it's defined, which prevents inlining. Move it before the first use. That makes some operations a bit faster. --- src/pcl/braid.lisp | 4 ---- src/pcl/low.lisp | 8 -------- src/pcl/wrapper.lisp | 4 ++++ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pcl/braid.lisp b/src/pcl/braid.lisp index 8f1ef7b..8535ade 100644 --- a/src/pcl/braid.lisp +++ b/src/pcl/braid.lisp @@ -544,10 +544,6 @@ (cons name cpl) wrapper prototype)))))) -#-sb-fluid (declaim (inline wrapper-of)) -(defun wrapper-of (x) - (layout-of x)) - (defun class-of (x) (wrapper-class* (wrapper-of x))) diff --git a/src/pcl/low.lisp b/src/pcl/low.lisp index 0d06027..9bae4a7 100644 --- a/src/pcl/low.lisp +++ b/src/pcl/low.lisp @@ -298,14 +298,6 @@ comparison.") `(progn (aver (typep ,wrapper 'wrapper)) ,wrapper))) - -;;; FIXME: could be an inline function or ordinary function (like many -;;; other things around here) -(defmacro get-instance-wrapper-or-nil (inst) - (once-only ((wrapper `(wrapper-of ,inst))) - `(if (typep ,wrapper 'wrapper) - ,wrapper - nil))) ;;;; support for useful hashing of PCL instances diff --git a/src/pcl/wrapper.lisp b/src/pcl/wrapper.lisp index 9cd4e01..b34fbf6 100644 --- a/src/pcl/wrapper.lisp +++ b/src/pcl/wrapper.lisp @@ -121,6 +121,10 @@ (defun invalid-wrapper-p (wrapper) (not (null (layout-invalid wrapper)))) +(declaim (inline wrapper-of)) +(defun wrapper-of (x) + (layout-of x)) + ;;; We only use this inside INVALIDATE-WRAPPER. (defvar *previous-nwrappers* (make-hash-table)) ----------------------------------------------------------------------- hooks/post-receive -- SBCL |