< prev index next >

src/hotspot/share/compiler/compilationPolicy.hpp

Print this page
*** 44,10 ***
--- 44,11 ---
      QueueNode* next() const { return _next; }
    };
  
    QueueNode* _head;
    QueueNode* _tail;
+   int _processing;
  
    void push_unlocked(T* value) {
      QueueNode* n = new QueueNode(value, nullptr);
      if (_tail != nullptr) {
        _tail->set_next(n);

*** 79,10 ***
--- 80,11 ---
      push_unlocked(value);
      locker.notify_all();
    }
  
    bool is_empty_unlocked() const { return _head == nullptr; }
+   bool is_processing_unlocked() const { return _processing > 0; }
  
    T* pop(Monitor* lock, JavaThread* current) {
      MonitorLocker locker(current, lock);
      while (is_empty_unlocked() && !CompileBroker::is_compilation_disabled_forever()) {
        locker.wait();

*** 240,15 ***
   */
  
  class CompilationPolicy : AllStatic {
    friend class CallPredicate;
    friend class LoopPredicate;
  
    typedef CompilationPolicyUtils::Queue<InstanceKlass> TrainingReplayQueue;
  
    static int64_t _start_time;
!   static int _c1_count, _c2_count;
    static double _increase_threshold_at_ratio;
    static TrainingReplayQueue _training_replay_queue;
  
    // Set carry flags in the counters (in Method* and MDO).
    inline static void handle_counter_overflow(const methodHandle& method);
--- 242,16 ---
   */
  
  class CompilationPolicy : AllStatic {
    friend class CallPredicate;
    friend class LoopPredicate;
+   friend class RecompilationPolicy;
  
    typedef CompilationPolicyUtils::Queue<InstanceKlass> TrainingReplayQueue;
  
    static int64_t _start_time;
!   static int _c1_count, _c2_count, _ac_count;
    static double _increase_threshold_at_ratio;
    static TrainingReplayQueue _training_replay_queue;
  
    // Set carry flags in the counters (in Method* and MDO).
    inline static void handle_counter_overflow(const methodHandle& method);

*** 294,10 ***
--- 297,11 ---
    inline static bool is_stale(int64_t t, int64_t timeout, const methodHandle& method);
    // Compute the weight of the method for the compilation scheduling
    inline static double weight(Method* method);
    // Apply heuristics and return true if x should be compiled before y
    inline static bool compare_methods(Method* x, Method* y);
+   inline static bool compare_tasks(CompileTask* x, CompileTask* y);
    // Compute event rate for a given method. The rate is the number of event (invocations + backedges)
    // per millisecond.
    inline static void update_rate(int64_t t, const methodHandle& method);
    // Compute threshold scaling coefficient
    inline static double threshold_scale(CompLevel level, int feedback_k);

*** 310,10 ***
--- 314,11 ---
    // Is method profiled enough?
    static bool is_method_profiled(const methodHandle& method);
  
    static void set_c1_count(int x) { _c1_count = x;    }
    static void set_c2_count(int x) { _c2_count = x;    }
+   static void set_ac_count(int x) { _ac_count = x;    }
  
    enum EventType { CALL, LOOP, COMPILE, FORCE_COMPILE, FORCE_RECOMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT };
    static void print_event_on(outputStream *st, EventType type, Method* m, Method* im, int bci, CompLevel level);
    static void print_event(EventType type, Method* m, Method* im, int bci, CompLevel level);
    // Check if the method can be compiled, change level if necessary

*** 341,10 ***
--- 346,11 ---
    static void replay_training_at_init_impl(InstanceKlass* klass, JavaThread* current);
   public:
    static int min_invocations() { return Tier4MinInvocationThreshold; }
    static int c1_count() { return _c1_count; }
    static int c2_count() { return _c2_count; }
+   static int ac_count() { return _ac_count; }
    static int compiler_count(CompLevel comp_level);
    // If m must_be_compiled then request a compilation from the CompileBroker.
    // This supports the -Xcomp option.
    static void compile_if_required(const methodHandle& m, TRAPS);
  

*** 373,8 ***
--- 379,12 ---
    // Return desired initial compilation level for Xcomp
    static CompLevel initial_compile_level(const methodHandle& method);
    // Return highest level possible
    static CompLevel highest_compile_level();
    static void dump();
+ 
+   static void sample_load_average();
+   static bool have_recompilation_work();
+   static bool recompilation_step(int step, TRAPS);
  };
  
  #endif // SHARE_COMPILER_COMPILATIONPOLICY_HPP
< prev index next >