A small optimization for compilers

Maxim Kizub max at immsp.kiev.ua
Wed Jan 27 09:05:00 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.

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?

Also, what package you will recommend for
it? I use kiev.stdlib.KString now for
utf8 strings, and may change my code.
But it would be wice to not place this
class in "private" JVM library, like
kaffe.lang or gnu.java.lang...

Regards
  Maxim Kizub


More information about the kaffe mailing list