src/share/vm/runtime/advancedThresholdPolicy.hpp

Print this page
rev 4616 : Fixes fill up of code cache: added command line parameter which defines a
threshold (percentage of used code cache) at which the threshold for
C1 recompilation is increased.


 184   // If it is, we would remove it from the queue (see select_task()).
 185   inline bool is_stale(jlong t, jlong timeout, Method* m);
 186   // Compute the weight of the method for the compilation scheduling
 187   inline double weight(Method* method);
 188   // Apply heuristics and return true if x should be compiled before y
 189   inline bool compare_methods(Method* x, Method* y);
 190   // Compute event rate for a given method. The rate is the number of event (invocations + backedges)
 191   // per millisecond.
 192   inline void update_rate(jlong t, Method* m);
 193   // Compute threshold scaling coefficient
 194   inline double threshold_scale(CompLevel level, int feedback_k);
 195   // If a method is old enough and is still in the interpreter we would want to
 196   // start profiling without waiting for the compiled method to arrive. This function
 197   // determines whether we should do that.
 198   inline bool should_create_mdo(Method* method, CompLevel cur_level);
 199   // Create MDO if necessary.
 200   void create_mdo(methodHandle mh, JavaThread* thread);
 201   // Is method profiled enough?
 202   bool is_method_profiled(Method* method);
 203 


 204 protected:
 205   void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
 206 

 207   void set_start_time(jlong t) { _start_time = t;    }
 208   jlong start_time() const     { return _start_time; }
 209 
 210   // Submit a given method for compilation (and update the rate).
 211   virtual void submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread);
 212   // event() from SimpleThresholdPolicy would call these.
 213   virtual void method_invocation_event(methodHandle method, methodHandle inlinee,
 214                                        CompLevel level, nmethod* nm, JavaThread* thread);
 215   virtual void method_back_branch_event(methodHandle method, methodHandle inlinee,
 216                                         int bci, CompLevel level, nmethod* nm, JavaThread* thread);
 217 public:
 218   AdvancedThresholdPolicy() : _start_time(0) { }
 219   // Select task is called by CompileBroker. We should return a task or NULL.
 220   virtual CompileTask* select_task(CompileQueue* compile_queue);
 221   virtual void initialize();
 222   virtual bool should_not_inline(ciEnv* env, ciMethod* callee);
 223 
 224 };
 225 
 226 #endif // TIERED


 184   // If it is, we would remove it from the queue (see select_task()).
 185   inline bool is_stale(jlong t, jlong timeout, Method* m);
 186   // Compute the weight of the method for the compilation scheduling
 187   inline double weight(Method* method);
 188   // Apply heuristics and return true if x should be compiled before y
 189   inline bool compare_methods(Method* x, Method* y);
 190   // Compute event rate for a given method. The rate is the number of event (invocations + backedges)
 191   // per millisecond.
 192   inline void update_rate(jlong t, Method* m);
 193   // Compute threshold scaling coefficient
 194   inline double threshold_scale(CompLevel level, int feedback_k);
 195   // If a method is old enough and is still in the interpreter we would want to
 196   // start profiling without waiting for the compiled method to arrive. This function
 197   // determines whether we should do that.
 198   inline bool should_create_mdo(Method* method, CompLevel cur_level);
 199   // Create MDO if necessary.
 200   void create_mdo(methodHandle mh, JavaThread* thread);
 201   // Is method profiled enough?
 202   bool is_method_profiled(Method* method);
 203 
 204   double _increase_threshold_at_ratio;
 205 
 206 protected:
 207   void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level);
 208 
 209   void set_increase_threshold_at_ratio() { _increase_threshold_at_ratio = 100 / (100 - (double)IncreaseFirstTierCompileThresholdAt); }
 210   void set_start_time(jlong t) { _start_time = t;    }
 211   jlong start_time() const     { return _start_time; }
 212 
 213   // Submit a given method for compilation (and update the rate).
 214   virtual void submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread);
 215   // event() from SimpleThresholdPolicy would call these.
 216   virtual void method_invocation_event(methodHandle method, methodHandle inlinee,
 217                                        CompLevel level, nmethod* nm, JavaThread* thread);
 218   virtual void method_back_branch_event(methodHandle method, methodHandle inlinee,
 219                                         int bci, CompLevel level, nmethod* nm, JavaThread* thread);
 220 public:
 221   AdvancedThresholdPolicy() : _start_time(0) { }
 222   // Select task is called by CompileBroker. We should return a task or NULL.
 223   virtual CompileTask* select_task(CompileQueue* compile_queue);
 224   virtual void initialize();
 225   virtual bool should_not_inline(ciEnv* env, ciMethod* callee);
 226 
 227 };
 228 
 229 #endif // TIERED