Object Allocation

Jon Masamitsu jon.masamitsu at oracle.com
Thu Nov 18 12:08:58 PST 2010

A colleague commented to me that you were
perhaps looking for the JIT'ed code that does
the bump allocations.  In which case you will need
to find something different than allocate_from_tlab()
which would be used by the interpreter.

On 11/18/10 10:16, Jon Masamitsu wrote:
> On 11/18/10 09:19, Brain Damage wrote:
>> Hello,
>> I am trying to do some modifications in the allocation process of 
>> 'external' objects i.e. objects allocated using 'new' by any java 
>> program.
>> As written in the whitepaper, JVM employs the fast allocation or 
>> 'Bump a pointer' technique for allocating external objects.
>> I am not able to find the entry point of the 'new' keyword i.e. what 
>> functions are called when it sees the new keyword in a java program.
>> My initial suspect was  JRT_ENTRY(...) macro in the runtime.cpp file, 
>> where they have matched 'new_instance_java' with  'new_instance_C'.
>> I tried to follow the functions called by this macro i.e.   
>> instanceKlass::cast(klass)->allocate_instance(THREAD);
>> Although it did take me to some object allocation but I am not sure 
>> if this is the process used to allocate java objects.
>> It seems this process is used by the JVM to allocate it's internal 
>> runtime objects to build the environment.
> I think you have actually found the code that you are seeking.  Follow 
> the calls
> from allocate_instance() down to 
> CollectedHeap::common_mem_allocate_noinit()
> and in that method look at CollectedHeap::allocate_from_tlab() for the 
> "bump"
> allocation.
>> I don't know a whole lot about jvm, this is just what I could make 
>> out by looking at the code.
>> Please help me find the definition new.
>> Thanks,
>> Yogesh 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20101118/b5f8eda5/attachment.html 

More information about the hotspot-gc-dev mailing list