[project @ 1999-03-26 10:29:02 by simonm]
[ghc-hetmet.git] / ghc / compiler / main / Constants.lhs
index c0bf487..5b52a37 100644 (file)
@@ -18,6 +18,9 @@ module Constants (
        mAX_CONTEXT_REDUCTION_DEPTH,
        mAX_TUPLE_SIZE,
 
+       mAX_SPEC_THUNK_SIZE,
+       mAX_SPEC_FUN_SIZE,
+       mAX_SPEC_CONSTR_SIZE,
        mAX_SPEC_SELECTEE_SIZE,
        mAX_SPEC_AP_SIZE,
 
@@ -47,6 +50,7 @@ module Constants (
        uF_CCS,
 
        sEQ_FRAME_SIZE,
+       sCC_SEQ_FRAME_SIZE,
 
        mAX_Vanilla_REG,
        mAX_Float_REG,
@@ -107,6 +111,11 @@ uNFOLDING_KEENESS_FACTOR      = ( 2.0 :: Float)
 
 \begin{code}
 
+-- specialised fun/thunk/constr closure types
+mAX_SPEC_THUNK_SIZE   = (MAX_SPEC_THUNK_SIZE :: Int)
+mAX_SPEC_FUN_SIZE     = (MAX_SPEC_FUN_SIZE :: Int)
+mAX_SPEC_CONSTR_SIZE  = (MAX_SPEC_CONSTR_SIZE :: Int)
+
 -- pre-compiled thunk types
 mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
 mAX_SPEC_AP_SIZE        = (MAX_SPEC_AP_SIZE :: Int)
@@ -116,10 +125,20 @@ mIN_UPD_SIZE                      = (MIN_UPD_SIZE::Int)
 mIN_SIZE_NonUpdHeapObject      = (MIN_NONUPD_SIZE::Int)
 \end{code}
 
+If we're compiling with GHC (and we're not cross-compiling), then we
+know that minBound and maxBound :: Int are the right values for the
+target architecture.  Otherwise, we assume -2^31 and 2^31-1
+respectively (which will be wrong on a 64-bit machine).
+
 \begin{code}
 tARGET_MIN_INT, tARGET_MAX_INT :: Integer
-tARGET_MIN_INT = -536870912
-tARGET_MAX_INT =  536870912
+#if __GLASGOW_HASKELL__
+tARGET_MIN_INT = toInteger (minBound :: Int)
+tARGET_MAX_INT = toInteger (maxBound :: Int)
+#else
+tARGET_MIN_INT = -2147483648
+tARGET_MAX_INT =  2147483647
+#endif
 \end{code}
  
 Constants for semi-tagging; the tags associated with the data
@@ -168,8 +187,11 @@ uF_UPDATEE     = (UF_UPDATEE::Int)
 uF_CCS         = (UF_CCS::Int)
 \end{code}
 
+Seq frame sizes.
+
 \begin{code}
-sEQ_FRAME_SIZE = (SEQ_FRAME_SIZE::Int)
+sEQ_FRAME_SIZE = (NOSCC_SEQ_FRAME_SIZE::Int)
+sCC_SEQ_FRAME_SIZE = (SCC_SEQ_FRAME_SIZE::Int)
 \end{code}
 
 \begin{code}
@@ -219,5 +241,6 @@ The version of the interface file format we're
 using:
 
 \begin{code}
+interfaceFileFormatVersion :: Int
 interfaceFileFormatVersion = HscIfaceFileVersion
 \end{code}