RFR(XS): JDK-8186154 : Extra info with +LogTouchedMethods
Eric Caspole
eric.caspole at oracle.com
Mon Aug 14 16:03:07 UTC 2017
Hi Ioi,
Yes this is not a cheap invocation counter. I think the count is useful
because it is related to how often the methods are considered for
inlining etc, so the higher counts are methods that affect the hot paths
in a way I admit I don't completely understand yet. That's why I want
this stat :)
Eric
On 08/12/2017 09:42 PM, Ioi Lam wrote:
> 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