src/share/vm/runtime/compilationPolicy.hpp

changeset 2988
2c359f27615c
parent 2314
f95d63e2154a
child 3035
43f9d800f276
equal deleted inserted replaced
2987:6f6e91603a45 2988:2c359f27615c
60 elapsedTimer* accumulated_time() { return &_accumulated_time; } 60 elapsedTimer* accumulated_time() { return &_accumulated_time; }
61 void print_time() PRODUCT_RETURN; 61 void print_time() PRODUCT_RETURN;
62 virtual int compiler_count(CompLevel comp_level) = 0; 62 virtual int compiler_count(CompLevel comp_level) = 0;
63 // main notification entry, return a pointer to an nmethod if the OSR is required, 63 // main notification entry, return a pointer to an nmethod if the OSR is required,
64 // returns NULL otherwise. 64 // returns NULL otherwise.
65 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, TRAPS) = 0; 65 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS) = 0;
66 // safepoint() is called at the end of the safepoint 66 // safepoint() is called at the end of the safepoint
67 virtual void do_safepoint_work() = 0; 67 virtual void do_safepoint_work() = 0;
68 // reprofile request 68 // reprofile request
69 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0; 69 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0;
70 // delay_compilation(method) can be called by any component of the runtime to notify the policy 70 // delay_compilation(method) can be called by any component of the runtime to notify the policy
78 virtual CompileTask* select_task(CompileQueue* compile_queue) = 0; 78 virtual CompileTask* select_task(CompileQueue* compile_queue) = 0;
79 // Tell the runtime if we think a given method is adequately profiled. 79 // Tell the runtime if we think a given method is adequately profiled.
80 virtual bool is_mature(methodOop method) = 0; 80 virtual bool is_mature(methodOop method) = 0;
81 // Do policy initialization 81 // Do policy initialization
82 virtual void initialize() = 0; 82 virtual void initialize() = 0;
83 virtual bool should_not_inline(ciEnv* env, ciMethod* method) { return false; }
83 }; 84 };
84 85
85 // A base class for baseline policies. 86 // A base class for baseline policies.
86 class NonTieredCompPolicy : public CompilationPolicy { 87 class NonTieredCompPolicy : public CompilationPolicy {
87 int _compiler_count; 88 int _compiler_count;
99 virtual void delay_compilation(methodOop method); 100 virtual void delay_compilation(methodOop method);
100 virtual void disable_compilation(methodOop method); 101 virtual void disable_compilation(methodOop method);
101 virtual bool is_mature(methodOop method); 102 virtual bool is_mature(methodOop method);
102 virtual void initialize(); 103 virtual void initialize();
103 virtual CompileTask* select_task(CompileQueue* compile_queue); 104 virtual CompileTask* select_task(CompileQueue* compile_queue);
104 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, TRAPS); 105 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS);
105 virtual void method_invocation_event(methodHandle m, TRAPS) = 0; 106 virtual void method_invocation_event(methodHandle m, TRAPS) = 0;
106 virtual void method_back_branch_event(methodHandle m, int bci, TRAPS) = 0; 107 virtual void method_back_branch_event(methodHandle m, int bci, TRAPS) = 0;
107 }; 108 };
108 109
109 class SimpleCompPolicy : public NonTieredCompPolicy { 110 class SimpleCompPolicy : public NonTieredCompPolicy {

mercurial