annotate src/hotspot/share/oops/methodCounters.cpp @ 53207:b1c6d4d7f801

8215724: Epsilon: ArrayStoreExceptionTest.java fails; missing arraycopy check Reviewed-by: eosterlund, lkorinth
author shade
date Wed, 09 Jan 2019 15:53:56 +0100
parents ea379ebb9447
children
rev   line source
jiangli@17000 1 /*
coleenp@46727 2 * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
jiangli@17000 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jiangli@17000 4 *
jiangli@17000 5 * This code is free software; you can redistribute it and/or modify it
jiangli@17000 6 * under the terms of the GNU General Public License version 2 only, as
jiangli@17000 7 * published by the Free Software Foundation.
jiangli@17000 8 *
jiangli@17000 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jiangli@17000 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jiangli@17000 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jiangli@17000 12 * version 2 for more details (a copy is included in the LICENSE file that
jiangli@17000 13 * accompanied this code).
jiangli@17000 14 *
jiangli@17000 15 * You should have received a copy of the GNU General Public License version
jiangli@17000 16 * 2 along with this work; if not, write to the Free Software Foundation,
jiangli@17000 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jiangli@17000 18 *
jiangli@17000 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jiangli@17000 20 * or visit www.oracle.com if you need additional information or have any
jiangli@17000 21 * questions.
jiangli@17000 22 *
jiangli@17000 23 */
jiangli@17000 24 #include "precompiled.hpp"
iklam@46746 25 #include "memory/metaspaceClosure.hpp"
jiangli@17000 26 #include "oops/methodCounters.hpp"
zmajo@28650 27 #include "runtime/handles.inline.hpp"
jiangli@17000 28
coleenp@46727 29 MethodCounters* MethodCounters::allocate(const methodHandle& mh, TRAPS) {
zmajo@28650 30 ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
iklam@46746 31 return new(loader_data, method_counters_size(), MetaspaceObj::MethodCountersType, THREAD) MethodCounters(mh);
jiangli@17000 32 }
jiangli@17000 33
jiangli@17000 34 void MethodCounters::clear_counters() {
jiangli@17000 35 invocation_counter()->reset();
jiangli@17000 36 backedge_counter()->reset();
jiangli@17000 37 set_interpreter_throwout_count(0);
jiangli@17000 38 set_interpreter_invocation_count(0);
iveresov@24442 39 set_nmethod_age(INT_MAX);
iveresov@26586 40 #ifdef TIERED
iveresov@26586 41 set_prev_time(0);
iveresov@26586 42 set_rate(0);
iveresov@26586 43 set_highest_comp_level(0);
iveresov@26586 44 set_highest_osr_comp_level(0);
iveresov@26586 45 #endif
jiangli@17000 46 }
iveresov@26586 47
iveresov@26586 48
iveresov@26586 49 int MethodCounters::highest_comp_level() const {
iveresov@26586 50 #ifdef TIERED
iveresov@26586 51 return _highest_comp_level;
iveresov@26586 52 #else
iveresov@26586 53 return CompLevel_none;
iveresov@26586 54 #endif
iveresov@26586 55 }
iveresov@26586 56
iveresov@26586 57 void MethodCounters::set_highest_comp_level(int level) {
iveresov@26586 58 #ifdef TIERED
iveresov@26586 59 _highest_comp_level = level;
iveresov@26586 60 #endif
iveresov@26586 61 }
iveresov@26586 62
iveresov@26586 63 int MethodCounters::highest_osr_comp_level() const {
iveresov@26586 64 #ifdef TIERED
iveresov@26586 65 return _highest_osr_comp_level;
iveresov@26586 66 #else
iveresov@26586 67 return CompLevel_none;
iveresov@26586 68 #endif
iveresov@26586 69 }
iveresov@26586 70
iveresov@26586 71 void MethodCounters::set_highest_osr_comp_level(int level) {
iveresov@26586 72 #ifdef TIERED
iveresov@26586 73 _highest_osr_comp_level = level;
iveresov@26586 74 #endif
iveresov@26586 75 }
iveresov@26586 76
iklam@46746 77 void MethodCounters::metaspace_pointers_do(MetaspaceClosure* it) {
iklam@46746 78 log_trace(cds)("Iter(MethodCounters): %p", this);
iklam@46746 79 #if INCLUDE_AOT
iklam@46746 80 it->push(&_method);
iklam@46746 81 #endif
iklam@46746 82 }
iveresov@44630 83
iveresov@44630 84 void MethodCounters::print_value_on(outputStream* st) const {
iveresov@44630 85 assert(is_methodCounters(), "must be methodCounters");
iveresov@44630 86 st->print("method counters");
iveresov@44630 87 print_address_on(st);
iveresov@44630 88 }
iveresov@44630 89
iveresov@44630 90