62 // Return initial compile level that is used with Xcomp |
62 // Return initial compile level that is used with Xcomp |
63 virtual CompLevel initial_compile_level() = 0; |
63 virtual CompLevel initial_compile_level() = 0; |
64 virtual int compiler_count(CompLevel comp_level) = 0; |
64 virtual int compiler_count(CompLevel comp_level) = 0; |
65 // main notification entry, return a pointer to an nmethod if the OSR is required, |
65 // main notification entry, return a pointer to an nmethod if the OSR is required, |
66 // returns NULL otherwise. |
66 // returns NULL otherwise. |
67 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS) = 0; |
67 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) = 0; |
68 // safepoint() is called at the end of the safepoint |
68 // safepoint() is called at the end of the safepoint |
69 virtual void do_safepoint_work() = 0; |
69 virtual void do_safepoint_work() = 0; |
70 // reprofile request |
70 // reprofile request |
71 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0; |
71 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr) = 0; |
72 // delay_compilation(method) can be called by any component of the runtime to notify the policy |
72 // delay_compilation(method) can be called by any component of the runtime to notify the policy |
103 virtual void delay_compilation(methodOop method); |
103 virtual void delay_compilation(methodOop method); |
104 virtual void disable_compilation(methodOop method); |
104 virtual void disable_compilation(methodOop method); |
105 virtual bool is_mature(methodOop method); |
105 virtual bool is_mature(methodOop method); |
106 virtual void initialize(); |
106 virtual void initialize(); |
107 virtual CompileTask* select_task(CompileQueue* compile_queue); |
107 virtual CompileTask* select_task(CompileQueue* compile_queue); |
108 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, TRAPS); |
108 virtual nmethod* event(methodHandle method, methodHandle inlinee, int branch_bci, int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread); |
109 virtual void method_invocation_event(methodHandle m, TRAPS) = 0; |
109 virtual void method_invocation_event(methodHandle m, JavaThread* thread) = 0; |
110 virtual void method_back_branch_event(methodHandle m, int bci, TRAPS) = 0; |
110 virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread) = 0; |
111 }; |
111 }; |
112 |
112 |
113 class SimpleCompPolicy : public NonTieredCompPolicy { |
113 class SimpleCompPolicy : public NonTieredCompPolicy { |
114 public: |
114 public: |
115 virtual void method_invocation_event(methodHandle m, TRAPS); |
115 virtual void method_invocation_event(methodHandle m, JavaThread* thread); |
116 virtual void method_back_branch_event(methodHandle m, int bci, TRAPS); |
116 virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread); |
117 }; |
117 }; |
118 |
118 |
119 // StackWalkCompPolicy - existing C2 policy |
119 // StackWalkCompPolicy - existing C2 policy |
120 |
120 |
121 #ifdef COMPILER2 |
121 #ifdef COMPILER2 |
122 class StackWalkCompPolicy : public NonTieredCompPolicy { |
122 class StackWalkCompPolicy : public NonTieredCompPolicy { |
123 public: |
123 public: |
124 virtual void method_invocation_event(methodHandle m, TRAPS); |
124 virtual void method_invocation_event(methodHandle m, JavaThread* thread); |
125 virtual void method_back_branch_event(methodHandle m, int bci, TRAPS); |
125 virtual void method_back_branch_event(methodHandle m, int bci, JavaThread* thread); |
126 |
126 |
127 private: |
127 private: |
128 RFrame* findTopInlinableFrame(GrowableArray<RFrame*>* stack); |
128 RFrame* findTopInlinableFrame(GrowableArray<RFrame*>* stack); |
129 RFrame* senderOf(RFrame* rf, GrowableArray<RFrame*>* stack); |
129 RFrame* senderOf(RFrame* rf, GrowableArray<RFrame*>* stack); |
130 |
130 |