hotspot/src/share/vm/runtime/advancedThresholdPolicy.hpp
changeset 46727 6e4a84748e2c
parent 42650 1f304d0c888b
equal deleted inserted replaced
46726:7801367e3cc9 46727:6e4a84748e2c
     1 /*
     1 /*
     2  * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2017, 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.
   197   // If a method is old enough and is still in the interpreter we would want to
   197   // If a method is old enough and is still in the interpreter we would want to
   198   // start profiling without waiting for the compiled method to arrive. This function
   198   // start profiling without waiting for the compiled method to arrive. This function
   199   // determines whether we should do that.
   199   // determines whether we should do that.
   200   inline bool should_create_mdo(Method* method, CompLevel cur_level);
   200   inline bool should_create_mdo(Method* method, CompLevel cur_level);
   201   // Create MDO if necessary.
   201   // Create MDO if necessary.
   202   void create_mdo(methodHandle mh, JavaThread* thread);
   202   void create_mdo(const methodHandle& mh, JavaThread* thread);
   203   // Is method profiled enough?
   203   // Is method profiled enough?
   204   bool is_method_profiled(Method* method);
   204   bool is_method_profiled(Method* method);
   205 
   205 
   206   double _increase_threshold_at_ratio;
   206   double _increase_threshold_at_ratio;
   207 
   207 
   208   bool maybe_switch_to_aot(methodHandle mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread);
   208   bool maybe_switch_to_aot(const methodHandle& mh, CompLevel cur_level, CompLevel next_level, JavaThread* thread);
   209 
   209 
   210 protected:
   210 protected:
   211   void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
   211   void print_specific(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level);
   212 
   212 
   213   void set_increase_threshold_at_ratio() { _increase_threshold_at_ratio = 100 / (100 - (double)IncreaseFirstTierCompileThresholdAt); }
   213   void set_increase_threshold_at_ratio() { _increase_threshold_at_ratio = 100 / (100 - (double)IncreaseFirstTierCompileThresholdAt); }
   214   void set_start_time(jlong t) { _start_time = t;    }
   214   void set_start_time(jlong t) { _start_time = t;    }
   215   jlong start_time() const     { return _start_time; }
   215   jlong start_time() const     { return _start_time; }
   216 
   216