Curious Kaffe vs. jdk speed test results under Linux

Maxim Kizub max at
Mon Jan 4 01:43:18 PST 1999

Godmar Back wrote:
> >
> > What about this code:
> >
> > class A {
> >     public int i;
> > }
> >
> > class B {
> >     int foo() {
> >         if (...) {
> >             A a = new A();
> >             return a.i;
> >         }
> >         else
> >             return 0;
> >     }
> > }
> >
> > How does kaffe compiles method when class A is not loaded?
> > Until expression in the 'if' statement is true - class A is not allowed
> > to be loaded ?!
> The JLS explains how the loading, linking, and initialization of classes
> works.  Class A can certainly be loaded when B is jit-compiled.
> Therefore, its layout is known at this point in time.
> However, it can not be initialized until its first active use.
> The first active use is the NEW instruction (if it is executed).
> This is when class A is initialized.

Aha. That's my fault. I forgot that loading and initialization
are different things. Sorry.

This also the answer on my question in previos letter (about
error in memory) why kaffe loads most of classes even if
my compiler is not going to do anything...

One more question - how kaffe calls interface mathods?
By special method that lookups method signatures?

In fact, I asked all these questions in order to understand if
it will be easy enough to add some extended bytecode commands
in kaffe. Remember, I was asking about pluggable extensions?
I really upset with JVM bytecode set. I'd like to have
multimethod calls (i.e. calls that use not only methods'
signature, but also actual run-time types of arguments),
calls with tail recursion (I badly need them for
effective implementation of embedded prolog subsystem
in kiev compiler). Some extensions like adding method
pointers and closures at the JVM level will help
kiev as well as pizza and so on. Also, it's possible
to add some kind of bytecode and class patching at
load time, that will allow normal parametriezed types
(used in kiev and pizza) to be full featured addon
for java (not half-emulated, like in pizza and kiev now!).
I'm so tied fighting with Sun's JVM, that even
agreed if some of those kiev extensions will work
with pizza only.

  Maxim Kizub

More information about the kaffe mailing list