Skip to content
Snippets Groups Projects
Commit 9ac31f7c authored by Julian Seward's avatar Julian Seward
Browse files

[project @ 2000-01-24 18:22:07 by sewardj]

ARR_HDR_SIZE --> ARR_WORDS_HDR_SIZE, and derived quantities in
Constants.h, Constants.lhs et al are similarly renamed.

new constant ARR_PTRS_HDR_SIZE, with corresponding derivatives.
parent c81c46d2
No related merge requests found
...@@ -10,7 +10,8 @@ Other modules should access this info through ClosureInfo. ...@@ -10,7 +10,8 @@ Other modules should access this info through ClosureInfo.
module SMRep ( module SMRep (
SMRep(..), ClosureType(..), SMRep(..), ClosureType(..),
isConstantRep, isStaticRep, isConstantRep, isStaticRep,
fixedHdrSize, arrHdrSize, fixedItblSize, pprSMRep fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize,
fixedItblSize, pprSMRep
#ifndef OMIT_NATIVE_CODEGEN #ifndef OMIT_NATIVE_CODEGEN
, getSMRepClosureTypeInt , getSMRepClosureTypeInt
...@@ -50,7 +51,8 @@ module SMRep ( ...@@ -50,7 +51,8 @@ module SMRep (
import CmdLineOpts import CmdLineOpts
import AbsCSyn ( Liveness(..) ) import AbsCSyn ( Liveness(..) )
import Constants ( sTD_HDR_SIZE, pROF_HDR_SIZE, import Constants ( sTD_HDR_SIZE, pROF_HDR_SIZE,
gRAN_HDR_SIZE, tICKY_HDR_SIZE, aRR_HDR_SIZE, gRAN_HDR_SIZE, tICKY_HDR_SIZE,
aRR_WORDS_HDR_SIZE, aRR_PTRS_HDR_SIZE,
sTD_ITBL_SIZE, pROF_ITBL_SIZE, sTD_ITBL_SIZE, pROF_ITBL_SIZE,
gRAN_ITBL_SIZE, tICKY_ITBL_SIZE ) gRAN_ITBL_SIZE, tICKY_ITBL_SIZE )
import Outputable import Outputable
...@@ -111,8 +113,11 @@ tickyHdrSize :: Int{-words-} ...@@ -111,8 +113,11 @@ tickyHdrSize :: Int{-words-}
tickyHdrSize | opt_DoTickyProfiling = tICKY_HDR_SIZE tickyHdrSize | opt_DoTickyProfiling = tICKY_HDR_SIZE
| otherwise = 0 | otherwise = 0
arrHdrSize :: Int{-words-} arrWordsHdrSize :: Int{-words-}
arrHdrSize = fixedHdrSize + aRR_HDR_SIZE arrWordsHdrSize = fixedHdrSize + aRR_WORDS_HDR_SIZE
arrPtrsHdrSize :: Int{-words-}
arrPtrsHdrSize = fixedHdrSize + aRR_PTRS_HDR_SIZE
\end{code} \end{code}
Size of an info table. Size of an info table.
......
...@@ -23,7 +23,8 @@ module Constants ( ...@@ -23,7 +23,8 @@ module Constants (
pROF_HDR_SIZE, pROF_HDR_SIZE,
gRAN_HDR_SIZE, gRAN_HDR_SIZE,
tICKY_HDR_SIZE, tICKY_HDR_SIZE,
aRR_HDR_SIZE, aRR_WORDS_HDR_SIZE,
aRR_PTRS_HDR_SIZE,
sTD_ITBL_SIZE, sTD_ITBL_SIZE,
pROF_ITBL_SIZE, pROF_ITBL_SIZE,
...@@ -196,11 +197,12 @@ mAX_Real_Long_REG = (0::Int) ...@@ -196,11 +197,12 @@ mAX_Real_Long_REG = (0::Int)
Closure header sizes. Closure header sizes.
\begin{code} \begin{code}
sTD_HDR_SIZE = (STD_HDR_SIZE :: Int) sTD_HDR_SIZE = (STD_HDR_SIZE :: Int)
pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int) pROF_HDR_SIZE = (PROF_HDR_SIZE :: Int)
gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int) gRAN_HDR_SIZE = (GRAN_HDR_SIZE :: Int)
tICKY_HDR_SIZE = (TICKY_HDR_SIZE :: Int) tICKY_HDR_SIZE = (TICKY_HDR_SIZE :: Int)
aRR_HDR_SIZE = (ARR_HDR_SIZE :: Int) aRR_WORDS_HDR_SIZE = (ARR_WORDS_HDR_SIZE :: Int)
aRR_PTRS_HDR_SIZE = (ARR_PTRS_HDR_SIZE :: Int)
\end{code} \end{code}
Info Table sizes. Info Table sizes.
......
...@@ -10,7 +10,7 @@ module Stix ( ...@@ -10,7 +10,7 @@ module Stix (
stgBaseReg, stgNode, stgSp, stgSu, stgSpLim, stgHp, stgHpLim, stgTagReg, stgBaseReg, stgNode, stgSp, stgSu, stgSpLim, stgHp, stgHpLim, stgTagReg,
getUniqLabelNCG, getUniqLabelNCG,
fixedHS, arrHS fixedHS, arrWordsHS, arrPtrsHS
) where ) where
#include "HsVersions.h" #include "HsVersions.h"
...@@ -24,7 +24,7 @@ import CLabel ( mkAsmTempLabel, CLabel, pprCLabel, pprCLabel_asm ) ...@@ -24,7 +24,7 @@ import CLabel ( mkAsmTempLabel, CLabel, pprCLabel, pprCLabel_asm )
import PrimRep ( PrimRep, showPrimRep ) import PrimRep ( PrimRep, showPrimRep )
import PrimOp ( PrimOp, pprPrimOp ) import PrimOp ( PrimOp, pprPrimOp )
import Unique ( Unique ) import Unique ( Unique )
import SMRep ( fixedHdrSize, arrHdrSize ) import SMRep ( fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize )
import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM ) import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
import Outputable import Outputable
\end{code} \end{code}
...@@ -209,6 +209,7 @@ getUniqLabelNCG ...@@ -209,6 +209,7 @@ getUniqLabelNCG
= getUniqueUs `thenUs` \ u -> = getUniqueUs `thenUs` \ u ->
returnUs (mkAsmTempLabel u) returnUs (mkAsmTempLabel u)
fixedHS = StInt (toInteger fixedHdrSize) fixedHS = StInt (toInteger fixedHdrSize)
arrHS = StInt (toInteger arrHdrSize) arrWordsHS = StInt (toInteger arrWordsHdrSize)
arrPtrsHS = StInt (toInteger arrPtrsHdrSize)
\end{code} \end{code}
...@@ -22,7 +22,7 @@ import CallConv ( cCallConv ) ...@@ -22,7 +22,7 @@ import CallConv ( cCallConv )
import OrdList ( OrdList ) import OrdList ( OrdList )
import PrimOp ( PrimOp(..) ) import PrimOp ( PrimOp(..) )
import PrimRep ( PrimRep(..) ) import PrimRep ( PrimRep(..) )
import SMRep ( arrHdrSize ) import SMRep ( arrWordsHdrSize )
import Stix ( sStLitLbl, StixTree(..), StixTreeList ) import Stix ( sStLitLbl, StixTree(..), StixTreeList )
import UniqSupply ( returnUs, thenUs, UniqSM ) import UniqSupply ( returnUs, thenUs, UniqSM )
\end{code} \end{code}
...@@ -139,7 +139,7 @@ toStruct str (alloc,size,arr) ...@@ -139,7 +139,7 @@ toStruct str (alloc,size,arr)
f1 = StAssign IntRep (mpAlloc str) alloc f1 = StAssign IntRep (mpAlloc str) alloc
f2 = StAssign IntRep (mpSize str) size f2 = StAssign IntRep (mpSize str) size
f3 = StAssign PtrRep (mpData str) f3 = StAssign PtrRep (mpData str)
(StIndex PtrRep arr (StInt (toInteger arrHdrSize))) (StIndex PtrRep arr (StInt (toInteger arrWordsHdrSize)))
in in
(f1, f2, f3) (f1, f2, f3)
......
...@@ -149,7 +149,7 @@ primCode [lhs] ReadArrayOp [obj, ix] ...@@ -149,7 +149,7 @@ primCode [lhs] ReadArrayOp [obj, ix]
lhs' = amodeToStix lhs lhs' = amodeToStix lhs
obj' = amodeToStix obj obj' = amodeToStix obj
ix' = amodeToStix ix ix' = amodeToStix ix
base = StIndex IntRep obj' arrHS base = StIndex IntRep obj' arrPtrsHS
assign = StAssign PtrRep lhs' (StInd PtrRep (StIndex PtrRep base ix')) assign = StAssign PtrRep lhs' (StInd PtrRep (StIndex PtrRep base ix'))
in in
returnUs (\xs -> assign : xs) returnUs (\xs -> assign : xs)
...@@ -159,7 +159,7 @@ primCode [] WriteArrayOp [obj, ix, v] ...@@ -159,7 +159,7 @@ primCode [] WriteArrayOp [obj, ix, v]
obj' = amodeToStix obj obj' = amodeToStix obj
ix' = amodeToStix ix ix' = amodeToStix ix
v' = amodeToStix v v' = amodeToStix v
base = StIndex IntRep obj' arrHS --(StInt (toInteger 3)) base = StIndex IntRep obj' arrPtrsHS
assign = StAssign PtrRep (StInd PtrRep (StIndex PtrRep base ix')) v' assign = StAssign PtrRep (StInd PtrRep (StIndex PtrRep base ix')) v'
in in
returnUs (\xs -> assign : xs) returnUs (\xs -> assign : xs)
...@@ -174,7 +174,7 @@ primCode [lhs] (ReadByteArrayOp pk) [obj, ix] ...@@ -174,7 +174,7 @@ primCode [lhs] (ReadByteArrayOp pk) [obj, ix]
lhs' = amodeToStix lhs lhs' = amodeToStix lhs
obj' = amodeToStix obj obj' = amodeToStix obj
ix' = amodeToStix ix ix' = amodeToStix ix
base = StIndex IntRep obj' arrHS base = StIndex IntRep obj' arrWordsHS
assign = StAssign pk lhs' (StInd pk (StIndex pk base ix')) assign = StAssign pk lhs' (StInd pk (StIndex pk base ix'))
in in
returnUs (\xs -> assign : xs) returnUs (\xs -> assign : xs)
...@@ -203,7 +203,7 @@ primCode [] (WriteByteArrayOp pk) [obj, ix, v] ...@@ -203,7 +203,7 @@ primCode [] (WriteByteArrayOp pk) [obj, ix, v]
obj' = amodeToStix obj obj' = amodeToStix obj
ix' = amodeToStix ix ix' = amodeToStix ix
v' = amodeToStix v v' = amodeToStix v
base = StIndex IntRep obj' arrHS base = StIndex IntRep obj' arrWordsHS
assign = StAssign pk (StInd pk (StIndex pk base ix')) v' assign = StAssign pk (StInd pk (StIndex pk base ix')) v'
in in
returnUs (\xs -> assign : xs) returnUs (\xs -> assign : xs)
...@@ -229,8 +229,8 @@ primCode lhs (CCallOp (Left fn) is_asm may_gc cconv) rhs ...@@ -229,8 +229,8 @@ primCode lhs (CCallOp (Left fn) is_asm may_gc cconv) rhs
let base = amodeToStix' x let base = amodeToStix' x
in in
case getAmodeRep x of case getAmodeRep x of
ArrayRep -> StIndex PtrRep base arrHS ArrayRep -> StIndex PtrRep base arrPtrsHS
ByteArrayRep -> StIndex IntRep base arrHS ByteArrayRep -> StIndex IntRep base arrWordsHS
ForeignObjRep -> StIndex PtrRep base fixedHS ForeignObjRep -> StIndex PtrRep base fixedHS
_ -> base _ -> base
\end{code} \end{code}
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* $Id: Constants.h,v 1.8 2000/01/13 14:34:00 hwloidl Exp $ * $Id: Constants.h,v 1.9 2000/01/24 18:22:08 sewardj Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
#define PAR_HDR_SIZE 0 #define PAR_HDR_SIZE 0
#define TICKY_HDR_SIZE 0 #define TICKY_HDR_SIZE 0
#define ARR_HDR_SIZE 1 #define ARR_WORDS_HDR_SIZE 1
#define ARR_PTRS_HDR_SIZE 2
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Info Table sizes Info Table sizes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment