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
2746442b
Commit
2746442b
authored
31 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Added support for describing byte-compiled functions.
parent
79ba59b8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/describe.lisp
+44
-10
44 additions, 10 deletions
code/describe.lisp
with
44 additions
and
10 deletions
code/describe.lisp
+
44
−
10
View file @
2746442b
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/describe.lisp,v 1.2
6
1993/0
7/20 15
:3
6
:3
6
ram Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/describe.lisp,v 1.2
7
1993/0
8/17 22
:3
1
:3
7
ram Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -271,10 +271,10 @@
;;;
;;; Print information from the debug-info about where X was compiled from.
;;;
(
defun
print-compiled-from
(
x
)
(
let
((
info
(
kernel:%code-debug-info
(
kernel:function-code-header
x
)
)))
(
defun
print-compiled-from
(
code-obj
)
(
let
((
info
(
kernel:%code-debug-info
code-obj
)))
(
when
info
(
let
((
sources
(
c::
compiled-
debug-info-source
info
)))
(
let
((
sources
(
c::debug-info-source
info
)))
(
format
t
"~&On ~A it was compiled from:"
(
format-universal-time
nil
(
c::debug-source-compiled
...
...
@@ -313,14 +313,36 @@
(
desc-doc
name
'function
kind
)
(
unless
(
eq
kind
:macro
)
(
describe-function-name
name
(
%function-type
x
))))
(
print-compiled-from
x
))
(
print-compiled-from
(
kernel:function-code-header
x
)))
(
defun
describe-function-byte-compiled
(
x
kind
name
)
(
unless
(
eq
kind
:macro
)
(
etypecase
x
(
c::simple-byte-function
(
format
t
"~&Function may be called with ~R argument~:P."
(
c::simple-byte-function-num-args
x
)))
(
c::hairy-byte-function
(
let
((
min
(
c::hairy-byte-function-min-args
x
))
(
max
(
c::hairy-byte-function-max-args
x
)))
(
format
t
"~&Function may be called with ~R~:[~*~; to ~R~] ~
positional arguments~
~:[~;,~% any number of &rest arguments~]~
~:[~*~;, and these keywords:~% ~S~]."
min
(
/=
min
max
)
max
(
c::hairy-byte-function-rest-arg-p
x
)
(
c::hairy-byte-function-keywords-p
x
)
(
mapcar
#'
first
(
c::hairy-byte-function-keywords
x
)))))))
(
let
((
name
(
or
name
(
c::byte-function-name
x
))))
(
desc-doc
name
'function
kind
)
(
unless
(
eq
kind
:macro
)
(
describe-function-name
name
'function
)))
(
defun
describe-funcallabe-instance
(
fin
)
(
describe-instance
fin
:funcallable-instance
))
(
print-compiled-from
(
c::byte-function-component
x
)))
;;; DESCRIBE-FUNCTION -- Internal
;;;
;;; Describe a function with the specified kind and name. The latter
...
...
@@ -348,7 +370,19 @@
((
#.
vm:function-header-type
#.
vm:closure-function-header-type
)
(
describe-function-compiled
x
kind
name
))
(
#.
vm:funcallable-instance-header-type
(
describe-funcallabe-instance
x
))
(
typecase
x
(
kernel:byte-function
(
describe-function-byte-compiled
x
kind
name
))
(
kernel:byte-closure
(
describe-function-byte-compiled
(
byte-closure-function
x
)
kind
name
)
(
format
t
"~&Its closure environment is:"
)
(
indenting-further
*standard-output*
8
)
(
let
((
data
(
byte-closure-data
x
)))
(
dotimes
(
i
(
length
data
))
(
format
t
"~&~D: ~S"
i
(
svref
data
i
)))))
(
t
(
describe-instance
x
:funcallable-instance
))))
(
t
(
format
t
"~&It is an unknown type of function."
))))
...
...
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