Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
b5986072
Commit
b5986072
authored
Apr 25, 2007
by
Simon Marlow
Browse files
force APs, AP_STACKs and ThunkSelectors in :force
parent
7ba2a2ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/ghci/RtClosureInspect.hs
View file @
b5986072
...
...
@@ -168,6 +168,7 @@ readCType i
|
i
==
BLACKHOLE
=
Blackhole
|
i
>=
IND
&&
i
<=
IND_STATIC
=
Indirection
(
fromIntegral
i
)
|
fromIntegral
i
==
aP_CODE
=
AP
|
i
==
AP_STACK
=
AP
|
fromIntegral
i
==
pAP_CODE
=
PAP
|
otherwise
=
Other
(
fromIntegral
i
)
...
...
@@ -179,6 +180,11 @@ isIndirection (Indirection _) = True
--isIndirection ThunkSelector = True
isIndirection
_
=
False
isThunk
(
Thunk
_
)
=
True
isThunk
ThunkSelector
=
True
isThunk
AP
=
True
isThunk
_
=
False
isFullyEvaluated
::
a
->
IO
Bool
isFullyEvaluated
a
=
do
closure
<-
getClosureData
a
...
...
@@ -489,7 +495,7 @@ cvObtainTerm1 hsc_env force mb_ty hval = runTR hsc_env $ do
Nothing
->
go
tv
tv
hval
Just
ty
|
isMonomorphic
ty
->
go
ty
ty
hval
Just
ty
->
do
(
ty'
,
rev_subst
)
<-
instScheme
(
sigmaType
$
fromJust
mb_
ty
)
(
ty'
,
rev_subst
)
<-
instScheme
(
sigmaType
ty
)
addConstraint
tv
ty'
term
<-
go
tv
tv
hval
--restore original Tyvars
...
...
@@ -504,7 +510,7 @@ cvObtainTerm1 hsc_env force mb_ty hval = runTR hsc_env $ do
clos
<-
trIO
$
getClosureData
a
case
tipe
clos
of
-- Thunks we may want to force
Thunk
_
|
force
->
seq
a
$
go
tv
ty
a
t
|
is
Thunk
t
&&
force
->
seq
a
$
go
tv
ty
a
-- We always follow indirections
Indirection
_
->
go
tv
ty
$!
(
ptrs
clos
!
0
)
-- The interesting case
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment