Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
f67a8b85
Commit
f67a8b85
authored
Aug 03, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue by jumping to the top-of-stack after a safe foreign call
parent
22d58229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
compiler/cmm/CmmLayoutStack.hs
compiler/cmm/CmmLayoutStack.hs
+7
-5
No files found.
compiler/cmm/CmmLayoutStack.hs
View file @
f67a8b85
...
...
@@ -897,7 +897,7 @@ live across the call. Our job now is to expand the call so we get
| BaseReg = resumeThread(token)
| LOAD_THREAD_STATE()
| R1 = r -- copyOut
| jump
L1
| jump
Sp[0]
'-----------------------
L1:
r = R1 -- copyIn, inserted by mkSafeCall
...
...
@@ -928,15 +928,17 @@ lowerSafeForeignCall dflags block
mkAssign
(
CmmGlobal
BaseReg
)
(
CmmReg
(
CmmLocal
new_base
))
<*>
caller_load
<*>
loadThreadState
dflags
load_tso
load_stack
-- Note: The successor must be a procpoint, and we have already split,
-- so we use a jump, not a branch.
succLbl
=
CmmLit
(
CmmLabel
(
infoTblLbl
succ
))
(
ret_args
,
regs
,
copyout
)
=
copyOutOflow
NativeReturn
Jump
(
Young
succ
)
(
map
(
CmmReg
.
CmmLocal
)
res
)
updfr
(
0
,
[]
)
jump
=
CmmCall
{
cml_target
=
succLbl
-- NB. after resumeThread returns, the top-of-stack probably contains
-- the stack frame for succ, but it might not: if the current thread
-- received an exception during the call, then the stack might be
-- different. Hence we continue by jumping to the top stack frame,
-- not by jumping to succ.
jump
=
CmmCall
{
cml_target
=
CmmLoad
(
CmmReg
spReg
)
bWord
,
cml_cont
=
Just
succ
,
cml_args_regs
=
regs
,
cml_args
=
widthInBytes
wordWidth
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment