Properties
Kresten Krab Thorup
krab@daimi.au.dk
Mon Sep 13 01:37:00 GMT 1999
Anthony Green <green@cygnus.com> writes:
> Jeff wrote:
> > gcjrun -Dsomeproperty=somevalue -mx32m myapp.so MyApplication
>
> Tom wrote:
> > If the class loader could load .so's, then we could just use gij for
> > this.
>
> Cool - yes, exactly! We could make this work.
I see some problems in how to get the semantics of class-loading to be
exactly right; i.e. what happens if we load a .so which defines a
class that is already loaded. The "linking" og interpreted classes is
done by the internals of the class loader, and it's not clear how to
handle the situation if things are not exactly right. Also, this
brings up the possibility for a compiled class (loaded in a .so) to
inherit from an interpreted class.
The point is, that this is not trivial and not described in a spec
somewhere. But never the less, a solution along these lines seems
like the right way to me.
One way to tacle some of these problems would be to rely less on the
system's linker, and have the runtime system do the linking of
classes, even for comiled ones. Here is an example. Right now, when
a method is inherited, the code for the subclass includes a symbolic
reference to the method in the superclass. If this symbolic reference
were to be resolved by the gcj runtime system, it would be easier to
control the effect of loading of code. Similar for all other kinds of
symbolic references, such as class names, interface names, etc.
> Tom continues:
> > One other idea is to have -D options to gcj (at link time -- which is
> > a bit weird, but since we already sometimes require -L at compile time
> > it isn't out of the question) be compiled in to the resulting
> > executable. This could easily be done by passing them down to
> > jvgenmain.
>
> This is also a good idea. jvgenmain could use these values to set up
> non-empty .gcj_property and .gcj_property_info sections, so it doesn't
> always have to be an extra step.
If the -D flags are passed to gcj and then down to gcjgenmain, then it
may equally well just generate code to set up the properties directly
in the generted main function. This seems like it would be more
portable than introducing a new section.
-- Kresten
Kresten Krab Thorup "I like my eggs ploded"
Department of Computer Science, University of Aarhus
Aabogade 34, DK-8200 Aarhus N, Denmark
+45 8942 5665 (office), +45 2343 4626 (mobile)
More information about the Java
mailing list