RFR(XS): JDK-8186154 : Extra info with +LogTouchedMethods

Ioi Lam ioi.lam at oracle.com
Sun Aug 13 01:42:12 UTC 2017


Hi Eric,

I am not sure if _touch_count can accurately represent 'how often is 
this method used'. In the interpreter, Method::log_touched is called 
only once, when building the Method::method_counters()

#define GET_METHOD_COUNTERS(res)    \
   res = METHOD->method_counters();  \
   if (res == NULL) {                \
     CALL_VM(res = InterpreterRuntime::build_method_counters(THREAD, 
METHOD), handle_exception); \
   }

In addition, whenever the compiler references a method (when compiling a 
method, or when inlining a method into another, etc), it calls 
Method::log_touched

ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
   ciMetadata(h_m()),
   _holder(holder)
{
   assert(h_m() != NULL, "no null method");

   if (LogTouchedMethods) {
     h_m()->log_touched(Thread::current());
   }

So, a high count of _touch_count is more correlated to how often this 
method is seen by the compiler.

Thanks

- Ioi



On 8/11/17 12:10 PM, Eric Caspole wrote:
> Hi,
> Please review this very small change to add more info to 
> +LogTouchedMethods including the touched count and whether the method 
> has loops. This extra info has been handy while doing experiments to 
> create the most efficient AOT library for quick startup.
>
> http://cr.openjdk.java.net/~ecaspole/JDK-8186154/webrev/
>
> https://bugs.openjdk.java.net/browse/JDK-8186154
>
> Passed JPRT hotspot tests.
>
> Thanks,
> Eric



More information about the hotspot-runtime-dev mailing list