home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / jikes-1.02 / src / lookup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-05  |  16.5 KB  |  814 lines

  1. // $Id: lookup.h,v 1.10 1999/09/01 14:58:25 shields Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #ifndef lookup_INCLUDED
  11. #define lookup_INCLUDED
  12.  
  13. #include "config.h"
  14. #ifndef __amigaos__
  15. #include <wchar.h>
  16. #endif
  17. #include <string.h>
  18. #include <sys/stat.h>
  19. #include <time.h>
  20. #include "tuple.h"
  21. #include "long.h"
  22. #include "double.h"
  23.  
  24. class Symbol;
  25. class PackageSymbol;
  26. class TypeSymbol;
  27. class MethodSymbol;
  28. class MethodShadowSymbol;
  29. class BlockSymbol;
  30. class VariableSymbol;
  31. class VariableShadowSymbol;
  32. class LabelSymbol;
  33. class LiteralSymbol;
  34. class NameSymbol;
  35.  
  36. class PathSymbol;
  37. class DirectorySymbol;
  38. class FileSymbol;
  39.  
  40. class ShadowSymbol;
  41.  
  42. class LiteralValue;
  43. class IntLiteralValue;
  44. class LongLiteralValue;
  45. class FloatLiteralValue;
  46. class DoubleLiteralValue;
  47. class Utf8LiteralValue;
  48.  
  49. class Utf8LiteralTable;
  50. class NameLookupTable;
  51. class TypeLookupTable;
  52. class LiteralLookupTable;
  53.  
  54. class AstBinaryExpression;
  55. class AstExpression;
  56.  
  57. class Hash
  58. {
  59. public:
  60.     //
  61.     // HASH takes as argument a pointer to a character string
  62.     // and its length which it hashes it into a location in the name
  63.     // hash table.
  64.     //
  65.     inline static unsigned Function(wchar_t *head, int len)
  66.     {
  67.         unsigned long hash_value = head[len >> 1]; // start with center (or unique) letter
  68.         wchar_t *tail = &head[len - 1];
  69.  
  70.         for (int i = 0; i < 5 && head < tail; i++)
  71.         {
  72.             unsigned k = *tail--;
  73.             hash_value += ((k << 7) + *head++);
  74.         }
  75.  
  76.         return hash_value;
  77.     }
  78.  
  79.     //
  80.     // Same as above function for a regular "char" string.
  81.     //
  82.     inline static unsigned Function(char *head, int len)
  83.     {
  84.         unsigned long hash_value = head[len >> 1]; // start with center (or unique) letter
  85.         char *tail = &head[len - 1];
  86.  
  87.         for (int i = 0; i < 5 && head < tail; i++)
  88.         {
  89.             unsigned k = *tail--;
  90.             hash_value += ((k << 7) + *head++);
  91.         }
  92.  
  93.         return hash_value;
  94.     }
  95.  
  96.     inline static unsigned Function(IEEEfloat value)
  97.     {
  98.         return value.Word();
  99.     }
  100.  
  101.     inline static unsigned Function(IEEEdouble value)
  102.     {
  103.         unsigned result = value.HighWord() + value.LowWord();
  104.         return result;
  105.     }
  106. };
  107.  
  108.  
  109. class DirectoryEntry
  110. {
  111. public:
  112.     DirectoryEntry *next;
  113.     int length;
  114.     char *name;
  115.  
  116.     DirectoryEntry() : name(NULL),
  117.                        directory(NULL),
  118.                        next(NULL),
  119.                        length(0),
  120.                        mtime_(0)
  121.     {
  122.         image = this;
  123.     }
  124.  
  125.     virtual ~DirectoryEntry()
  126.     {
  127.         delete [] name;
  128.     }
  129.  
  130.  
  131.     inline void Initialize(DirectorySymbol *directory_, char *name_, int length_)
  132.     {
  133.         directory = directory_;
  134.         length = length_;
  135.         name = new char[length + 1];
  136.         memmove(name, name_, length * sizeof(char));
  137.         name[length] = U_NULL;
  138.  
  139.         return;
  140.     }
  141.  
  142.     inline void Initialize(DirectoryEntry *entry, char *name_, int length_)
  143.     {
  144.         Initialize(entry -> directory, name_, length_);
  145.     }
  146.  
  147.     time_t Mtime();
  148.  
  149.     bool IsDummy() { return this != image; }
  150.  
  151.     //
  152.     // See FoldedDirectoryEntry for an explanation of the use of this function
  153.     //
  154.     virtual DirectoryEntry *Image() { return this; }
  155.  
  156. protected:
  157.     DirectorySymbol *directory;
  158.     DirectoryEntry *image;
  159.     time_t mtime_;
  160. };
  161.  
  162.  
  163. #ifdef WIN32_FILE_SYSTEM
  164. //
  165. // This object is needed only for systems such as Windows NT/95/98 that
  166. // treat filenames in a case-insensitive fashion.
  167. //
  168. class FoldedDirectoryEntry : public DirectoryEntry
  169. {
  170. public:
  171.     FoldedDirectoryEntry(DirectoryEntry *image_) { DirectoryEntry::image = image_; }
  172.     virtual ~FoldedDirectoryEntry() {}
  173.  
  174.     virtual DirectoryEntry *Image() { return image; }
  175. };
  176. #endif
  177.  
  178.  
  179. class SystemTable
  180. {
  181.     enum
  182.     {
  183.         DEFAULT_HASH_SIZE = 13,
  184.         MAX_HASH_SIZE = 1021
  185.     };
  186.  
  187. public:
  188.  
  189.     SystemTable(int = DEFAULT_HASH_SIZE);
  190.     virtual ~SystemTable();
  191.  
  192.     DirectorySymbol *FindDirectorySymbol(dev_t, ino_t);
  193.     void InsertDirectorySymbol(dev_t, ino_t, DirectorySymbol *);
  194.  
  195. private:
  196.     class Element
  197.     {
  198.     public:
  199.         Element(dev_t device_, ino_t inode_, DirectorySymbol *directory_symbol_) : device(device_),
  200.                                                                                    inode(inode_),
  201.                                                                                    directory_symbol(directory_symbol_)
  202.         {}
  203.  
  204.         Element *next;
  205.         dev_t device;
  206.         ino_t inode;
  207.         DirectorySymbol *directory_symbol;
  208.     };
  209.  
  210.     Tuple<Element *> directories;
  211.  
  212.     Element **base;
  213.     int hash_size;
  214.  
  215.     static int primes[];
  216.     int prime_index;
  217.  
  218.     int hash(dev_t device, ino_t inode) { return (device + inode) % hash_size; }
  219.  
  220.     void Rehash();
  221. };
  222.  
  223.  
  224. class DirectoryTable
  225. {
  226. public:
  227.     Tuple<DirectoryEntry *> entry_pool;
  228.  
  229.     DirectoryTable(int estimate = 1024);
  230.     ~DirectoryTable();
  231.  
  232.     DirectoryEntry *FindEntry(char *, int);
  233.     DirectoryEntry *InsertEntry(DirectorySymbol *, char *, int);
  234.  
  235. #ifdef WIN32_FILE_SYSTEM
  236.     //
  237.     // See FoldedDirectoryEntry for an explanation of the use of this function
  238.     //
  239.     DirectoryEntry *FindCaseInsensitiveEntry(char *, int);
  240.     void InsertCaseInsensitiveEntry(DirectoryEntry *);
  241. #endif
  242.  
  243. private:
  244.     enum
  245.     {
  246.         DEFAULT_HASH_SIZE = 1021,
  247.         MAX_HASH_SIZE = 8191
  248.     };
  249.  
  250.     DirectoryEntry **base;
  251.     int hash_size;
  252.  
  253.     static int primes[];
  254.     int prime_index;
  255.  
  256.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  257.  
  258.     void Rehash();
  259. };
  260.  
  261.  
  262. class Symbol
  263. {
  264. public:
  265.     Symbol  *next;
  266.  
  267.     enum SymbolKind
  268.     {
  269.          NONE,
  270.          NAME,
  271.          PACKAGE,
  272.          TYPE, // class or interface
  273.          METHOD,
  274.          BLOCK,
  275.          VARIABLE,
  276.          LABEL,
  277.          LITERAL,
  278.  
  279.          PATH,
  280.          _DIRECTORY,
  281.          _FILE,
  282.  
  283.          _num_kinds
  284.     };
  285.  
  286.     SymbolKind Kind() { return _kind; }
  287.     virtual wchar_t *Name()   { return (wchar_t *) NULL; }
  288.     virtual int NameLength() { return 0; }
  289.     virtual NameSymbol *Identity() { return (NameSymbol *) NULL; }
  290.  
  291.     PackageSymbol        *PackageCast()        { return (PackageSymbol *) (_kind == PACKAGE ? this : NULL); }
  292.     TypeSymbol           *TypeCast()           { return (TypeSymbol *) (_kind == TYPE ? this : NULL); }
  293.     MethodSymbol         *MethodCast()         { return (MethodSymbol *) (_kind == METHOD ? this : NULL); }
  294.     BlockSymbol          *BlockCast()          { return (BlockSymbol *) (_kind == BLOCK ? this : NULL); }
  295.     VariableSymbol       *VariableCast()       { return (VariableSymbol *) (_kind == VARIABLE ? this : NULL); }
  296.     LabelSymbol          *LabelCast()          { return (LabelSymbol *) (_kind == LABEL ? this : NULL); }
  297.     LiteralSymbol        *LiteralCast()        { return (LiteralSymbol *) (_kind == LITERAL ? this : NULL); }
  298.     NameSymbol           *NameCast()           { return (NameSymbol *) (_kind == NAME ? this : NULL); }
  299.  
  300.     PathSymbol           *PathCast()           { return (PathSymbol *) (_kind == PATH ? this : NULL); }
  301.     DirectorySymbol      *DirectoryCast()      { return (DirectorySymbol *) (_kind == _DIRECTORY ? this : NULL); }
  302.     FileSymbol           *FileCast()           { return (FileSymbol *) (_kind == _FILE ? this : NULL); }
  303.  
  304.     virtual ~Symbol() {}
  305.  
  306. protected:
  307.     SymbolKind _kind;
  308. };
  309.  
  310.  
  311. class LiteralValue
  312. {
  313. public:
  314.     LiteralValue *next;
  315.     int index;
  316.  
  317.     virtual ~LiteralValue() {}
  318. };
  319.  
  320.  
  321. class IntLiteralValue : public LiteralValue
  322. {
  323. public:
  324.     int value;
  325.  
  326.     virtual ~IntLiteralValue() {}
  327.  
  328.     void Initialize(int value_, int index_)
  329.     {
  330.         value = value_;
  331.         index = index_;
  332.     }
  333. };
  334.  
  335.  
  336. class LongLiteralValue : public LiteralValue
  337. {
  338. public:
  339.     LongInt value;
  340.  
  341.     virtual ~LongLiteralValue() {}
  342.  
  343.     void Initialize(LongInt value_, int index_)
  344.     {
  345.         value = value_;
  346.         index = index_;
  347.     }
  348. };
  349.  
  350.  
  351. class FloatLiteralValue : public LiteralValue
  352. {
  353. public:
  354.     IEEEfloat value;
  355.  
  356.     virtual ~FloatLiteralValue() {}
  357.  
  358.     void Initialize(IEEEfloat value_, int index_)
  359.     {
  360.         value = value_;
  361.         index = index_;
  362.     }
  363. };
  364.  
  365.  
  366. class DoubleLiteralValue : public LiteralValue
  367. {
  368. public:
  369.     IEEEdouble value;
  370.  
  371.     virtual ~DoubleLiteralValue() {}
  372.  
  373.     void Initialize(IEEEdouble value_, int index_)
  374.     {
  375.         value = value_;
  376.         index = index_;
  377.     }
  378. };
  379.  
  380.  
  381. class Utf8LiteralValue : public LiteralValue
  382. {
  383. public:
  384.     char *value;
  385.     int  length;
  386.  
  387.     Utf8LiteralValue() : value(NULL)
  388.     {}
  389.  
  390.     virtual ~Utf8LiteralValue()
  391.     {
  392.         delete [] value;
  393.     }
  394.  
  395.     void Initialize(char *value_, int length_, unsigned hash_address_, int index_)
  396.     {
  397.         length = length_;
  398.         value = new char[length + 1];
  399.         memmove(value, value_, length * sizeof(char));
  400.         value[length] = U_NULL;
  401.  
  402.         hash_address = hash_address_;
  403.         index = index_;
  404.     }
  405.  
  406. private:
  407.  
  408.     friend class Utf8LiteralTable;
  409.  
  410.     unsigned hash_address;
  411. };
  412.  
  413.  
  414. class NameSymbol : public Symbol
  415. {
  416. public:
  417.     int index;
  418.     Utf8LiteralValue *Utf8_literal;
  419.  
  420.     virtual wchar_t *Name()   { return name_; }
  421.     virtual int NameLength() { return length; }
  422.     virtual NameSymbol *Identity() { return this; }
  423.     char *Utf8Name() { return (char *) (Utf8_literal ? Utf8_literal -> value : NULL); }
  424.     int Utf8NameLength() { return (Utf8_literal ? Utf8_literal -> length : 0); }
  425.  
  426.     NameSymbol() : name_(NULL)
  427.     {}
  428.  
  429.     virtual ~NameSymbol()
  430.     {
  431.         delete [] name_;
  432.     }
  433.  
  434.     inline void Initialize(wchar_t *str, int length_, unsigned hash_address_, int index_)
  435.     {
  436.         Symbol::_kind = NAME;
  437.  
  438.         hash_address = hash_address_;
  439.         index = index_;
  440.  
  441.         length = length_;
  442.         name_ = new wchar_t[length + 1];
  443.         memmove(name_, str, length * sizeof(wchar_t));
  444.         name_[length] = U_NULL;
  445.  
  446.         Utf8_literal = NULL;
  447.  
  448.         return;
  449.     }
  450.  
  451. private:
  452.  
  453.     friend class NameLookupTable;
  454.  
  455.     wchar_t *name_;
  456.     int length;
  457.     unsigned hash_address;
  458. };
  459.  
  460.  
  461. class NameLookupTable
  462. {
  463. public:
  464.     Tuple<NameSymbol *> symbol_pool;
  465.  
  466.     NameLookupTable(int estimate = 16384);
  467.     ~NameLookupTable();
  468.  
  469.     NameSymbol *FindOrInsertName(wchar_t *, int);
  470.  
  471. private:
  472.     enum
  473.     {
  474.         DEFAULT_HASH_SIZE = 4093,
  475.         MAX_HASH_SIZE = 32771
  476.     };
  477.  
  478.     NameSymbol **base;
  479.     int hash_size;
  480.  
  481.     static int primes[];
  482.     int prime_index;
  483.  
  484.     inline static unsigned Hash(wchar_t *head, int len) { return Hash::Function(head, len); }
  485.  
  486.     void Rehash();
  487. };
  488.  
  489.  
  490. class TypeLookupTable
  491. {
  492. public:
  493.     TypeLookupTable(int estimate = 16384);
  494.     ~TypeLookupTable();
  495.  
  496.     TypeSymbol *FindType(char *, int);
  497.     void InsertType(TypeSymbol *);
  498.  
  499. private:
  500.     Tuple<TypeSymbol *> symbol_pool;
  501.  
  502.     enum
  503.     {
  504.         DEFAULT_HASH_SIZE = 4093,
  505.         MAX_HASH_SIZE = 32771
  506.     };
  507.  
  508.     TypeSymbol **base;
  509.     int hash_size;
  510.  
  511.     static int primes[];
  512.     int prime_index;
  513.  
  514.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  515.  
  516.     void Rehash();
  517. };
  518.  
  519.  
  520. class LiteralSymbol : public Symbol
  521. {
  522. public:
  523.     LiteralValue *value;
  524.  
  525.     virtual wchar_t *Name()   { return name_; }
  526.     virtual int NameLength() { return length; }
  527.     virtual NameSymbol *Identity() { return (NameSymbol *) NULL; }
  528.  
  529.     LiteralSymbol() : name_(NULL)
  530.     {}
  531.  
  532.     virtual ~LiteralSymbol()
  533.     {
  534.         delete [] name_;
  535.     }
  536.  
  537.     void Initialize(wchar_t *str, unsigned hash_address_, int length_)
  538.     {
  539.         Symbol::_kind = LITERAL;
  540.  
  541.         hash_address = hash_address_;
  542.  
  543.         length = length_;
  544.         name_ = new wchar_t[length + 1];
  545.         memmove(name_, str, length * sizeof(wchar_t));
  546.         name_[length] = U_NULL;
  547.  
  548.         value = NULL;
  549.     }
  550.  
  551. private:
  552.  
  553.     friend class LiteralLookupTable;
  554.  
  555.     wchar_t *name_;
  556.     int length;
  557.     unsigned hash_address;
  558. };
  559.  
  560.  
  561. class LiteralLookupTable
  562. {
  563. public:
  564.     Tuple<LiteralSymbol *> symbol_pool;
  565.  
  566.     LiteralLookupTable();
  567.     ~LiteralLookupTable();
  568.  
  569.     LiteralSymbol *FindOrInsertLiteral(wchar_t *, int);
  570.  
  571. private:
  572.     enum
  573.     {
  574.         DEFAULT_HASH_SIZE = 1021,
  575.         MAX_HASH_SIZE = 8191
  576.     };
  577.  
  578.     LiteralSymbol **base;
  579.     int hash_size;
  580.  
  581.     static int primes[];
  582.     int prime_index;
  583.  
  584.     inline static unsigned Hash(wchar_t *head, int len) { return Hash::Function(head, len); }
  585.  
  586.     void Rehash();
  587. };
  588.  
  589.  
  590. class IntLiteralTable
  591. {
  592. public:
  593.     Tuple<IntLiteralValue *> symbol_pool;
  594.  
  595.     IntLiteralTable(LiteralValue *);
  596.     ~IntLiteralTable();
  597.  
  598.     LiteralValue *FindOrInsertNull()
  599.     {
  600.         return FindOrInsert(0);
  601.     }
  602.  
  603.     LiteralValue *FindOrInsertChar(LiteralSymbol *);
  604.     LiteralValue *FindOrInsertInt(LiteralSymbol *);
  605.     LiteralValue *FindOrInsertHexInt(LiteralSymbol *);
  606.     LiteralValue *FindOrInsertOctalInt(LiteralSymbol *);
  607.     LiteralValue *FindOrInsertNegativeInt(LiteralSymbol *);
  608.  
  609.     IntLiteralValue *FindOrInsert(int);
  610.     IntLiteralValue *Find(int);
  611.  
  612. #ifdef TEST
  613.     //
  614.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  615.     // Since the return type is wrong, compilation will fail !
  616.     //
  617.     void FindOrInsert(LongInt) {}
  618.     void FindOrInsert(float)   {}
  619.     void FindOrInsert(double)  {}
  620. #endif
  621.  
  622. private:
  623.     enum
  624.     {
  625.         DEFAULT_HASH_SIZE = 4093,
  626.         MAX_HASH_SIZE = 32771
  627.     };
  628.  
  629.     IntLiteralValue **base;
  630.     int hash_size;
  631.  
  632.     static int primes[];
  633.     int prime_index;
  634.  
  635.     static int int32_limit;
  636.  
  637.     LiteralValue *bad_value;
  638.  
  639.     void Rehash();
  640. };
  641.  
  642.  
  643. class LongLiteralTable
  644. {
  645. public:
  646.     Tuple<LongLiteralValue *> symbol_pool;
  647.  
  648.     LongLiteralTable(LiteralValue *);
  649.     ~LongLiteralTable();
  650.  
  651.     LiteralValue *FindOrInsertLong(LiteralSymbol *);
  652.     LiteralValue *FindOrInsertHexLong(LiteralSymbol *);
  653.     LiteralValue *FindOrInsertOctalLong(LiteralSymbol *);
  654.     LiteralValue *FindOrInsertNegativeLong(LiteralSymbol *);
  655.  
  656.     LongLiteralValue *FindOrInsert(LongInt);
  657.  
  658. #ifdef TEST
  659.     //
  660.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  661.     //
  662.     void FindOrInsert(int)    {}
  663.     void FindOrInsert(float)  {}
  664.     void FindOrInsert(double) {}
  665. #endif
  666.  
  667. private:
  668.  
  669.     enum
  670.     {
  671.         DEFAULT_HASH_SIZE = 1021,
  672.         MAX_HASH_SIZE = 8191
  673.     };
  674.  
  675.     LongLiteralValue **base;
  676.     int hash_size;
  677.  
  678.     static int primes[];
  679.     int prime_index;
  680.  
  681.     static LongInt int64_limit;
  682.  
  683.     LiteralValue *bad_value;
  684.  
  685.     void Rehash();
  686. };
  687.  
  688.  
  689. class FloatLiteralTable
  690. {
  691. public:
  692.     Tuple<FloatLiteralValue *> symbol_pool;
  693.  
  694.     FloatLiteralTable(LiteralValue *);
  695.     ~FloatLiteralTable();
  696.  
  697.     LiteralValue *FindOrInsertFloat(LiteralSymbol *);
  698.  
  699.     FloatLiteralValue *FindOrInsert(IEEEfloat);
  700.  
  701. #ifdef TEST
  702.     //
  703.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  704.     //
  705.     void FindOrInsert(int)     {}
  706.     void FindOrInsert(LongInt) {}
  707.     void FindOrInsert(double)  {}
  708. #endif
  709.  
  710. private:
  711.  
  712.     enum
  713.     {
  714.         DEFAULT_HASH_SIZE = 1021,
  715.         MAX_HASH_SIZE = 8191
  716.     };
  717.  
  718.     FloatLiteralValue **base;
  719.     int hash_size;
  720.  
  721.     static int primes[];
  722.     int prime_index;
  723.  
  724.     LiteralValue *bad_value;
  725.  
  726.     inline static unsigned Hash(IEEEfloat value) { return Hash::Function(value); }
  727.  
  728.     void Rehash();
  729. };
  730.  
  731.  
  732. class DoubleLiteralTable
  733. {
  734. public:
  735.     Tuple<DoubleLiteralValue *> symbol_pool;
  736.  
  737.     DoubleLiteralTable(LiteralValue *);
  738.     ~DoubleLiteralTable();
  739.  
  740.     LiteralValue *FindOrInsertDouble(LiteralSymbol *);
  741.  
  742.     DoubleLiteralValue *FindOrInsert(IEEEdouble);
  743.  
  744. #ifdef TEST
  745.     //
  746.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  747.     //
  748.     void FindOrInsert(int)     {}
  749.     void FindOrInsert(LongInt) {}
  750.     void FindOrInsert(float)   {}
  751. #endif
  752.  
  753. private:
  754.  
  755.     enum
  756.     {
  757.         DEFAULT_HASH_SIZE = 1021,
  758.         MAX_HASH_SIZE = 8191
  759.     };
  760.  
  761.     DoubleLiteralValue **base;
  762.     int hash_size;
  763.  
  764.     static int primes[];
  765.     int prime_index;
  766.  
  767.     LiteralValue *bad_value;
  768.  
  769.     inline static unsigned Hash(IEEEdouble value) { return Hash::Function(value); }
  770.  
  771.     void Rehash();
  772. };
  773.  
  774.  
  775. class Utf8LiteralTable
  776. {
  777. public:
  778.     Tuple<Utf8LiteralValue *> symbol_pool;
  779.  
  780.     Utf8LiteralTable(LiteralValue *);
  781.     ~Utf8LiteralTable();
  782.  
  783.     LiteralValue *FindOrInsertString(LiteralSymbol *);
  784.  
  785.     Utf8LiteralValue *FindOrInsert(char *, int);
  786.     Utf8LiteralValue *FindOrInsert(wchar_t);
  787.  
  788.     void CheckStringConstant(AstExpression *expr);
  789.  
  790. private:
  791.  
  792.     Tuple<AstExpression *> *expr;
  793.     bool IsConstant(AstExpression *);
  794.  
  795.     enum
  796.     {
  797.         DEFAULT_HASH_SIZE = 4093,
  798.         MAX_HASH_SIZE = 32771
  799.     };
  800.  
  801.     Utf8LiteralValue **base;
  802.     int hash_size;
  803.  
  804.     static int primes[];
  805.     int prime_index;
  806.  
  807.     LiteralValue *bad_value;
  808.  
  809.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  810.  
  811.     void Rehash();
  812. };
  813. #endif
  814.