Commit 7dc69ba8 authored by Karsten Poeck's avatar Karsten Poeck
Browse files

Update clasp definition for optimisation settings

parent bdda53d7
......@@ -66,7 +66,7 @@ This can help you produce more deterministic output for FASLs."))
#+clozure '(ccl::*nx-speed* ccl::*nx-space* ccl::*nx-safety*
ccl::*nx-debug* ccl::*nx-cspeed*)
#+(or cmucl scl) '(c::*default-cookie*)
#+clasp '()
#+clasp nil
#+ecl (unless (use-ecl-byte-compiler-p) '(c::*speed* c::*space* c::*safety* c::*debug*))
#+gcl '(compiler::*speed* compiler::*space* compiler::*compiler-new-safety* compiler::*debug*)
#+lispworks '(compiler::*optimization-level*)
......@@ -77,7 +77,8 @@ This can help you produce more deterministic output for FASLs."))
#-(or abcl allegro clasp clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl)
(warn "~S does not support ~S. Please help me fix that."
'get-optimization-settings (implementation-type))
#+(or abcl allegro clasp clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl)
#+clasp (cleavir-env:optimize (cleavir-env:optimize-info CLASP-CLEAVIR:*CLASP-ENV*))
#+(or abcl allegro clisp clozure cmucl ecl lispworks mkcl sbcl scl xcl)
(let ((settings '(speed space safety debug compilation-speed #+(or cmucl scl) c::brevity)))
#.`(loop #+(or allegro clozure)
,@'(:with info = #+allegro (sys:declaration-information 'optimize)
......@@ -86,7 +87,7 @@ This can help you produce more deterministic output for FASLs."))
,@(or #+(or abcl clasp ecl gcl mkcl xcl) '(:for v :in +optimization-variables+))
:for y = (or #+(or allegro clozure) (second (assoc x info)) ; normalize order
#+clisp (gethash x system::*optimize* 1)
#+(or abcl clasp ecl mkcl xcl) (symbol-value v)
#+(or abcl ecl mkcl xcl) (symbol-value v)
#+(or cmucl scl) (slot-value c::*default-cookie*
(case x (compilation-speed 'c::cspeed)
(otherwise x)))
......@@ -100,13 +101,15 @@ This can help you produce more deterministic output for FASLs."))
(unless (equal *previous-optimization-settings* settings)
(setf *previous-optimization-settings* settings))))
(defmacro with-optimization-settings ((&optional (settings *optimization-settings*)) &body body)
#+(or allegro clisp)
(let ((previous-settings (gensym "PREVIOUS-SETTINGS")))
`(let ((,previous-settings (get-optimization-settings)))
#+(or allegro clasp clisp)
(let ((previous-settings (gensym "PREVIOUS-SETTINGS"))
(reset-settings (gensym "RESET-SETTINGS")))
`(let* ((,previous-settings (get-optimization-settings))
(,reset-settings #+clasp (reverse ,previous-settings) #-clasp ,previous-settings))
,@(when settings `((proclaim `(optimize ,@,settings))))
(unwind-protect (progn ,@body)
(proclaim `(optimize ,@,previous-settings)))))
#-(or allegro clisp)
(proclaim `(optimize ,@,reset-settings)))))
#-(or allegro clasp clisp)
`(let ,(loop :for v :in +optimization-variables+ :collect `(,v ,v))
,@(when settings `((proclaim `(optimize ,@,settings))))
,@body)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment