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
e940c9ea
Commit
e940c9ea
authored
32 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Generalized the static-mumble-offset routines to also consider nil a
static symbol at offset 0.
parent
f5cef96c
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/generic/utils.lisp
+21
-18
21 additions, 18 deletions
compiler/generic/utils.lisp
with
21 additions
and
18 deletions
compiler/generic/utils.lisp
+
21
−
18
View file @
e940c9ea
...
@@ -7,12 +7,10 @@
...
@@ -7,12 +7,10 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/utils.lisp,v 1.
3
1992/0
3
/1
2 15:2
5:
0
2 wlott Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/utils.lisp,v 1.
4
1992/0
7
/1
3 01:4
5:
1
2 wlott Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/generic/utils.lisp,v 1.3 1992/03/12 15:25:02 wlott Exp $
;;;
;;; Utility functions needed by the back end to generate code.
;;; Utility functions needed by the back end to generate code.
;;;
;;;
;;; Written by William Lott.
;;; Written by William Lott.
...
@@ -38,27 +36,32 @@
...
@@ -38,27 +36,32 @@
;;;; Routines for dealing with static symbols.
;;;; Routines for dealing with static symbols.
(
defun
static-symbol-p
(
symbol
)
(
defun
static-symbol-p
(
symbol
)
(
member
symbol
static-symbols
))
(
or
(
null
symbol
)
(
and
(
member
symbol
static-symbols
)
t
)))
(
defun
static-symbol-offset
(
symbol
)
(
defun
static-symbol-offset
(
symbol
)
"Returns the byte offset of the static symbol Symbol."
"Returns the byte offset of the static symbol Symbol."
(
let
((
posn
(
position
symbol
static-symbols
)))
(
if
symbol
(
unless
posn
(
error
"~S is not a static symbol."
symbol
))
(
let
((
posn
(
position
symbol
static-symbols
)))
(
+
(
*
posn
(
pad-data-block
symbol-size
))
(
unless
posn
(
error
"~S is not a static symbol."
symbol
))
(
pad-data-block
(
1-
symbol-size
))
(
+
(
*
posn
(
pad-data-block
symbol-size
))
other-pointer-type
(
pad-data-block
(
1-
symbol-size
))
(
-
list-pointer-type
))))
other-pointer-type
(
-
list-pointer-type
)))
0
))
(
defun
offset-static-symbol
(
offset
)
(
defun
offset-static-symbol
(
offset
)
"Given a byte offset, Offset, returns the appropriate static symbol."
"Given a byte offset, Offset, returns the appropriate static symbol."
(
multiple-value-bind
(
if
(
zerop
offset
)
(
n
rem
)
nil
(
truncate
(
+
offset
list-pointer-type
(
-
other-pointer-type
)
(
multiple-value-bind
(
-
(
pad-data-block
(
1-
symbol-size
))))
(
n
rem
)
(
pad-data-block
symbol-size
))
(
truncate
(
+
offset
list-pointer-type
(
-
other-pointer-type
)
(
unless
(
and
(
zerop
rem
)
(
<=
0
n
(
1-
(
length
static-symbols
))))
(
-
(
pad-data-block
(
1-
symbol-size
))))
(
error
"Byte offset, ~D, is not correct."
offset
))
(
pad-data-block
symbol-size
))
(
elt
static-symbols
n
)))
(
unless
(
and
(
zerop
rem
)
(
<=
0
n
(
1-
(
length
static-symbols
))))
(
error
"Byte offset, ~D, is not correct."
offset
))
(
elt
static-symbols
n
))))
(
defun
static-function-offset
(
name
)
(
defun
static-function-offset
(
name
)
"Return the (byte) offset from NIL to the start of the fdefn object
"Return the (byte) offset from NIL to the start of the fdefn object
...
...
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