src/hotspot/share/runtime/compilationPolicy.cpp
changeset 48873 9536c39ac6de
parent 48418 2207e2917a68
child 48874 f09fdaad7321
equal deleted inserted replaced
48872:c7774afc93e3 48873:9536c39ac6de
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
       
    26 #include "classfile/classLoaderData.inline.hpp"
    26 #include "code/compiledIC.hpp"
    27 #include "code/compiledIC.hpp"
    27 #include "code/nmethod.hpp"
    28 #include "code/nmethod.hpp"
    28 #include "code/scopeDesc.hpp"
    29 #include "code/scopeDesc.hpp"
    29 #include "interpreter/interpreter.hpp"
    30 #include "interpreter/interpreter.hpp"
    30 #include "memory/resourceArea.hpp"
    31 #include "memory/resourceArea.hpp"
   310 
   311 
   311   // This operation is going to be performed only at the end of a safepoint
   312   // This operation is going to be performed only at the end of a safepoint
   312   // and hence GC's will not be going on, all Java mutators are suspended
   313   // and hence GC's will not be going on, all Java mutators are suspended
   313   // at this point and hence SystemDictionary_lock is also not needed.
   314   // at this point and hence SystemDictionary_lock is also not needed.
   314   assert(SafepointSynchronize::is_at_safepoint(), "can only be executed at a safepoint");
   315   assert(SafepointSynchronize::is_at_safepoint(), "can only be executed at a safepoint");
   315   int nclasses = InstanceKlass::number_of_instance_classes();
   316   int nclasses = ClassLoaderDataGraph::num_instance_classes();
   316   int classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 /
   317   int classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 /
   317                                         CounterHalfLifeTime);
   318                                         CounterHalfLifeTime);
   318   for (int i = 0; i < classes_per_tick; i++) {
   319   for (int i = 0; i < classes_per_tick; i++) {
   319     InstanceKlass* k = ClassLoaderDataGraph::try_get_next_class();
   320     InstanceKlass* k = ClassLoaderDataGraph::try_get_next_class();
   320     if (k != NULL) {
   321     if (k != NULL) {