Resolved Strings

Per Bothner bothner at cygnus.com
Thu Mar 26 08:11:28 PST 1998


> Please excuse my silly question, but what exactly is a resolved String
> in Kaffe ??
> How is it stored in memory ?

If you are referring to the diference between these:

	#define CONSTANT_String                 8
	#define CONSTANT_ResolvedString         (16+CONSTANT_String)

then the difference is that the value of a CONSTANT_ResolvedString
is a reference to an intern'ed java.lang.String object, while the
value of a CONSTANT_String is a pointer to a Utf8Const.  The latter
is not interned, and is the value of a CONSTANT_Utf8 constant.
The distinction is useful for two reasons:
1) We don't need to allocate and intern an actual java.lang.String
until the class is actually 'prepared'.
2) An ahead-of-time compiler (i.e. gcc) can create a pre-allocated
Utf8Constant in static data memory, but cannot create of a
pre-allocated java.lang.String object (because of separate compilation
making it difficult to properly intern a string in advance).

	--Per Bothner
Cygnus Solutions     bothner at cygnus.com     http://www.cygnus.com/~bothner



More information about the kaffe mailing list