ARM: Support for JVMTI notifications from JIT compiler on code generation

Andrew Dinn adinn at redhat.com
Fri Apr 27 01:43:26 PDT 2012


On 26/04/12 17:58, Andrew Haley wrote:
> On 04/26/2012 05:20 PM, Andrew Dinn wrote:
> One thing I can't see: you seem not to be checking to see if this
> data is being collected by anyone.  If env->callbacks()->CompiledMethodLoad
> is NULL, why are we doing all the work?

Well, first thing, the compiler code does not know whether there are any
environments, never mind if they have enabled method load events or
supplied a non-null callback. My assumption in implementing the
jvmtiExport method was that access to the env list and specific env
configurations is -- conceptually, if not as regards access scope
declarations -- private to the jvmti classes. I will not that the other
compilers seem to make the same assumption -- the call they use (the one
which takes an nmethod argument) is made in all cases without any prior
check to see whether there is a client interested in the notification.
As a consequence they also generate the map data required for this call
in all cases (and indeed inlining data).

Secondly, envs may come and go at runtime and may have their state
modified. So, a check on the env list would need to be done before every
compile to record the current state then the code generator would need
to test this state before translating each bytecode in order to decide
whether to branch over the table write. Those costs needs to be offset
against the benefit from omitting the table writes. So it is not clear
to me that this pre-checking is a guaranteed win.

n.b. although the cost of the table writes increases with bytecode size
so also do the remaining generation costs so the marginal cost of
generating the profile data remains a fixed fraction of the total
compile cost.

So, it might be that having the compiler code peek through the
jvmtiExport API gives us a performance gain when no profiling is being
performed at the cost of breaking an abstraction barrier but I am not
convinced it will be significant. I could try to obtain some numbers to
prove this.

regards,


Andrew Dinn
-----------



More information about the distro-pkg-dev mailing list