RFR(S) 8196923: [REDO] NMT: Report array class count in NMT summary

Thomas Stüfe thomas.stuefe at gmail.com
Thu Feb 8 18:05:23 UTC 2018


Hi Zhengyu,

change looks fine.

Best Regards, Thomas

On Thu, Feb 8, 2018 at 4:43 PM, Zhengyu Gu <zgu at redhat.com> wrote:

> This patch fixed compilation errors on Windows in early patch
> (JDK-8193184), due following size_t => int conversions.
>
> classLoaderData.cpp.patch
>
>    InstanceKlass* try_get_next_class() {
>      assert(SafepointSynchronize::is_at_safepoint(), "only called at
> safepoint");
> -    int max_classes = InstanceKlass::number_of_instance_classes();
> +    size_t max_classes = ClassLoaderDataGraph::num_instance_classes();
>      assert(max_classes > 0, "should not be called with no instance
> classes");
> -    for (int i = 0; i < max_classes; ) {
> +    for (size_t i = 0; i < max_classes; ) {
>
>
> compilationPolicy.cpp.patch
>
>    assert(SafepointSynchronize::is_at_safepoint(), "can only be executed
> at a safepoint");
> -  int nclasses = InstanceKlass::number_of_instance_classes();
> -  int classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3
> /
> +  size_t nclasses = ClassLoaderDataGraph::num_instance_classes();
> +  size_t classes_per_tick = nclasses * (CounterDecayMinIntervalLength *
> 1e-3 /
>                                          CounterHalfLifeTime);
> -  for (int i = 0; i < classes_per_tick; i++) {
> +  for (size_t i = 0; i < classes_per_tick; i++) {
>      InstanceKlass* k = ClassLoaderDataGraph::try_get_next_class();
>      if (k != NULL) {
>        k->methods_do(do_method);
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8196923
>
> Webrev: http://cr.openjdk.java.net/~zgu/8196923/webrev.00/
>
> Test:
>
>   hotspot_runtime on Linux 64 (fastdebug and release)
>
> Thanks,
>
> -Zhengyu
>
>
>
>


More information about the hotspot-runtime-dev mailing list