A small optimization for compilers

Godmar Back gback at cs.utah.edu
Wed Jan 27 18:04:02 PST 1999


> 
> Hello.
> 
> Kiev compiler (and other java compilers) needs
> to use utf8 constants... I.e. convert them
> between to String and convert String to utf8
> constant. In fact, this is rather slow
> operation, especialli if to count the fatc,
> that any JVM has to have this methods
> internally. BTW, most of JVMs optimize
> utf8 constants to be unique, i.e. use
> them like interned strings.

Thanks to Archie, kaffe does that now too.

> 
> I mean, what about adding new class in
> kaffe.lang (or maybe in gnu.java.lang ?)
> to reflect utf8 constants?
> 
> This will speedup compilers that can use
> them, plus will save some memory, because
> these constants will be shared between
> JVM and compiler (this is about 300 Kb
> in my case). Also, this class may include
> some signature operations, since a big
> part of utf8 constants are signatures ;-)
> 
> I'm pretty shure there is no volontiers to
> write this class and native wrappers, but
> will you adopt this class if I will write
> it?

Sure.  We've already planned to create a kind of
"contrib" directory for kaffe-related goodies people have.
Since it'll be kaffe specific,  I'd recommend 
kaffe.contrib.utf8const or some such.  We can always 
finalize the name later.

	- Godmar



More information about the kaffe mailing list