Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Didier Verna
asdf
Commits
5fec7be8
Commit
5fec7be8
authored
10 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
Preliminary allegro implementation of get-optimization-settings.
parent
9d0b9b0d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test-utilities.script
+1
-1
1 addition, 1 deletion
test/test-utilities.script
uiop/lisp-build.lisp
+10
-7
10 additions, 7 deletions
uiop/lisp-build.lisp
with
11 additions
and
8 deletions
test/test-utilities.script
+
1
−
1
View file @
5fec7be8
...
@@ -314,7 +314,7 @@
...
@@ -314,7 +314,7 @@
(assert-equal (multiple-value-list (ensure-gethash 3 h 5)) '(nil t)))
(assert-equal (multiple-value-list (ensure-gethash 3 h 5)) '(nil t)))
(DBG :optimization-settings)
(DBG :optimization-settings)
#-(or
allegro
ecl-bytecmp gcl mkcl)
#-(or ecl-bytecmp gcl mkcl)
(loop :with settings = (get-optimization-settings)
(loop :with settings = (get-optimization-settings)
:for i :from 0 :to 3 :do
:for i :from 0 :to 3 :do
(with-optimization-settings (`((speed ,i) (space ,i) (safety ,i) (debug ,i)))
(with-optimization-settings (`((speed ,i) (space ,i) (safety ,i) (debug ,i)))
...
...
This diff is collapsed.
Click to expand it.
uiop/lisp-build.lisp
+
10
−
7
View file @
5fec7be8
...
@@ -74,15 +74,18 @@ This can help you produce more deterministic output for FASLs."))
...
@@ -74,15 +74,18 @@ This can help you produce more deterministic output for FASLs."))
#+
sbcl
'
(
sb-c::*policy*
)))
#+
sbcl
'
(
sb-c::*policy*
)))
(
defun
get-optimization-settings
()
(
defun
get-optimization-settings
()
"Get current compiler optimization settings, ready to PROCLAIM again"
"Get current compiler optimization settings, ready to PROCLAIM again"
#-
(
or
abcl
clisp
clozure
cmu
ecl
lispworks
mkcl
sbcl
scl
xcl
)
#-
(
or
abcl
allegro
clisp
clozure
cmu
ecl
lispworks
mkcl
sbcl
scl
xcl
)
(
warn
"~S does not support ~S. Please help me fix that."
(
warn
"~S does not support ~S. Please help me fix that."
'get-optimization-settings
(
implementation-type
))
'get-optimization-settings
(
implementation-type
))
#+
clozure
(
ccl:declaration-information
'optimize
nil
)
#+
(
or
abcl
allegro
clisp
clozure
cmu
ecl
lispworks
mkcl
sbcl
scl
xcl
)
#+
(
or
abcl
clisp
cmu
ecl
lispworks
mkcl
sbcl
scl
xcl
)
(
let
((
settings
'
(
speed
space
safety
debug
compilation-speed
#+
(
or
cmu
scl
)
c::brevity
)))
(
let
((
settings
'
(
speed
space
safety
debug
compilation-speed
#+
(
or
cmu
scl
)
c::brevity
)))
#.`
(
loop
:for
x
:in
settings
#.`
(
loop
#+
(
or
allegro
clozure
)
,@'
(
:with
info
=
#+
allegro
(
sys:declaration-information
'optimize
)
#+
clozure
(
ccl:declaration-information
'optimize
nil
))
:for
x
:in
settings
,@
(
or
#+
(
or
abcl
ecl
gcl
mkcl
xcl
)
'
(
:for
v
:in
+optimization-variables+
))
,@
(
or
#+
(
or
abcl
ecl
gcl
mkcl
xcl
)
'
(
:for
v
:in
+optimization-variables+
))
:for
y
=
(
or
#+
clisp
(
gethash
x
system::*optimize*
0
)
:for
y
=
(
or
#+
(
or
allegro
clozure
)
(
second
(
assoc
x
info
))
; normalize order
#+
clisp
(
gethash
x
system::*optimize*
1
)
#+
(
or
abcl
ecl
mkcl
xcl
)
(
symbol-value
v
)
#+
(
or
abcl
ecl
mkcl
xcl
)
(
symbol-value
v
)
#+
(
or
cmu
scl
)
(
slot-value
c::*default-cookie*
#+
(
or
cmu
scl
)
(
slot-value
c::*default-cookie*
(
case
x
(
compilation-speed
'c::cspeed
)
(
case
x
(
compilation-speed
'c::cspeed
)
...
@@ -97,13 +100,13 @@ This can help you produce more deterministic output for FASLs."))
...
@@ -97,13 +100,13 @@ This can help you produce more deterministic output for FASLs."))
(
unless
(
equal
*previous-optimization-settings*
settings
)
(
unless
(
equal
*previous-optimization-settings*
settings
)
(
setf
*previous-optimization-settings*
settings
))))
(
setf
*previous-optimization-settings*
settings
))))
(
defmacro
with-optimization-settings
((
&optional
(
settings
*optimization-settings*
))
&body
body
)
(
defmacro
with-optimization-settings
((
&optional
(
settings
*optimization-settings*
))
&body
body
)
#+
clisp
#+
(
or
allegro
clisp
)
(
let
((
previous-settings
(
gensym
"PREVIOUS-SETTINGS"
)))
(
let
((
previous-settings
(
gensym
"PREVIOUS-SETTINGS"
)))
`
(
let
((
,
previous-settings
(
get-optimization-settings
)))
`
(
let
((
,
previous-settings
(
get-optimization-settings
)))
,@
(
when
settings
`
((
proclaim
`
(
optimize
,@,
settings
))))
,@
(
when
settings
`
((
proclaim
`
(
optimize
,@,
settings
))))
(
unwind-protect
(
progn
,@
body
)
(
unwind-protect
(
progn
,@
body
)
(
proclaim
`
(
optimize
,@,
previous-settings
)))))
(
proclaim
`
(
optimize
,@,
previous-settings
)))))
#-
clisp
#-
(
or
allegro
clisp
)
`
(
let
,
(
loop
:for
v
:in
+optimization-variables+
:collect
`
(
,
v
,
v
))
`
(
let
,
(
loop
:for
v
:in
+optimization-variables+
:collect
`
(
,
v
,
v
))
,@
(
when
settings
`
((
proclaim
`
(
optimize
,@,
settings
))))
,@
(
when
settings
`
((
proclaim
`
(
optimize
,@,
settings
))))
,@
body
)))
,@
body
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment