Locating call sites of methods in C2

Christian Thalinger christian.thalinger at oracle.com
Fri Dec 12 22:42:08 UTC 2014


> On Dec 8, 2014, at 7:46 PM, Manas Thakur <manasthakur17 at gmail.com> wrote:
> 
> Hi Christian
> 
> Yes, I am looking for something similar: at the time I am compiling bar(), I want to know the BCI of the invoke instruction, as well as the caller method, because of which bar() was added to the compile queue.

You can’t.  bar() can be called from many different places and all call sites add to the invocation counter.  It’s purely random which call site will trigger the method to be queued for compilation.

> 
> Regards,
> Manas
> 
> 
>> On 08-Dec-2014, at 11:45 pm, Christian Thalinger <christian.thalinger at oracle.com <mailto:christian.thalinger at oracle.com>> wrote:
>> 
>> 
>>> On Dec 5, 2014, at 2:49 AM, Manas Thakur <manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>> wrote:
>>> 
>>> Hi
>>> 
>>> Is there a way to access the call-site (possibly in terms of the bytecode offset) of a method being compiled by C2? Doesn’t the current compile task store it in some variable?
>> 
>> I’m not sure I understand.  Are you asking for the BCI (bytecode index) of the invoke instruction to method bar if you compile a method foo which calls bar:
>> 
>> void foo() {
>>  bar();
>> }
>> 
>>> 
>>> Regards,
>>> Manas
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20141212/5f3156c0/attachment.html>


More information about the hotspot-compiler-dev mailing list