Subject: Re: hash table

From: Zheng Gengbing <[email-masked]>
Date: Tue, 21 May 1996 10:25:15 +0800 (EAT)

On Mon, 20 May 1996, Guansong Zhang wrote:

> On May 20, 11:11am, Zheng Gengbing wrote:
> > Subject: Re: Putting our project onto internet
> > On Sun, 19 May 1996, Guansong Zhang wrote:
> >
> > >
> > > 1. hash table.
> > >
> > > At first, compared with constructing AST, hash table is not important, but
> now
> > > it begins to affect the efficency in hpfsc. This not only makes hpfsc run
> very
> > > slow but also will affect any further work on compiler.
> > >
> > > So hash table should be added. In fact, there is a hash algorithm in
> Sage++. I
> > > will talk this further if we decide to use the same one.
> > >
> >
> >
> >
> > 	Since hash table is not saved in dumpdep files , so only after we
> > merge hpf2dep and hpfsc can we implement hash table .
> >
> 
> Well, that is one way. But we may have alternative. What about the following:
> 
> Hash table is just something for quick look up the symbol table. In fact, after
> readNodes, we can add one more procedure to build all the hash entry for the
> symbole table. This method is used in Sage++. The following is the code from
> db.c (unparse contains this part, but don't use them.)
> 
> 
> ---------------------------------------------------------------
> 
> We can just use the above method, one thing should be emphasized is that any
> future work have to use the same hash method as this. We can put this procedure
> into basicop.
> 
> The thing I am not sure about is that what happens if we have two symbol entry
> with same name. I think look up algorithm may take care of that. Right? If
> posible we may add the lookup-hash function also to the basicop.
> 
> Any way, if we use this method, I think we can add hash table right away,
> without touching hpf2dep. But we have to change all the lookup functions in
> hpfsc.
> 

	Ok, I have implemented hash table according to this . I add makehash.c
in basicop and add HASHMAX macro in defnodes.h and I rewrite the lookup
functions in hpfsc . 
	Although it reduced some time of compilation , the outcome is still
not very ideal. There still need about half a minute to compile rkNAG.f .

***************************************************************************
*     Zheng Gengbin                 *                                     *
*                                   *                                     *
*  Dept. of Computer Science        *  Phone:  86-10-2585088              *
*         & Technology              *  Email:                             *
*                                   *      [email-masked]   *
*  Peking University P.R.China      *  Mail:                              *
*                                   *      Room 1077 ,Building 47,        *
*                                   *      Peking University, P.R.China   *
***************************************************************************