src/hotspot/share/oops/methodCounters.hpp
changeset 50589 e5d741569070
parent 47799 1772ebf07d1f
child 53002 9d60798b21af
equal deleted inserted replaced
50588:1ab701eb7de4 50589:e5d741569070
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 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.
    24 
    24 
    25 #ifndef SHARE_VM_OOPS_METHODCOUNTERS_HPP
    25 #ifndef SHARE_VM_OOPS_METHODCOUNTERS_HPP
    26 #define SHARE_VM_OOPS_METHODCOUNTERS_HPP
    26 #define SHARE_VM_OOPS_METHODCOUNTERS_HPP
    27 
    27 
    28 #include "oops/metadata.hpp"
    28 #include "oops/metadata.hpp"
       
    29 #include "compiler/compilerDefinitions.hpp"
    29 #include "compiler/compilerOracle.hpp"
    30 #include "compiler/compilerOracle.hpp"
    30 #include "interpreter/invocationCounter.hpp"
    31 #include "interpreter/invocationCounter.hpp"
    31 #include "runtime/arguments.hpp"
    32 #include "runtime/arguments.hpp"
    32 #include "utilities/align.hpp"
    33 #include "utilities/align.hpp"
    33 
    34 
    94 
    95 
    95     // Set per-method thresholds.
    96     // Set per-method thresholds.
    96     double scale = 1.0;
    97     double scale = 1.0;
    97     CompilerOracle::has_option_value(mh, "CompileThresholdScaling", scale);
    98     CompilerOracle::has_option_value(mh, "CompileThresholdScaling", scale);
    98 
    99 
    99     int compile_threshold = Arguments::scaled_compile_threshold(CompileThreshold, scale);
   100     int compile_threshold = CompilerConfig::scaled_compile_threshold(CompileThreshold, scale);
   100     _interpreter_invocation_limit = compile_threshold << InvocationCounter::count_shift;
   101     _interpreter_invocation_limit = compile_threshold << InvocationCounter::count_shift;
   101     if (ProfileInterpreter) {
   102     if (ProfileInterpreter) {
   102       // If interpreter profiling is enabled, the backward branch limit
   103       // If interpreter profiling is enabled, the backward branch limit
   103       // is compared against the method data counter rather than an invocation
   104       // is compared against the method data counter rather than an invocation
   104       // counter, therefore no shifting of bits is required.
   105       // counter, therefore no shifting of bits is required.
   105       _interpreter_backward_branch_limit = (compile_threshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
   106       _interpreter_backward_branch_limit = (compile_threshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
   106     } else {
   107     } else {
   107       _interpreter_backward_branch_limit = ((compile_threshold * OnStackReplacePercentage) / 100) << InvocationCounter::count_shift;
   108       _interpreter_backward_branch_limit = ((compile_threshold * OnStackReplacePercentage) / 100) << InvocationCounter::count_shift;
   108     }
   109     }
   109     _interpreter_profile_limit = ((compile_threshold * InterpreterProfilePercentage) / 100) << InvocationCounter::count_shift;
   110     _interpreter_profile_limit = ((compile_threshold * InterpreterProfilePercentage) / 100) << InvocationCounter::count_shift;
   110     _invoke_mask = right_n_bits(Arguments::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
   111     _invoke_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
   111     _backedge_mask = right_n_bits(Arguments::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
   112     _backedge_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
   112   }
   113   }
   113 
   114 
   114  public:
   115  public:
   115   virtual bool is_methodCounters() const volatile { return true; }
   116   virtual bool is_methodCounters() const volatile { return true; }
   116 
   117