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
44b5f471
Commit
44b5f471
authored
Sep 12, 2012
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass DynFlags down to gcWord
parent
f611396a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
30 additions
and
27 deletions
+30
-27
compiler/cmm/CmmExpr.hs
compiler/cmm/CmmExpr.hs
+4
-3
compiler/cmm/CmmLayoutStack.hs
compiler/cmm/CmmLayoutStack.hs
+2
-2
compiler/cmm/CmmParse.y
compiler/cmm/CmmParse.y
+1
-1
compiler/cmm/CmmType.hs
compiler/cmm/CmmType.hs
+2
-2
compiler/cmm/CmmUtils.hs
compiler/cmm/CmmUtils.hs
+1
-1
compiler/cmm/MkGraph.hs
compiler/cmm/MkGraph.hs
+1
-1
compiler/codeGen/CgForeignCall.hs
compiler/codeGen/CgForeignCall.hs
+1
-1
compiler/codeGen/CgPrimOp.hs
compiler/codeGen/CgPrimOp.hs
+2
-2
compiler/codeGen/CgUtils.hs
compiler/codeGen/CgUtils.hs
+1
-1
compiler/codeGen/ClosureInfo.lhs
compiler/codeGen/ClosureInfo.lhs
+1
-1
compiler/codeGen/StgCmmEnv.hs
compiler/codeGen/StgCmmEnv.hs
+3
-2
compiler/codeGen/StgCmmForeign.hs
compiler/codeGen/StgCmmForeign.hs
+3
-3
compiler/codeGen/StgCmmPrim.hs
compiler/codeGen/StgCmmPrim.hs
+2
-2
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/llvmGen/LlvmCodeGen/Base.hs
+2
-2
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+4
-3
No files found.
compiler/cmm/CmmExpr.hs
View file @
44b5f471
...
...
@@ -133,7 +133,7 @@ cmmLitType dflags (CmmHighStackMark) = bWord dflags
cmmLabelType
::
DynFlags
->
CLabel
->
CmmType
cmmLabelType
dflags
lbl
|
isGcPtrLabel
lbl
=
gcWord
|
isGcPtrLabel
lbl
=
gcWord
dflags
|
otherwise
=
bWord
dflags
cmmExprWidth
::
DynFlags
->
CmmExpr
->
Width
...
...
@@ -415,11 +415,12 @@ node :: GlobalReg
node
=
VanillaReg
1
VGcPtr
globalRegType
::
DynFlags
->
GlobalReg
->
CmmType
globalRegType
_
(
VanillaReg
_
VGcPtr
)
=
gcWord
globalRegType
dflags
(
VanillaReg
_
VGcPtr
)
=
gcWord
dflags
globalRegType
dflags
(
VanillaReg
_
VNonGcPtr
)
=
bWord
dflags
globalRegType
_
(
FloatReg
_
)
=
cmmFloat
W32
globalRegType
_
(
DoubleReg
_
)
=
cmmFloat
W64
globalRegType
_
(
LongReg
_
)
=
cmmBits
W64
globalRegType
_
Hp
=
gcWord
-- The initialiser for all
globalRegType
dflags
Hp
=
gcWord
dflags
-- The initialiser for all
-- dynamically allocated closures
globalRegType
dflags
_
=
bWord
dflags
compiler/cmm/CmmLayoutStack.hs
View file @
44b5f471
...
...
@@ -916,8 +916,8 @@ lowerSafeForeignCall dflags block
id
<-
newTemp
(
bWord
dflags
)
new_base
<-
newTemp
(
cmmRegType
dflags
(
CmmGlobal
BaseReg
))
let
(
caller_save
,
caller_load
)
=
callerSaveVolatileRegs
dflags
load_tso
<-
newTemp
gcWord
load_stack
<-
newTemp
gcWord
load_tso
<-
newTemp
(
gcWord
dflags
)
load_stack
<-
newTemp
(
gcWord
dflags
)
let
suspend
=
saveThreadState
dflags
<*>
caller_save
<*>
mkMiddle
(
callSuspendThread
id
intrbl
)
...
...
compiler/cmm/CmmParse.y
View file @
44b5f471
...
...
@@ -611,7 +611,7 @@ typenot8 :: { CmmType }
| 'bits64' { b64 }
| 'float32' { f32 }
| 'float64' { f64 }
| 'gcptr' {
gcWord
}
| 'gcptr' {
% do dflags <- getDynFlags; return $ gcWord dflags
}
{
section :: String -> Section
section "text" = Text
...
...
compiler/cmm/CmmType.hs
View file @
44b5f471
...
...
@@ -102,8 +102,8 @@ bWord _ = cmmBits wordWidth
bHalfWord
::
DynFlags
->
CmmType
bHalfWord
dflags
=
cmmBits
(
halfWordWidth
dflags
)
gcWord
::
CmmType
gcWord
=
CmmType
GcPtrCat
wordWidth
gcWord
::
DynFlags
->
CmmType
gcWord
_
=
CmmType
GcPtrCat
wordWidth
cInt
,
cLong
::
CmmType
cInt
=
cmmBits
cIntWidth
...
...
compiler/cmm/CmmUtils.hs
View file @
44b5f471
...
...
@@ -89,7 +89,7 @@ import Hoopl
primRepCmmType
::
DynFlags
->
PrimRep
->
CmmType
primRepCmmType
_
VoidRep
=
panic
"primRepCmmType:VoidRep"
primRepCmmType
_
PtrRep
=
gcWord
primRepCmmType
dflags
PtrRep
=
gcWord
dflags
primRepCmmType
dflags
IntRep
=
bWord
dflags
primRepCmmType
dflags
WordRep
=
bWord
dflags
primRepCmmType
_
Int64Rep
=
b64
...
...
compiler/cmm/MkGraph.hs
View file @
44b5f471
...
...
@@ -231,7 +231,7 @@ mkReturn dflags e actuals updfr_off =
mkReturnSimple
::
DynFlags
->
[
CmmActual
]
->
UpdFrameOffset
->
CmmAGraph
mkReturnSimple
dflags
actuals
updfr_off
=
mkReturn
dflags
e
actuals
updfr_off
where
e
=
CmmLoad
(
CmmStackSlot
Old
updfr_off
)
gcWord
where
e
=
CmmLoad
(
CmmStackSlot
Old
updfr_off
)
(
gcWord
dflags
)
mkBranch
::
BlockId
->
CmmAGraph
mkBranch
bid
=
mkLast
(
CmmBranch
bid
)
...
...
compiler/codeGen/CgForeignCall.hs
View file @
44b5f471
...
...
@@ -256,7 +256,7 @@ emitOpenNursery =
do
dflags
<-
getDynFlags
stmtsC
[
-- Hp = CurrentNursery->free - 1;
CmmAssign
hp
(
cmmOffsetW
dflags
(
CmmLoad
(
nursery_bdescr_free
dflags
)
gcWord
)
(
-
1
)),
CmmAssign
hp
(
cmmOffsetW
dflags
(
CmmLoad
(
nursery_bdescr_free
dflags
)
(
gcWord
dflags
)
)
(
-
1
)),
-- HpLim = CurrentNursery->start +
-- CurrentNursery->blocks*BLOCK_SIZE_W - 1;
...
...
compiler/codeGen/CgPrimOp.hs
View file @
44b5f471
...
...
@@ -167,7 +167,7 @@ emitPrimOp _ [res] GetCurrentCCSOp [_dummy_arg] _live
=
stmtC
(
CmmAssign
(
CmmLocal
res
)
curCCS
)
emitPrimOp
dflags
[
res
]
ReadMutVarOp
[
mutv
]
_
=
stmtC
(
CmmAssign
(
CmmLocal
res
)
(
cmmLoadIndexW
dflags
mutv
(
fixedHdrSize
dflags
)
gcWord
))
=
stmtC
(
CmmAssign
(
CmmLocal
res
)
(
cmmLoadIndexW
dflags
mutv
(
fixedHdrSize
dflags
)
(
gcWord
dflags
)
))
emitPrimOp
dflags
[]
WriteMutVarOp
[
mutv
,
var
]
live
=
do
stmtC
(
CmmStore
(
cmmOffsetW
dflags
mutv
(
fixedHdrSize
dflags
))
var
)
...
...
@@ -818,7 +818,7 @@ doIndexByteArrayOp _ _ _ _
doReadPtrArrayOp
::
LocalReg
->
CmmExpr
->
CmmExpr
->
Code
doReadPtrArrayOp
res
addr
idx
=
do
dflags
<-
getDynFlags
mkBasicIndexedRead
(
arrPtrsHdrSize
dflags
)
Nothing
gcWord
res
addr
idx
mkBasicIndexedRead
(
arrPtrsHdrSize
dflags
)
Nothing
(
gcWord
dflags
)
res
addr
idx
doWriteOffAddrOp
,
doWriteByteArrayOp
...
...
compiler/codeGen/CgUtils.hs
View file @
44b5f471
...
...
@@ -184,7 +184,7 @@ addToMemE width ptr n
tagToClosure
::
DynFlags
->
TyCon
->
CmmExpr
->
CmmExpr
tagToClosure
dflags
tycon
tag
=
CmmLoad
(
cmmOffsetExprW
dflags
closure_tbl
tag
)
gcWord
=
CmmLoad
(
cmmOffsetExprW
dflags
closure_tbl
tag
)
(
gcWord
dflags
)
where
closure_tbl
=
CmmLit
(
CmmLabel
lbl
)
lbl
=
mkClosureTableLabel
(
tyConName
tycon
)
NoCafRefs
...
...
compiler/codeGen/ClosureInfo.lhs
View file @
44b5f471
...
...
@@ -266,7 +266,7 @@ instance Outputable CgRep where
ppr DoubleArg = ptext (sLit "D_")
argMachRep :: DynFlags -> CgRep -> CmmType
argMachRep
_ PtrArg = gcWord
argMachRep
dflags PtrArg = gcWord dflags
argMachRep dflags NonPtrArg = bWord dflags
argMachRep _ LongArg = b64
argMachRep _ FloatArg = f32
...
...
compiler/codeGen/StgCmmEnv.hs
View file @
44b5f471
...
...
@@ -102,8 +102,9 @@ lneIdInfo dflags id regs
rhsIdInfo
::
Id
->
LambdaFormInfo
->
FCode
(
CgIdInfo
,
LocalReg
)
rhsIdInfo
id
lf_info
=
do
{
reg
<-
newTemp
gcWord
;
return
(
mkCgIdInfo
id
lf_info
(
CmmReg
(
CmmLocal
reg
)),
reg
)
}
=
do
dflags
<-
getDynFlags
reg
<-
newTemp
(
gcWord
dflags
)
return
(
mkCgIdInfo
id
lf_info
(
CmmReg
(
CmmLocal
reg
)),
reg
)
mkRhsInit
::
DynFlags
->
LocalReg
->
LambdaFormInfo
->
CmmExpr
->
CmmAGraph
mkRhsInit
dflags
reg
lf_info
expr
...
...
compiler/codeGen/StgCmmForeign.hs
View file @
44b5f471
...
...
@@ -292,7 +292,7 @@ emitSaveThreadState bid = do
-- CurrentTSO->stackobj->sp = Sp;
emitStore
(
cmmOffset
dflags
(
CmmLoad
(
cmmOffset
dflags
stgCurrentTSO
(
tso_stackobj
dflags
))
(
bWord
dflags
))
(
stack_SP
dflags
))
(
CmmStackSlot
(
Young
bid
)
(
widthInBytes
(
typeWidth
gcWord
)))
(
CmmStackSlot
(
Young
bid
)
(
widthInBytes
(
typeWidth
(
gcWord
dflags
)
)))
emit
$
closeNursery
dflags
-- and save the current cost centre stack in the TSO when profiling:
when
(
dopt
Opt_SccProfilingOn
dflags
)
$
...
...
@@ -304,8 +304,8 @@ closeNursery dflags = mkStore (nursery_bdescr_free dflags) (cmmOffsetW dflags st
loadThreadState
::
DynFlags
->
LocalReg
->
LocalReg
->
CmmAGraph
loadThreadState
dflags
tso
stack
=
do
-- tso <- newTemp
gcWord
-- TODO FIXME NOW
-- stack <- newTemp
gcWord
-- TODO FIXME NOW
-- tso <- newTemp
(gcWord dflags)
-- TODO FIXME NOW
-- stack <- newTemp
(gcWord dflags)
-- TODO FIXME NOW
catAGraphs
[
-- tso = CurrentTSO;
mkAssign
(
CmmLocal
tso
)
stgCurrentTSO
,
...
...
compiler/codeGen/StgCmmPrim.hs
View file @
44b5f471
...
...
@@ -248,7 +248,7 @@ emitPrimOp _ [res] GetCurrentCCSOp [_dummy_arg]
=
emitAssign
(
CmmLocal
res
)
curCCS
emitPrimOp
dflags
[
res
]
ReadMutVarOp
[
mutv
]
=
emitAssign
(
CmmLocal
res
)
(
cmmLoadIndexW
dflags
mutv
(
fixedHdrSize
dflags
)
gcWord
)
=
emitAssign
(
CmmLocal
res
)
(
cmmLoadIndexW
dflags
mutv
(
fixedHdrSize
dflags
)
(
gcWord
dflags
)
)
emitPrimOp
dflags
[]
WriteMutVarOp
[
mutv
,
var
]
=
do
emitStore
(
cmmOffsetW
dflags
mutv
(
fixedHdrSize
dflags
))
var
...
...
@@ -886,7 +886,7 @@ doIndexByteArrayOp _ _ _ _
doReadPtrArrayOp
::
LocalReg
->
CmmExpr
->
CmmExpr
->
FCode
()
doReadPtrArrayOp
res
addr
idx
=
do
dflags
<-
getDynFlags
mkBasicIndexedRead
(
arrPtrsHdrSize
dflags
)
Nothing
gcWord
res
addr
idx
mkBasicIndexedRead
(
arrPtrsHdrSize
dflags
)
Nothing
(
gcWord
dflags
)
res
addr
idx
doWriteOffAddrOp
::
Maybe
MachOp
->
[
LocalReg
]
->
[
CmmExpr
]
->
FCode
()
...
...
compiler/llvmGen/LlvmCodeGen/Base.hs
View file @
44b5f471
...
...
@@ -137,8 +137,8 @@ tysToParams :: [LlvmType] -> [LlvmParameter]
tysToParams
=
map
(
\
ty
->
(
ty
,
[]
))
-- | Pointer width
llvmPtrBits
::
Int
llvmPtrBits
=
widthInBits
$
typeWidth
gcWord
llvmPtrBits
::
DynFlags
->
Int
llvmPtrBits
dflags
=
widthInBits
$
typeWidth
$
gcWord
dflags
-- ----------------------------------------------------------------------------
-- * Llvm Version
...
...
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
View file @
44b5f471
...
...
@@ -652,9 +652,10 @@ genStore_slow env addr val meta = do
other
->
pprPanic
"genStore: ptr not right type!"
(
PprCmm
.
pprExpr
addr
<+>
text
(
"Size of Ptr: "
++
show
llvmPtrBits
++
"Size of Ptr: "
++
show
(
llvmPtrBits
dflags
)
++
", Size of var: "
++
show
(
llvmWidthInBits
other
)
++
", Var: "
++
show
vaddr
))
where
dflags
=
getDflags
env
-- | Unconditional branch
...
...
@@ -1130,10 +1131,10 @@ genLoad_slow env e ty meta = do
other
->
pprPanic
"exprToVar: CmmLoad expression is not right type!"
(
PprCmm
.
pprExpr
e
<+>
text
(
"Size of Ptr: "
++
show
llvmPtrBits
++
"Size of Ptr: "
++
show
(
llvmPtrBits
dflags
)
++
", Size of var: "
++
show
(
llvmWidthInBits
other
)
++
", Var: "
++
show
iptr
))
where
dflags
=
getDflags
env
-- | Handle CmmReg expression
--
...
...
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