annotate src/share/vm/oops/methodCounters.cpp @ 7745:6dc8db7164d2

Added tag jdk9-b49 for changeset 360cd1fc42f1
author katleman
date Thu, 05 Feb 2015 11:43:29 -0800
parents a39c9249f4be
children e8699be63872
rev   line source
jiangli@4501 1 /*
jiangli@4501 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
jiangli@4501 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jiangli@4501 4 *
jiangli@4501 5 * This code is free software; you can redistribute it and/or modify it
jiangli@4501 6 * under the terms of the GNU General Public License version 2 only, as
jiangli@4501 7 * published by the Free Software Foundation.
jiangli@4501 8 *
jiangli@4501 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jiangli@4501 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jiangli@4501 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jiangli@4501 12 * version 2 for more details (a copy is included in the LICENSE file that
jiangli@4501 13 * accompanied this code).
jiangli@4501 14 *
jiangli@4501 15 * You should have received a copy of the GNU General Public License version
jiangli@4501 16 * 2 along with this work; if not, write to the Free Software Foundation,
jiangli@4501 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jiangli@4501 18 *
jiangli@4501 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jiangli@4501 20 * or visit www.oracle.com if you need additional information or have any
jiangli@4501 21 * questions.
jiangli@4501 22 *
jiangli@4501 23 */
jiangli@4501 24 #include "precompiled.hpp"
jiangli@4501 25 #include "oops/methodCounters.hpp"
zmajo@7740 26 #include "runtime/handles.inline.hpp"
jiangli@4501 27
zmajo@7740 28 MethodCounters* MethodCounters::allocate(methodHandle mh, TRAPS) {
zmajo@7740 29 ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
zmajo@7740 30 return new(loader_data, size(), false, MetaspaceObj::MethodCountersType, THREAD) MethodCounters(mh);
jiangli@4501 31 }
jiangli@4501 32
jiangli@4501 33 void MethodCounters::clear_counters() {
jiangli@4501 34 invocation_counter()->reset();
jiangli@4501 35 backedge_counter()->reset();
jiangli@4501 36 set_interpreter_throwout_count(0);
jiangli@4501 37 set_interpreter_invocation_count(0);
iveresov@6430 38 set_nmethod_age(INT_MAX);
iveresov@7040 39 #ifdef TIERED
iveresov@7040 40 set_prev_time(0);
iveresov@7040 41 set_rate(0);
iveresov@7040 42 set_highest_comp_level(0);
iveresov@7040 43 set_highest_osr_comp_level(0);
iveresov@7040 44 #endif
jiangli@4501 45 }
iveresov@7040 46
iveresov@7040 47
iveresov@7040 48 int MethodCounters::highest_comp_level() const {
iveresov@7040 49 #ifdef TIERED
iveresov@7040 50 return _highest_comp_level;
iveresov@7040 51 #else
iveresov@7040 52 return CompLevel_none;
iveresov@7040 53 #endif
iveresov@7040 54 }
iveresov@7040 55
iveresov@7040 56 void MethodCounters::set_highest_comp_level(int level) {
iveresov@7040 57 #ifdef TIERED
iveresov@7040 58 _highest_comp_level = level;
iveresov@7040 59 #endif
iveresov@7040 60 }
iveresov@7040 61
iveresov@7040 62 int MethodCounters::highest_osr_comp_level() const {
iveresov@7040 63 #ifdef TIERED
iveresov@7040 64 return _highest_osr_comp_level;
iveresov@7040 65 #else
iveresov@7040 66 return CompLevel_none;
iveresov@7040 67 #endif
iveresov@7040 68 }
iveresov@7040 69
iveresov@7040 70 void MethodCounters::set_highest_osr_comp_level(int level) {
iveresov@7040 71 #ifdef TIERED
iveresov@7040 72 _highest_osr_comp_level = level;
iveresov@7040 73 #endif
iveresov@7040 74 }
iveresov@7040 75