Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Alexander Kaznacheev
GHC
Commits
e9b0d368
Commit
e9b0d368
authored
11 years ago
by
parcs
Committed by
Simon Marlow
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix up shortcut for slow calls
parent
4d1ea482
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
compiler/cmm/CmmInfo.hs
+4
-4
4 additions, 4 deletions
compiler/cmm/CmmInfo.hs
compiler/codeGen/StgCmmLayout.hs
+7
-7
7 additions, 7 deletions
compiler/codeGen/StgCmmLayout.hs
with
11 additions
and
11 deletions
compiler/cmm/CmmInfo.hs
+
4
−
4
View file @
e9b0d368
...
...
@@ -496,16 +496,16 @@ funInfoTable dflags info_ptr
-- Takes the info pointer of a function, returns the function's arity
funInfoArity
::
DynFlags
->
CmmExpr
->
CmmExpr
funInfoArity
dflags
iptr
=
cmmToWord
dflags
(
cmmLoadIndex
dflags
rep
fun_info
offset
)
=
cmmToWord
dflags
(
cmmLoadIndex
dflags
rep
fun_info
(
offset
`
div
`
rep_bytes
)
)
where
fun_info
=
funInfoTable
dflags
iptr
rep
=
cmmBits
(
widthFromBytes
rep_bytes
)
(
rep_bytes
,
offset
)
|
tablesNextToCode
dflags
=
(
pc_REP_StgFunInfoExtraFwd_arity
pc
,
oFFSET_StgFunInfoExtraFwd_arity
dflags
)
|
otherwise
=
(
pc_REP_StgFunInfoExtraRev_arity
pc
|
tablesNextToCode
dflags
=
(
pc_REP_StgFunInfoExtraRev_arity
pc
,
oFFSET_StgFunInfoExtraRev_arity
dflags
)
|
otherwise
=
(
pc_REP_StgFunInfoExtraFwd_arity
pc
,
oFFSET_StgFunInfoExtraFwd_arity
dflags
)
pc
=
sPlatformConstants
(
settings
dflags
)
...
...
This diff is collapsed.
Click to expand it.
compiler/codeGen/StgCmmLayout.hs
+
7
−
7
View file @
e9b0d368
...
...
@@ -191,23 +191,23 @@ slowCall fun stg_args
let
n_args
=
length
stg_args
if
n_args
>
arity
&&
optLevel
dflags
>=
2
then
do
funv
<-
(
CmmReg
.
CmmLocal
)
`
fmap
`
assignTemp
fun
fun_iptr
<-
(
CmmReg
.
CmmLocal
)
`
fmap
`
assignTemp
(
closureInfoPtr
dflags
(
cmmUntag
dflags
funv
))
fast_code
<-
getCode
$
emitCall
(
NativeNodeCall
,
NativeReturn
)
(
entryCode
dflags
(
closureInfoPtr
dflags
fun
)
)
(
nonVArgs
((
P
,
Just
fun
)
:
argsreps
))
(
entryCode
dflags
fun_iptr
)
(
nonVArgs
((
P
,
Just
fun
v
)
:
argsreps
))
slow_lbl
<-
newLabelC
fast_lbl
<-
newLabelC
is_tagged_lbl
<-
newLabelC
end_lbl
<-
newLabelC
funv
<-
(
CmmReg
.
CmmLocal
)
`
fmap
`
assignTemp
fun
let
correct_arity
=
cmmEqWord
dflags
(
funInfoArity
dflags
funv
)
let
correct_arity
=
cmmEqWord
dflags
(
funInfoArity
dflags
fun_iptr
)
(
mkIntExpr
dflags
n_args
)
pprTrace
"fast call"
(
int
n_args
)
$
return
()
emit
(
mkCbranch
(
cmmIsTagged
dflags
funv
)
is_tagged_lbl
slow_lbl
<*>
mkLabel
is_tagged_lbl
<*>
mkCbranch
correct_arity
fast_lbl
slow_lbl
...
...
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