X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Finterpreter%2Fstorage.h;h=0cbf7df748991aabe2e18266adaf374abbbd8d44;hb=1eee6c555f0bd0e359e2b4da7cb391a096fb3684;hp=861bb82b6acdbd5720fed2900b2dcdaa2dc957f6;hpb=820f09b2c2550f88aa0192442c1c62bb00d62d38;p=ghc-hetmet.git diff --git a/ghc/interpreter/storage.h b/ghc/interpreter/storage.h index 861bb82..0cbf7df 100644 --- a/ghc/interpreter/storage.h +++ b/ghc/interpreter/storage.h @@ -3,16 +3,20 @@ * Defines storage datatypes: Text, Name, Module, Tycon, Cell, List, Pair, * Triple, ... * - * Hugs 98 is Copyright (c) Mark P Jones, Alastair Reid and the Yale - * Haskell Group 1994-99, and is distributed as Open Source software - * under the Artistic License; see the file "Artistic" that is included - * in the distribution for details. + * The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the + * Yale Haskell Group, and the Oregon Graduate Institute of Science and + * Technology, 1994-1999, All rights reserved. It is distributed as + * free software under the license in the file "License", which is + * included in the distribution. * * $RCSfile: storage.h,v $ - * $Revision: 1.7 $ - * $Date: 1999/06/07 17:22:47 $ + * $Revision: 1.45 $ + * $Date: 2000/04/27 16:35:29 $ * ------------------------------------------------------------------------*/ +#define DEBUG_STORAGE /* a moderate level of sanity checking */ +#define DEBUG_STORAGE_EXTRA /* max paranoia in sanity checks */ + /* -------------------------------------------------------------------------- * Typedefs for main data types: * Many of these type names are used to indicate the intended us of a data @@ -28,7 +32,6 @@ typedef Cell far *Heap; /* storage of heap */ typedef Cell Pair; /* pair cell */ typedef Int StackPtr; /* stack pointer */ typedef Cell Offset; /* offset/generic variable*/ -typedef Int Script; /* script file number */ typedef Int Module; /* module */ typedef Cell Tycon; /* type constructor */ typedef Cell Type; /* type expression */ @@ -46,24 +49,71 @@ typedef Cell Float; /* floating pt literal */ typedef Cell Ext; /* extension label */ #endif +typedef Cell ConId; +typedef Cell VarId; +typedef Cell QualId; +typedef Cell ConVarId; + +/* -------------------------------------------------------------------------- + * Address ranges. + * + * -heapSize .. -1 cells in the heap + * 0 NIL + * + * TAG_NONPTR_MIN(100) .. TAG_NONPTR_MAX(116) non pointer tags + * TAG_PTR_MIN(200) .. TAG_PTR_MAX(298) pointer tags + * TAG_SPEC_MIN(400) .. TAG_SPEC_MAX(431) special tags + * OFF_MIN(1,000) .. OFF_MAX(1,999) offsets + * CHARR_MIN(3,000) .. CHARR_MAX(3,255) chars + * + * SMALL_INT_MIN(100,000) .. SMALL_INT_MAX(499,999) smallish ints + * (300,000 denotes 0) + * + * NAME_BASE_ADDR (1,000,000 .. 1,899,999) names + * TYCON_BASE_ADDR (2,000,000 .. 2,899,999) tycons + * CCLASS_BASE_ADDR (3,000,000 .. 3,899,999) classes + * INST_BASE_ADDR (4,000,000 .. 4,899,999) instances + * MODULE_BASE_ADDR (5,000,000 .. 5,899,999) modules + * INVAR_BASE_ADDR (6,000,000 .. 6,899,999) invented var names + * INDVAR_BASE_ADDR (7,000,000 .. 7,899,999) invented dict var names + * TEXT_BASE_ADDR (8,000,000 .. 8M +TEXT_SIZE-1) text + * ------------------------------------------------------------------------*/ + /* -------------------------------------------------------------------------- * Text storage: * provides storage for the characters making up identifier and symbol * names, string literals, character constants etc... * ------------------------------------------------------------------------*/ -extern String textToStr Args((Text)); -extern Text findText Args((String)); -extern Text inventText Args((Void)); -extern Text inventDictText Args((Void)); -extern Bool inventedText Args((Text)); +extern String textToStr ( Text ); +extern Text findText ( String ); +extern Text inventText ( Void ); +extern Text inventDictText ( Void ); +extern Bool inventedText ( Text ); +extern Text enZcodeThenFindText ( String ); +extern Text unZcodeThenFindText ( String ); /* Variants of textToStr and syntaxOf which work for idents, ops whether * qualified or unqualified. */ -extern String identToStr Args((Cell)); -extern Syntax identSyntax Args((Cell)); -extern Syntax defaultSyntax Args((Text)); +extern String identToStr ( Cell ); +extern Text fixLitText ( Text ); +extern Syntax identSyntax ( Cell ); +extern Syntax defaultSyntax ( Text ); + +#define INVAR_BASE_ADDR 6000000 +#define INVAR_MAX_AVAIL 900000 +#define isInventedVar(c) (INVAR_BASE_ADDR<=(c) \ + && (c)