< prev index next > src/hotspot/share/compiler/compilationPolicy.hpp
Print this page
bool is_empty_unlocked() const { return _head == nullptr; }
T* pop(Monitor* lock, TRAPS) {
MonitorLocker locker(THREAD, lock);
while(is_empty_unlocked() && !CompileBroker::is_compilation_disabled_forever()) {
+ locker.notify_all(); // notify that queue is empty
locker.wait();
}
T* value = pop_unlocked();
return value;
}
*/
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;
+ static int _c1_count, _c2_count, _c3_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);
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);
// 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_c3_count(int x) { _c3_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(EventType type, Method* m, Method* im, int bci, CompLevel level);
// Check if the method can be compiled, change level if necessary
static void compile(const methodHandle& mh, int bci, CompLevel level, TRAPS);
static int64_t start_time() { return _start_time; }
// m must be compiled before executing it
static bool must_be_compiled(const methodHandle& m, int comp_level = CompLevel_any);
static void maybe_compile_early(const methodHandle& m, TRAPS);
+ static void maybe_compile_early_after_init(const methodHandle& m, TRAPS);
static void replay_training_at_init_impl(InstanceKlass* klass, TRAPS);
public:
static int min_invocations() { return Tier4MinInvocationThreshold; }
static int c1_count() { return _c1_count; }
static int c2_count() { return _c2_count; }
+ static int c3_count() { return _c3_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);
+ static void flush_replay_training_at_init(TRAPS);
static void replay_training_at_init(InstanceKlass* klass, TRAPS);
static void replay_training_at_init_loop(TRAPS);
// m is allowed to be compiled
static bool can_be_compiled(const methodHandle& m, int comp_level = CompLevel_any);
// 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 >