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
b7594e60
Commit
b7594e60
authored
27 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup the static function call VOP; smaller faster instruction
sequence.
parent
6f0ef1ed
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
compiler/x86/static-fn.lisp
+39
-36
39 additions, 36 deletions
compiler/x86/static-fn.lisp
with
39 additions
and
36 deletions
compiler/x86/static-fn.lisp
+
39
−
36
View file @
b7594e60
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; 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/x86/static-fn.lisp,v 1.
1
1997/
01/18
1
4
:3
1:22 ram
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/static-fn.lisp,v 1.
2
1997/
12/03
1
5
:3
4:10 dtc
Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
;;; Written by William Lott.
;;; Written by William Lott.
;;;
;;;
;;; Debugged by Paul F. Werkowski Spring/Summer 1995.
;;; Debugged by Paul F. Werkowski Spring/Summer 1995.
;;; Enhancements/debugging by Douglas T. Crosher 1996,1997.
;;;
;;;
(
in-package
:x86
)
(
in-package
:x86
)
...
@@ -27,11 +28,10 @@
...
@@ -27,11 +28,10 @@
(
:variant-vars
function
)
(
:variant-vars
function
)
(
:vop-var
vop
)
(
:vop-var
vop
)
(
:node-var
node
)
(
:node-var
node
)
#+
nil
(
:temporary
(
:sc
dword-reg
:offset
eax-offset
:from
(
:eval
0
)
:to
(
:eval
2
))
(
:temporary
(
:sc
dword-reg
:offset
eax-offset
)
eax
)
; used for call
eax
)
(
:temporary
(
:sc
dword-reg
:offset
ebx-offset
:from
(
:eval
1
)
:to
(
:eval
2
))
(
:temporary
(
:sc
dword-reg
:offset
ebx-offset
:from
(
:eval
0
)
:to
(
:eval
2
))
ebx
)
ebx
)
(
:ignore
#+
nil
eax
ebx
)
(
:temporary
(
:sc
dword-reg
:offset
ecx-offset
:from
(
:eval
0
)
:to
(
:eval
2
))
(
:temporary
(
:sc
dword-reg
:offset
ecx-offset
:from
(
:eval
0
)
:to
(
:eval
2
))
ecx
))
ecx
))
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
(
dotimes
(
i
num-temps
)
(
dotimes
(
i
num-temps
)
(
let
((
temp-name
(
intern
(
format
nil
"TEMP-~D"
i
))))
(
let
((
temp-name
(
intern
(
format
nil
"TEMP-~D"
i
))))
(
temp-names
temp-name
)
(
temp-names
temp-name
)
(
temps
`
(
:temporary
(
:sc
d
w
or
d
-reg
(
temps
`
(
:temporary
(
:sc
d
escript
or-reg
:offset
,
(
nth
i
register-arg-offsets
)
:offset
,
(
nth
i
register-arg-offsets
)
:from
,
(
if
(
<
i
num-args
)
:from
,
(
if
(
<
i
num-args
)
`
(
:argument
,
i
)
`
(
:argument
,
i
)
...
@@ -88,43 +88,46 @@
...
@@ -88,43 +88,46 @@
(
:results
,@
(
results
))
(
:results
,@
(
results
))
(
:generator
,
(
+
50
num-args
num-results
)
(
:generator
,
(
+
50
num-args
num-results
)
,@
(
moves
(
temp-names
)
(
arg-names
))
,@
(
moves
(
temp-names
)
(
arg-names
))
;; If speed is more important than size, duplicate the effect of
;; the ENTER with discrete instructions. Takes 9 bytes/6 cycles
;; If speed not more important than size, duplicate the
;; as opposed to 4 bytes/10 cycles.
;; effect of the ENTER with discrete instructions. Takes
(
cond
((
policy
node
(
>
speed
space
))
;; 2+1+3+2=8 bytes as opposed to 4+3=7 bytes.
(
cond
((
policy
node
(
>=
speed
space
))
(
inst
mov
ebx
esp-tn
)
;; Save the old-fp
(
inst
push
ebp-tn
)
(
inst
push
ebp-tn
)
(
inst
mov
ebp-tn
esp-tn
)
;; Ensure that at least three slots are available; one
(
inst
sub
esp-tn
(
fixnum
3
)))
; pw -- was 2
;; above, two more needed.
(
inst
sub
esp-tn
(
fixnum
2
))
(
inst
mov
ebp-tn
ebx
))
(
t
(
t
(
inst
enter
(
fixnum
3
))))
; pw -- was 2
(
inst
enter
(
fixnum
2
))
;; The enter instruction pushes EBP and then copies ESP into
;; The enter instruction pushes EBP and then copies
;; EBP. We want the new EBP to be the original ESP, so we fix it
;; ESP into EBP. We want the new EBP to be the
;; up afterwards.
;; original ESP, so we fix it up afterwards.
(
inst
add
ebp-tn
(
fixnum
1
))
(
inst
add
ebp-tn
(
fixnum
1
))))
(
inst
mov
ecx
(
fixnum
,
num-args
))
;; Static-function-offset gives the offset from the start of
;; jrd fixed it up this way, to deal with the fact that the thing in
;; the nil object to the static function fdefn and has the
;; static-symbols is the fdefn
;; low tag of 1 added. When the nil symbol value with its
;; pfw says this is no longer true
;; low tag of 3 is added the resulting value points to the
(
inst
mov
eax-tn
;; entry point of the fdefn (at +4).
(
make-ea
:dword
(
inst
mov
eax
(
make-ea
:dword
:disp
(
+
nil-value
(
static-function-offset
function
))))
:disp
(
+
nil-value
(
static-function-offset
function
))))
;; Save the return address.
#+
x86-lra
,
(
if
(
zerop
num-args
)
(
storew
(
make-fixup
nil
:code-object
return
)
'
(
inst
xor
ecx
ecx
)
ebp-tn
(
-
(
1+
return-pc-save-offset
)))
`
(
inst
mov
ecx
(
fixnum
,
num-args
)))
;; Push the return address for backward compatability.
#+
x86-lra
(
inst
push
(
make-ea
:dword
:base
ebp-tn
:disp
-8
))
(
note-this-location
vop
:call-site
)
(
note-this-location
vop
:call-site
)
#-
x86-lra
#-
x86-lra
(
inst
call
eax
-tn
)
(
inst
call
eax
)
#+
x86-lra
#+
x86-lra
(
progn
(
progn
(
inst
jmp
eax-tn
)
;; Push the return address.
(
inst
push
(
make-fixup
nil
:code-object
return
))
(
inst
jmp
eax
)
(
align
lowtag-bits
#x90
)
(
align
lowtag-bits
#x90
)
(
inst
lra-header-word
)
(
inst
lra-header-word
)
(
inst
nop
)
(
inst
nop
)
...
...
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