allocating objects

Patrick Tullmann kaffe@rufus.w3.org
Thu, 6 Jul 2000 13:23:09 -0600


Johan Andersson wrote:
>    In object.c, the function newObject(...) allocates the object. But I
>    can't find out who is calling newObject(...) or when. 

There is a 'new' instruction which gets compiled to an invocation of
newObject().  Look at kaffe/kaffevm/jit3/kaffe-jit.def.  Look for
'NEW'.  Via many macros, 'soft_new' is eventually called, which
processes and loads the .class file, and calls newObject().

>    When is the constructor called? 

The bytecode contains an explicit call to a new object's constructor.

>    Can anyone help me out?

You should look into disassemblers for .class files.  'javap' which
ships with kaffe doesn't have support for disassembly... though it
would be a very educational project to add such support!  Its a
pure-Java application, in
kaffe/libraries/extensions/tools/javalib/kaffe/tools/javap/.  :)

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann@cs.utah.edu
			  Mean people suck.