5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_TIEREDTHRESHOLDPOLICY_HPP
26 #define SHARE_RUNTIME_TIEREDTHRESHOLDPOLICY_HPP
27
28 #include "code/nmethod.hpp"
29 #include "oops/methodData.hpp"
30 #include "runtime/compilationPolicy.hpp"
31 #include "utilities/globalDefinitions.hpp"
32
33 #ifdef TIERED
34
35 class CompileTask;
36 class CompileQueue;
37 /*
38 * The system supports 5 execution levels:
39 * * level 0 - interpreter
40 * * level 1 - C1 with full optimization (no profiling)
41 * * level 2 - C1 with invocation and backedge counters
42 * * level 3 - C1 with full profiling (level 2 + MDO)
43 * * level 4 - C2
44 *
45 * Levels 0, 2 and 3 periodically notify the runtime about the current value of the counters
46 * (invocation counters and backedge counters). The frequency of these notifications is
47 * different at each level. These notifications are used by the policy to decide what transition
48 * to make.
49 *
50 * Execution starts at level 0 (interpreter), then the policy can decide either to compile the
258 return 0;
259 }
260 virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
261 virtual void do_safepoint_work() { }
262 virtual void delay_compilation(Method* method) { }
263 virtual void disable_compilation(Method* method) { }
264 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
265 virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee,
266 int branch_bci, int bci, CompLevel comp_level, CompiledMethod* nm, JavaThread* thread);
267 // Select task is called by CompileBroker. We should return a task or NULL.
268 virtual CompileTask* select_task(CompileQueue* compile_queue);
269 // Tell the runtime if we think a given method is adequately profiled.
270 virtual bool is_mature(Method* method);
271 // Initialize: set compiler thread count
272 virtual void initialize();
273 virtual bool should_not_inline(ciEnv* env, ciMethod* callee);
274 };
275
276 #endif // TIERED
277
278 #endif // SHARE_RUNTIME_TIEREDTHRESHOLDPOLICY_HPP
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_COMPILER_TIEREDTHRESHOLDPOLICY_HPP
26 #define SHARE_COMPILER_TIEREDTHRESHOLDPOLICY_HPP
27
28 #include "code/nmethod.hpp"
29 #include "oops/methodData.hpp"
30 #include "compiler/compilationPolicy.hpp"
31 #include "utilities/globalDefinitions.hpp"
32
33 #ifdef TIERED
34
35 class CompileTask;
36 class CompileQueue;
37 /*
38 * The system supports 5 execution levels:
39 * * level 0 - interpreter
40 * * level 1 - C1 with full optimization (no profiling)
41 * * level 2 - C1 with invocation and backedge counters
42 * * level 3 - C1 with full profiling (level 2 + MDO)
43 * * level 4 - C2
44 *
45 * Levels 0, 2 and 3 periodically notify the runtime about the current value of the counters
46 * (invocation counters and backedge counters). The frequency of these notifications is
47 * different at each level. These notifications are used by the policy to decide what transition
48 * to make.
49 *
50 * Execution starts at level 0 (interpreter), then the policy can decide either to compile the
258 return 0;
259 }
260 virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
261 virtual void do_safepoint_work() { }
262 virtual void delay_compilation(Method* method) { }
263 virtual void disable_compilation(Method* method) { }
264 virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
265 virtual nmethod* event(const methodHandle& method, const methodHandle& inlinee,
266 int branch_bci, int bci, CompLevel comp_level, CompiledMethod* nm, JavaThread* thread);
267 // Select task is called by CompileBroker. We should return a task or NULL.
268 virtual CompileTask* select_task(CompileQueue* compile_queue);
269 // Tell the runtime if we think a given method is adequately profiled.
270 virtual bool is_mature(Method* method);
271 // Initialize: set compiler thread count
272 virtual void initialize();
273 virtual bool should_not_inline(ciEnv* env, ciMethod* callee);
274 };
275
276 #endif // TIERED
277
278 #endif // SHARE_COMPILER_TIEREDTHRESHOLDPOLICY_HPP
|