--- a/src/hotspot/share/runtime/compilationPolicy.cpp Thu Feb 08 08:38:42 2018 -0800
+++ b/src/hotspot/share/runtime/compilationPolicy.cpp Thu Feb 08 13:21:22 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "classfile/classLoaderData.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
#include "code/scopeDesc.hpp"
@@ -312,10 +313,10 @@
// and hence GC's will not be going on, all Java mutators are suspended
// at this point and hence SystemDictionary_lock is also not needed.
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);