Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/oops/methodCounters.cpp
32285 views
/*1* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/23#include "precompiled.hpp"24#include "oops/methodCounters.hpp"25#include "runtime/thread.inline.hpp"2627MethodCounters* MethodCounters::allocate(ClassLoaderData* loader_data, TRAPS) {28return new(loader_data, size(), false, MetaspaceObj::MethodCountersType, THREAD) MethodCounters();29}3031void MethodCounters::clear_counters() {32invocation_counter()->reset();33backedge_counter()->reset();34set_interpreter_throwout_count(0);35set_interpreter_invocation_count(0);36#ifdef TIERED37set_prev_time(0);38set_rate(0);39set_highest_comp_level(0);40set_highest_osr_comp_level(0);41#endif42}434445int MethodCounters::highest_comp_level() const {46#ifdef TIERED47return _highest_comp_level;48#else49return CompLevel_none;50#endif51}5253void MethodCounters::set_highest_comp_level(int level) {54#ifdef TIERED55_highest_comp_level = level;56#endif57}5859int MethodCounters::highest_osr_comp_level() const {60#ifdef TIERED61return _highest_osr_comp_level;62#else63return CompLevel_none;64#endif65}6667void MethodCounters::set_highest_osr_comp_level(int level) {68#ifdef TIERED69_highest_osr_comp_level = level;70#endif71}72737475