41 static CompilationPolicy* _policy; 42 // Accumulated time 43 static elapsedTimer _accumulated_time; 44 45 static bool _in_vm_startup; 46 public: 47 static void set_in_vm_startup(bool in_vm_startup) { _in_vm_startup = in_vm_startup; } 48 static void completed_vm_startup(); 49 static bool delay_compilation_during_startup() { return _in_vm_startup; } 50 51 // m must be compiled before executing it 52 static bool must_be_compiled(methodHandle m, int comp_level = CompLevel_all); 53 // m is allowed to be compiled 54 static bool can_be_compiled(methodHandle m, int comp_level = CompLevel_all); 55 // m is allowed to be osr compiled 56 static bool can_be_osr_compiled(methodHandle m, int comp_level = CompLevel_all); 57 static bool is_compilation_enabled(); 58 static void set_policy(CompilationPolicy* policy) { _policy = policy; } 59 static CompilationPolicy* policy() { return _policy; } 60 61 // Profiling 62 elapsedTimer* accumulated_time() { return &_accumulated_time; } 63 void print_time() PRODUCT_RETURN; 64 // Return initial compile level that is used with Xcomp 65 virtual CompLevel initial_compile_level() = 0; 66 virtual int compiler_count(CompLevel comp_level) = 0; 67 // main notification entry, return a pointer to an nmethod if the OSR is required, 68 // returns NULL otherwise. 69 virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) = 0; 70 // safepoint() is called at the end of the safepoint 71 virtual void do_safepoint_work() = 0; 72 // reprofile request 73 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0; 74 // delay_compilation(method) can be called by any component of the runtime to notify the policy 75 // that it's recommended to delay the compilation of this method. 76 virtual void delay_compilation(Method* method) = 0; 77 // disable_compilation() is called whenever the runtime decides to disable compilation of the 78 // specified method. 79 virtual void disable_compilation(Method* method) = 0; 80 // Select task is called by CompileBroker. The queue is guaranteed to have at least one | 41 static CompilationPolicy* _policy; 42 // Accumulated time 43 static elapsedTimer _accumulated_time; 44 45 static bool _in_vm_startup; 46 public: 47 static void set_in_vm_startup(bool in_vm_startup) { _in_vm_startup = in_vm_startup; } 48 static void completed_vm_startup(); 49 static bool delay_compilation_during_startup() { return _in_vm_startup; } 50 51 // m must be compiled before executing it 52 static bool must_be_compiled(methodHandle m, int comp_level = CompLevel_all); 53 // m is allowed to be compiled 54 static bool can_be_compiled(methodHandle m, int comp_level = CompLevel_all); 55 // m is allowed to be osr compiled 56 static bool can_be_osr_compiled(methodHandle m, int comp_level = CompLevel_all); 57 static bool is_compilation_enabled(); 58 static void set_policy(CompilationPolicy* policy) { _policy = policy; } 59 static CompilationPolicy* policy() { return _policy; } 60 61 static CompileTask* select_task_helper(CompileQueue* compile_queue); 62 63 // Profiling 64 elapsedTimer* accumulated_time() { return &_accumulated_time; } 65 void print_time() PRODUCT_RETURN; 66 // Return initial compile level that is used with Xcomp 67 virtual CompLevel initial_compile_level() = 0; 68 virtual int compiler_count(CompLevel comp_level) = 0; 69 // main notification entry, return a pointer to an nmethod if the OSR is required, 70 // returns NULL otherwise. 71 virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) = 0; 72 // safepoint() is called at the end of the safepoint 73 virtual void do_safepoint_work() = 0; 74 // reprofile request 75 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0; 76 // delay_compilation(method) can be called by any component of the runtime to notify the policy 77 // that it's recommended to delay the compilation of this method. 78 virtual void delay_compilation(Method* method) = 0; 79 // disable_compilation() is called whenever the runtime decides to disable compilation of the 80 // specified method. 81 virtual void disable_compilation(Method* method) = 0; 82 // Select task is called by CompileBroker. The queue is guaranteed to have at least one |