equal
deleted
inserted
replaced
34 // The CompilationPolicy selects which method (if any) should be compiled. |
34 // The CompilationPolicy selects which method (if any) should be compiled. |
35 // It also decides which methods must always be compiled (i.e., are never |
35 // It also decides which methods must always be compiled (i.e., are never |
36 // interpreted). |
36 // interpreted). |
37 class CompileTask; |
37 class CompileTask; |
38 class CompileQueue; |
38 class CompileQueue; |
39 class RFrame; |
|
40 |
39 |
41 class CompilationPolicy : public CHeapObj<mtCompiler> { |
40 class CompilationPolicy : public CHeapObj<mtCompiler> { |
42 static CompilationPolicy* _policy; |
41 static CompilationPolicy* _policy; |
43 |
42 |
44 // m must be compiled before executing it |
43 // m must be compiled before executing it |
114 public: |
113 public: |
115 virtual void method_invocation_event(const methodHandle& m, JavaThread* thread); |
114 virtual void method_invocation_event(const methodHandle& m, JavaThread* thread); |
116 virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread); |
115 virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread); |
117 }; |
116 }; |
118 |
117 |
119 // StackWalkCompPolicy - existing C2 policy |
|
120 |
|
121 #ifdef COMPILER2 |
|
122 class StackWalkCompPolicy : public NonTieredCompPolicy { |
|
123 public: |
|
124 virtual void method_invocation_event(const methodHandle& m, JavaThread* thread); |
|
125 virtual void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread); |
|
126 |
|
127 private: |
|
128 RFrame* findTopInlinableFrame(GrowableArray<RFrame*>* stack); |
|
129 RFrame* senderOf(RFrame* rf, GrowableArray<RFrame*>* stack); |
|
130 |
|
131 // the following variables hold values computed by the last inlining decision |
|
132 // they are used for performance debugging only (print better messages) |
|
133 static const char* _msg; // reason for not inlining |
|
134 |
|
135 static const char* shouldInline (const methodHandle& callee, float frequency, int cnt); |
|
136 // positive filter: should send be inlined? returns NULL (--> yes) or rejection msg |
|
137 static const char* shouldNotInline(const methodHandle& callee); |
|
138 // negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg |
|
139 |
|
140 }; |
|
141 #endif |
|
142 |
|
143 #endif // SHARE_RUNTIME_COMPILATIONPOLICY_HPP |
118 #endif // SHARE_RUNTIME_COMPILATIONPOLICY_HPP |