LinkResolver question

Nagy Mostafa nagy.mostafa at
Thu Aug 26 14:31:04 PDT 2010

On Thu, Aug 26, 2010 at 10:23 AM, Yi Yang <idealistyy at> wrote:

> Hello everyone,
> I added a printf statement into the LinkResolver::resolve_invokestatic(),
> hoping that it would hook a static method call when a invokestatic bytecode
> happens. However, it prints out more statements than I expected, and the
> .class file tested actually doesn't have any static method calls (according
> to javap also). So, my question is, why does resolve_invokestatic()  be
> called even if there is no invokestatic bytecode?

This is because not just your code gets executed. Other Java class library
and initialization code gets executed as well.

> Also, do you think adding instrumentation hooks into LinkResolver is a good
> idea to record the method calls information during the runtime? Thank you.
> That would be true only if you are running in interpreter-only mode
(-Xint). Compiled code, however, has to be instrumented or you can write a
JVMTI agent for that purpose but from my experience profiling method
calls/returns is extremely slow.

> Best,
> Yi

- nagy
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-dev mailing list