< prev index next >

src/hotspot/share/oops/methodCounters.hpp

Print this page




  86     set_interpreter_invocation_count(0);
  87     set_interpreter_throwout_count(0);
  88     JVMTI_ONLY(clear_number_of_breakpoints());
  89     invocation_counter()->init();
  90     backedge_counter()->init();
  91 
  92     if (StressCodeAging) {
  93       set_nmethod_age(HotMethodDetectionLimit);
  94     }
  95 
  96     // Set per-method thresholds.
  97     double scale = 1.0;
  98     CompilerOracle::has_option_value(mh, "CompileThresholdScaling", scale);
  99 
 100     int compile_threshold = CompilerConfig::scaled_compile_threshold(CompileThreshold, scale);
 101     _interpreter_invocation_limit = compile_threshold << InvocationCounter::count_shift;
 102     if (ProfileInterpreter) {
 103       // If interpreter profiling is enabled, the backward branch limit
 104       // is compared against the method data counter rather than an invocation
 105       // counter, therefore no shifting of bits is required.
 106       _interpreter_backward_branch_limit = (compile_threshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
 107     } else {
 108       _interpreter_backward_branch_limit = ((compile_threshold * OnStackReplacePercentage) / 100) << InvocationCounter::count_shift;
 109     }
 110     _interpreter_profile_limit = ((compile_threshold * InterpreterProfilePercentage) / 100) << InvocationCounter::count_shift;
 111     _invoke_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
 112     _backedge_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
 113   }
 114 
 115  public:
 116   virtual bool is_methodCounters() const volatile { return true; }
 117 
 118   static MethodCounters* allocate(const methodHandle& mh, TRAPS);
 119 
 120   void deallocate_contents(ClassLoaderData* loader_data) {}
 121 
 122   AOT_ONLY(Method* method() const { return _method; })
 123 
 124   static int method_counters_size() {
 125     return align_up((int)sizeof(MethodCounters), wordSize) / wordSize;
 126   }
 127   virtual int size() const {
 128     return method_counters_size();




  86     set_interpreter_invocation_count(0);
  87     set_interpreter_throwout_count(0);
  88     JVMTI_ONLY(clear_number_of_breakpoints());
  89     invocation_counter()->init();
  90     backedge_counter()->init();
  91 
  92     if (StressCodeAging) {
  93       set_nmethod_age(HotMethodDetectionLimit);
  94     }
  95 
  96     // Set per-method thresholds.
  97     double scale = 1.0;
  98     CompilerOracle::has_option_value(mh, "CompileThresholdScaling", scale);
  99 
 100     int compile_threshold = CompilerConfig::scaled_compile_threshold(CompileThreshold, scale);
 101     _interpreter_invocation_limit = compile_threshold << InvocationCounter::count_shift;
 102     if (ProfileInterpreter) {
 103       // If interpreter profiling is enabled, the backward branch limit
 104       // is compared against the method data counter rather than an invocation
 105       // counter, therefore no shifting of bits is required.
 106       _interpreter_backward_branch_limit = ((int64_t)compile_threshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
 107     } else {
 108       _interpreter_backward_branch_limit = (((int64_t)compile_threshold * OnStackReplacePercentage) / 100) << InvocationCounter::count_shift;
 109     }
 110     _interpreter_profile_limit = ((compile_threshold * InterpreterProfilePercentage) / 100) << InvocationCounter::count_shift;
 111     _invoke_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0InvokeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
 112     _backedge_mask = right_n_bits(CompilerConfig::scaled_freq_log(Tier0BackedgeNotifyFreqLog, scale)) << InvocationCounter::count_shift;
 113   }
 114 
 115  public:
 116   virtual bool is_methodCounters() const volatile { return true; }
 117 
 118   static MethodCounters* allocate(const methodHandle& mh, TRAPS);
 119 
 120   void deallocate_contents(ClassLoaderData* loader_data) {}
 121 
 122   AOT_ONLY(Method* method() const { return _method; })
 123 
 124   static int method_counters_size() {
 125     return align_up((int)sizeof(MethodCounters), wordSize) / wordSize;
 126   }
 127   virtual int size() const {
 128     return method_counters_size();


< prev index next >