Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Carl Shapiro
cmucl
Commits
df6b4f21
Commit
df6b4f21
authored
33 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Initial revision
parent
378fb74e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/ltv.lisp
+60
-0
60 additions, 0 deletions
compiler/ltv.lisp
with
60 additions
and
0 deletions
compiler/ltv.lisp
0 → 100644
+
60
−
0
View file @
df6b4f21
;;; -*- Package: C; Log: C.Log -*-
;;;
;;; **********************************************************************
;;; This code was written as part of the CMU Common Lisp project at
;;; Carnegie Mellon University, and has been placed in the public domain.
;;; If you want to use this code or any part of CMU Common Lisp, please contact
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ltv.lisp,v 1.1 1991/11/25 12:09:36 wlott Exp $"
)
;;;
;;; **********************************************************************
;;;
;;; This file implements LOAD-TIME-VALUE.
;;;
;;; Written by William Lott
;;;
(
in-package
"C"
)
(
in-package
"LISP"
)
(
export
'load-time-value
)
(
in-package
"C"
)
(
defknown
%load-time-value
(
t
)
t
(
flushable
movable
))
(
def-ir1-translator
load-time-value
((
form
&optional
read-only-p
)
start
cont
)
"Arrange for FORM to be evaluated at load-time and use the value produced
as if it were a constant. If READ-ONLY-P is non-NIL, then the resultant
object is guaranteed to never be modified, so it can be put in read-only
storage."
(
if
(
producing-fasl-file
)
(
multiple-value-bind
(
handle
type
)
(
compile-load-time-value
(
if
read-only-p
form
`
(
make-value-cell
,
form
)))
(
declare
(
ignore
type
))
(
ir1-convert
start
cont
(
if
read-only-p
`
(
%load-time-value
',handle
)
`
(
value-cell-ref
(
%load-time-value
',handle
)))))
(
let
((
value
(
handler-case
(
eval
form
)
(
error
(
condition
)
(
compiler-error
"(during EVAL of LOAD-TIME-VALUE)~%~A"
condition
)))))
(
ir1-convert
start
cont
(
if
read-only-p
`
',value
`
(
value-cell-ref
',
(
make-value-cell
value
)))))))
(
defoptimizer
(
%load-time-value
ir2-convert
)
((
handle
)
node
block
)
(
assert
(
constant-continuation-p
handle
))
(
let
((
cont
(
node-cont
node
))
(
tn
(
make-load-time-value-tn
(
continuation-value
handle
)
*universal-type*
)))
(
move-continuation-result
node
block
(
list
tn
)
cont
)))
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