author | coleenp |
Fri, 16 Mar 2018 09:12:13 -0400 | |
changeset 49449 | ef5d5d343e2a |
parent 47216 | 71c04702a3d5 |
child 49480 | d7df2dd501ce |
permissions | -rw-r--r-- |
6453 | 1 |
/* |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
42650
diff
changeset
|
2 |
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. |
6453 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "compiler/compileBroker.hpp" |
|
49449
ef5d5d343e2a
8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents:
47216
diff
changeset
|
27 |
#include "gc/shared/gcLocker.hpp" |
7397 | 28 |
#include "memory/resourceArea.hpp" |
29 |
#include "runtime/arguments.hpp" |
|
30 |
#include "runtime/simpleThresholdPolicy.hpp" |
|
31 |
#include "runtime/simpleThresholdPolicy.inline.hpp" |
|
8322 | 32 |
#include "code/scopeDesc.hpp" |
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
33 |
#if INCLUDE_JVMCI |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
34 |
#include "jvmci/jvmciRuntime.hpp" |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
35 |
#endif |
6453 | 36 |
|
42650 | 37 |
#ifdef TIERED |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
38 |
|
46727
6e4a84748e2c
8183039: Re-examine methodHandle methods uninlined by 8144256
coleenp
parents:
46630
diff
changeset
|
39 |
void SimpleThresholdPolicy::print_counters(const char* prefix, const methodHandle& mh) { |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
40 |
int invocation_count = mh->invocation_count(); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
41 |
int backedge_count = mh->backedge_count(); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
42 |
MethodData* mdh = mh->method_data(); |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
43 |
int mdo_invocations = 0, mdo_backedges = 0; |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
44 |
int mdo_invocations_start = 0, mdo_backedges_start = 0; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
45 |
if (mdh != NULL) { |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
46 |
mdo_invocations = mdh->invocation_count(); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
47 |
mdo_backedges = mdh->backedge_count(); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
48 |
mdo_invocations_start = mdh->invocation_count_start(); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
49 |
mdo_backedges_start = mdh->backedge_count_start(); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
50 |
} |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
51 |
tty->print(" %stotal=%d,%d %smdo=%d(%d),%d(%d)", prefix, |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
52 |
invocation_count, backedge_count, prefix, |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
53 |
mdo_invocations, mdo_invocations_start, |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
54 |
mdo_backedges, mdo_backedges_start); |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
55 |
tty->print(" %smax levels=%d,%d", prefix, |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
56 |
mh->highest_comp_level(), mh->highest_osr_comp_level()); |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
57 |
} |
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
58 |
|
6453 | 59 |
// Print an event. |
46727
6e4a84748e2c
8183039: Re-examine methodHandle methods uninlined by 8144256
coleenp
parents:
46630
diff
changeset
|
60 |
void SimpleThresholdPolicy::print_event(EventType type, const methodHandle& mh, const methodHandle& imh, |
6453 | 61 |
int bci, CompLevel level) { |
62 |
bool inlinee_event = mh() != imh(); |
|
63 |
||
64 |
ttyLocker tty_lock; |
|
65 |
tty->print("%lf: [", os::elapsedTime()); |
|
66 |
||
67 |
switch(type) { |
|
68 |
case CALL: |
|
69 |
tty->print("call"); |
|
70 |
break; |
|
71 |
case LOOP: |
|
72 |
tty->print("loop"); |
|
73 |
break; |
|
74 |
case COMPILE: |
|
75 |
tty->print("compile"); |
|
8322 | 76 |
break; |
10014
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
77 |
case REMOVE_FROM_QUEUE: |
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
78 |
tty->print("remove-from-queue"); |
8322 | 79 |
break; |
10014
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
80 |
case UPDATE_IN_QUEUE: |
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
81 |
tty->print("update-in-queue"); |
8322 | 82 |
break; |
83 |
case REPROFILE: |
|
84 |
tty->print("reprofile"); |
|
85 |
break; |
|
10014
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
86 |
case MAKE_NOT_ENTRANT: |
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
87 |
tty->print("make-not-entrant"); |
a5c2141ee857
7057120: Tiered: Allow C1 to inline methods with loops
iveresov
parents:
10013
diff
changeset
|
88 |
break; |
8322 | 89 |
default: |
90 |
tty->print("unknown"); |
|
6453 | 91 |
} |
92 |
||
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
93 |
tty->print(" level=%d ", level); |
6453 | 94 |
|
95 |
ResourceMark rm; |
|
96 |
char *method_name = mh->name_and_sig_as_C_string(); |
|
97 |
tty->print("[%s", method_name); |
|
98 |
if (inlinee_event) { |
|
99 |
char *inlinee_name = imh->name_and_sig_as_C_string(); |
|
100 |
tty->print(" [%s]] ", inlinee_name); |
|
101 |
} |
|
102 |
else tty->print("] "); |
|
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
103 |
tty->print("@%d queues=%d,%d", bci, CompileBroker::queue_size(CompLevel_full_profile), |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
104 |
CompileBroker::queue_size(CompLevel_full_optimization)); |
6453 | 105 |
|
106 |
print_specific(type, mh, imh, bci, level); |
|
107 |
||
108 |
if (type != COMPILE) { |
|
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
109 |
print_counters("", mh); |
6453 | 110 |
if (inlinee_event) { |
11192
ff37c2093a0d
7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks
iveresov
parents:
10250
diff
changeset
|
111 |
print_counters("inlinee ", imh); |
6453 | 112 |
} |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
113 |
tty->print(" compilable="); |
6453 | 114 |
bool need_comma = false; |
115 |
if (!mh->is_not_compilable(CompLevel_full_profile)) { |
|
116 |
tty->print("c1"); |
|
117 |
need_comma = true; |
|
118 |
} |
|
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
119 |
if (!mh->is_not_osr_compilable(CompLevel_full_profile)) { |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
120 |
if (need_comma) tty->print(","); |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
121 |
tty->print("c1-osr"); |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
122 |
need_comma = true; |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
123 |
} |
6453 | 124 |
if (!mh->is_not_compilable(CompLevel_full_optimization)) { |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
125 |
if (need_comma) tty->print(","); |
6453 | 126 |
tty->print("c2"); |
127 |
need_comma = true; |
|
128 |
} |
|
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
129 |
if (!mh->is_not_osr_compilable(CompLevel_full_optimization)) { |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
130 |
if (need_comma) tty->print(","); |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
131 |
tty->print("c2-osr"); |
6453 | 132 |
} |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
133 |
tty->print(" status="); |
6453 | 134 |
if (mh->queued_for_compilation()) { |
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
135 |
tty->print("in-queue"); |
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
136 |
} else tty->print("idle"); |
6453 | 137 |
} |
138 |
tty->print_cr("]"); |
|
139 |
} |
|
140 |
||
141 |
void SimpleThresholdPolicy::initialize() { |
|
142 |
if (FLAG_IS_DEFAULT(CICompilerCount)) { |
|
143 |
FLAG_SET_DEFAULT(CICompilerCount, 3); |
|
144 |
} |
|
145 |
int count = CICompilerCount; |
|
36556
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
146 |
#ifdef _LP64 |
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
147 |
// On 64-bit systems, scale the number of compiler threads with |
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
148 |
// the number of cores available on the system. Scaling is not |
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
149 |
// performed on 32-bit systems because it can lead to exhaustion |
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
150 |
// of the virtual memory address space available to the JVM. |
6453 | 151 |
if (CICompilerCountPerCPU) { |
40364
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
152 |
count = MAX2(log2_intptr(os::active_processor_count()) * 3 / 2, 2); |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
153 |
FLAG_SET_ERGO(intx, CICompilerCount, count); |
6453 | 154 |
} |
36556
7f092a7ce938
8150839: Adjust the number of compiler threads for 32-bit platforms
zmajo
parents:
35547
diff
changeset
|
155 |
#endif |
40364
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
156 |
if (TieredStopAtLevel < CompLevel_full_optimization) { |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
157 |
// No C2 compiler thread required |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
158 |
set_c1_count(count); |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
159 |
} else { |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
160 |
set_c1_count(MAX2(count / 3, 1)); |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
161 |
set_c2_count(MAX2(count - c1_count(), 1)); |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
162 |
} |
5bf8fa4fddfd
8162881: Effect of -XX:CICompilerCount depends on ordering of other flags
thartmann
parents:
40074
diff
changeset
|
163 |
assert(count == c1_count() + c2_count(), "inconsistent compiler thread count"); |
6453 | 164 |
} |
165 |
||
166 |
void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) { |
|
167 |
if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) { |
|
168 |
counter->set_carry_flag(); |
|
169 |
} |
|
170 |
} |
|
171 |
||
172 |
// Set carry flags on the counters if necessary |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
173 |
void SimpleThresholdPolicy::handle_counter_overflow(Method* method) { |
17000
11bf92e571a2
8010862: The Method counter fields used for profiling can be allocated lazily.
jiangli
parents:
13891
diff
changeset
|
174 |
MethodCounters *mcs = method->method_counters(); |
17130
6853aae617cb
8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL).
jiangli
parents:
17000
diff
changeset
|
175 |
if (mcs != NULL) { |
6853aae617cb
8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL).
jiangli
parents:
17000
diff
changeset
|
176 |
set_carry_if_necessary(mcs->invocation_counter()); |
6853aae617cb
8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL).
jiangli
parents:
17000
diff
changeset
|
177 |
set_carry_if_necessary(mcs->backedge_counter()); |
6853aae617cb
8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL).
jiangli
parents:
17000
diff
changeset
|
178 |
} |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
179 |
MethodData* mdo = method->method_data(); |
6453 | 180 |
if (mdo != NULL) { |
181 |
set_carry_if_necessary(mdo->invocation_counter()); |
|
182 |
set_carry_if_necessary(mdo->backedge_counter()); |
|
183 |
} |
|
184 |
} |
|
185 |
||
186 |
// Called with the queue locked and with at least one element |
|
187 |
CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) { |
|
35547
0ee84aa8e705
8146705: Improve JVMCI support for blocking compilation
dnsimon
parents:
33593
diff
changeset
|
188 |
return select_task_helper(compile_queue); |
6453 | 189 |
} |
190 |
||
8322 | 191 |
void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) { |
192 |
for (ScopeDesc* sd = trap_scope;; sd = sd->sender()) { |
|
193 |
if (PrintTieredEvents) { |
|
194 |
methodHandle mh(sd->method()); |
|
195 |
print_event(REPROFILE, mh, mh, InvocationEntryBci, CompLevel_none); |
|
196 |
} |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
197 |
MethodData* mdo = sd->method()->method_data(); |
8322 | 198 |
if (mdo != NULL) { |
199 |
mdo->reset_start_counters(); |
|
200 |
} |
|
201 |
if (sd->is_top()) break; |
|
202 |
} |
|
203 |
} |
|
204 |
||
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
28650
diff
changeset
|
205 |
nmethod* SimpleThresholdPolicy::event(const methodHandle& method, const methodHandle& inlinee, |
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37281
diff
changeset
|
206 |
int branch_bci, int bci, CompLevel comp_level, CompiledMethod* nm, JavaThread* thread) { |
6453 | 207 |
if (comp_level == CompLevel_none && |
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
208 |
JvmtiExport::can_post_interpreter_events() && |
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
209 |
thread->is_interp_only_mode()) { |
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
210 |
return NULL; |
6453 | 211 |
} |
24324
e18584aa83e2
8041959: Skip replay parsing errors with ReplayIgnoreInitErrors
kvn
parents:
24321
diff
changeset
|
212 |
if (CompileTheWorld || ReplayCompiles) { |
e18584aa83e2
8041959: Skip replay parsing errors with ReplayIgnoreInitErrors
kvn
parents:
24321
diff
changeset
|
213 |
// Don't trigger other compiles in testing mode |
e18584aa83e2
8041959: Skip replay parsing errors with ReplayIgnoreInitErrors
kvn
parents:
24321
diff
changeset
|
214 |
return NULL; |
e18584aa83e2
8041959: Skip replay parsing errors with ReplayIgnoreInitErrors
kvn
parents:
24321
diff
changeset
|
215 |
} |
6453 | 216 |
|
217 |
handle_counter_overflow(method()); |
|
218 |
if (method() != inlinee()) { |
|
219 |
handle_counter_overflow(inlinee()); |
|
220 |
} |
|
221 |
||
222 |
if (PrintTieredEvents) { |
|
223 |
print_event(bci == InvocationEntryBci ? CALL : LOOP, method, inlinee, bci, comp_level); |
|
224 |
} |
|
225 |
||
226 |
if (bci == InvocationEntryBci) { |
|
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
227 |
method_invocation_event(method, inlinee, comp_level, nm, thread); |
6453 | 228 |
} else { |
27447
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
229 |
// method == inlinee if the event originated in the main method |
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
230 |
method_back_branch_event(method, inlinee, bci, comp_level, nm, thread); |
27447
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
231 |
// Check if event led to a higher level OSR compilation |
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
232 |
nmethod* osr_nm = inlinee->lookup_osr_nmethod_for(bci, comp_level, false); |
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
233 |
if (osr_nm != NULL && osr_nm->comp_level() > comp_level) { |
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
234 |
// Perform OSR with new nmethod |
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
235 |
return osr_nm; |
6453 | 236 |
} |
237 |
} |
|
27447
5cd7caca045d
8062169: Multiple OSR compilations issued for same bci
thartmann
parents:
24324
diff
changeset
|
238 |
return NULL; |
6453 | 239 |
} |
240 |
||
241 |
// Check if the method can be compiled, change level if necessary |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
28650
diff
changeset
|
242 |
void SimpleThresholdPolicy::compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) { |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
243 |
assert(level <= TieredStopAtLevel, "Invalid compilation level"); |
6453 | 244 |
if (level == CompLevel_none) { |
245 |
return; |
|
246 |
} |
|
42650 | 247 |
if (level == CompLevel_aot) { |
248 |
if (mh->has_aot_code()) { |
|
249 |
if (PrintTieredEvents) { |
|
250 |
print_event(COMPILE, mh, mh, bci, level); |
|
251 |
} |
|
252 |
MutexLocker ml(Compile_lock); |
|
253 |
NoSafepointVerifier nsv; |
|
254 |
if (mh->has_aot_code() && mh->code() != mh->aot_code()) { |
|
255 |
mh->aot_code()->make_entrant(); |
|
256 |
if (mh->has_compiled_code()) { |
|
257 |
mh->code()->make_not_entrant(); |
|
258 |
} |
|
259 |
Method::set_code(mh, mh->aot_code()); |
|
260 |
} |
|
261 |
} |
|
262 |
return; |
|
263 |
} |
|
37281
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
36556
diff
changeset
|
264 |
|
7389
93110864f81e
7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents:
6453
diff
changeset
|
265 |
// Check if the method can be compiled. If it cannot be compiled with C1, continue profiling |
93110864f81e
7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents:
6453
diff
changeset
|
266 |
// in the interpreter and then compile with C2 (the transition function will request that, |
93110864f81e
7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents:
6453
diff
changeset
|
267 |
// see common() ). If the method cannot be compiled with C2 but still can with C1, compile it with |
93110864f81e
7000349: Tiered reacts incorrectly to C1 compilation failures
iveresov
parents:
6453
diff
changeset
|
268 |
// pure C1. |
6453 | 269 |
if (!can_be_compiled(mh, level)) { |
270 |
if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) { |
|
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
271 |
compile(mh, bci, CompLevel_simple, thread); |
6453 | 272 |
} |
273 |
return; |
|
274 |
} |
|
13891
35dabd293e56
7200001: failed C1 OSR compile doesn't get recompiled with C2
twisti
parents:
13728
diff
changeset
|
275 |
if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) { |
6453 | 276 |
return; |
277 |
} |
|
24321
621f7e09fc0a
8040798: compiler/startup/SmallCodeCacheStartup.java timed out in RT_Baseline
anoll
parents:
24013
diff
changeset
|
278 |
if (!CompileBroker::compilation_is_in_queue(mh)) { |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
279 |
if (PrintTieredEvents) { |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
280 |
print_event(COMPILE, mh, mh, bci, level); |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
281 |
} |
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
282 |
submit_compile(mh, bci, level, thread); |
6453 | 283 |
} |
284 |
} |
|
285 |
||
286 |
// Tell the broker to compile the method |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
28650
diff
changeset
|
287 |
void SimpleThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) { |
6453 | 288 |
int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count(); |
38218 | 289 |
CompileBroker::compile_method(mh, bci, level, mh, hot_count, CompileTask::Reason_Tiered, thread); |
6453 | 290 |
} |
291 |
||
292 |
// Call and loop predicates determine whether a transition to a higher |
|
293 |
// compilation level should be performed (pointers to predicate functions |
|
294 |
// are passed to common() transition function). |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
295 |
bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) { |
6453 | 296 |
switch(cur_level) { |
42650 | 297 |
case CompLevel_aot: { |
298 |
return loop_predicate_helper<CompLevel_aot>(i, b, 1.0, method); |
|
299 |
} |
|
6453 | 300 |
case CompLevel_none: |
301 |
case CompLevel_limited_profile: { |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
302 |
return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method); |
6453 | 303 |
} |
304 |
case CompLevel_full_profile: { |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
305 |
return loop_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method); |
6453 | 306 |
} |
307 |
default: |
|
308 |
return true; |
|
309 |
} |
|
310 |
} |
|
311 |
||
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
312 |
bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) { |
6453 | 313 |
switch(cur_level) { |
42650 | 314 |
case CompLevel_aot: { |
315 |
return call_predicate_helper<CompLevel_aot>(i, b, 1.0, method); |
|
316 |
} |
|
6453 | 317 |
case CompLevel_none: |
318 |
case CompLevel_limited_profile: { |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
319 |
return call_predicate_helper<CompLevel_none>(i, b, 1.0, method); |
6453 | 320 |
} |
321 |
case CompLevel_full_profile: { |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
322 |
return call_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method); |
6453 | 323 |
} |
324 |
default: |
|
325 |
return true; |
|
326 |
} |
|
327 |
} |
|
328 |
||
329 |
// Determine is a method is mature. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
330 |
bool SimpleThresholdPolicy::is_mature(Method* method) { |
6453 | 331 |
if (is_trivial(method)) return true; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
332 |
MethodData* mdo = method->method_data(); |
6453 | 333 |
if (mdo != NULL) { |
334 |
int i = mdo->invocation_count(); |
|
335 |
int b = mdo->backedge_count(); |
|
336 |
double k = ProfileMaturityPercentage / 100.0; |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
337 |
return call_predicate_helper<CompLevel_full_profile>(i, b, k, method) || |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
338 |
loop_predicate_helper<CompLevel_full_profile>(i, b, k, method); |
6453 | 339 |
} |
340 |
return false; |
|
341 |
} |
|
342 |
||
343 |
// Common transition function. Given a predicate determines if a method should transition to another level. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
344 |
CompLevel SimpleThresholdPolicy::common(Predicate p, Method* method, CompLevel cur_level) { |
6453 | 345 |
CompLevel next_level = cur_level; |
346 |
int i = method->invocation_count(); |
|
347 |
int b = method->backedge_count(); |
|
348 |
||
42650 | 349 |
if (is_trivial(method) && cur_level != CompLevel_aot) { |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
350 |
next_level = CompLevel_simple; |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
351 |
} else { |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
352 |
switch(cur_level) { |
42650 | 353 |
case CompLevel_aot: { |
354 |
if ((this->*p)(i, b, cur_level, method)) { |
|
355 |
next_level = CompLevel_full_profile; |
|
356 |
} |
|
357 |
} |
|
358 |
break; |
|
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
359 |
case CompLevel_none: |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
360 |
// If we were at full profile level, would we switch to full opt? |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
361 |
if (common(p, method, CompLevel_full_profile) == CompLevel_full_optimization) { |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
362 |
next_level = CompLevel_full_optimization; |
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
363 |
} else if ((this->*p)(i, b, cur_level, method)) { |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
364 |
next_level = CompLevel_full_profile; |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
365 |
} |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
366 |
break; |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
367 |
case CompLevel_limited_profile: |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
368 |
case CompLevel_full_profile: |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
369 |
{ |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
370 |
MethodData* mdo = method->method_data(); |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
371 |
if (mdo != NULL) { |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
372 |
if (mdo->would_profile()) { |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
373 |
int mdo_i = mdo->invocation_count_delta(); |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
374 |
int mdo_b = mdo->backedge_count_delta(); |
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
27447
diff
changeset
|
375 |
if ((this->*p)(mdo_i, mdo_b, cur_level, method)) { |
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
376 |
next_level = CompLevel_full_optimization; |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
377 |
} |
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
378 |
} else { |
8322 | 379 |
next_level = CompLevel_full_optimization; |
380 |
} |
|
6453 | 381 |
} |
382 |
} |
|
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
383 |
break; |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
42650
diff
changeset
|
384 |
default: |
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
42650
diff
changeset
|
385 |
break; |
6453 | 386 |
} |
387 |
} |
|
10250
0794cd144834
7066339: Tiered: policy should make consistent decisions about osr levels
iveresov
parents:
10014
diff
changeset
|
388 |
return MIN2(next_level, (CompLevel)TieredStopAtLevel); |
6453 | 389 |
} |
390 |
||
391 |
// Determine if a method should be compiled with a normal entry point at a different level. |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
392 |
CompLevel SimpleThresholdPolicy::call_event(Method* method, CompLevel cur_level, JavaThread* thread) { |
10013
714ad59b56cb
7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods
iveresov
parents:
9625
diff
changeset
|
393 |
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(), |
714ad59b56cb
7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods
iveresov
parents:
9625
diff
changeset
|
394 |
common(&SimpleThresholdPolicy::loop_predicate, method, cur_level)); |
6453 | 395 |
CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level); |
396 |
||
397 |
// If OSR method level is greater than the regular method level, the levels should be |
|
398 |
// equalized by raising the regular method level in order to avoid OSRs during each |
|
399 |
// invocation of the method. |
|
400 |
if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11572
diff
changeset
|
401 |
MethodData* mdo = method->method_data(); |
6453 | 402 |
guarantee(mdo != NULL, "MDO should not be NULL"); |
403 |
if (mdo->invocation_count() >= 1) { |
|
404 |
next_level = CompLevel_full_optimization; |
|
405 |
} |
|
406 |
} else { |
|
407 |
next_level = MAX2(osr_level, next_level); |
|
408 |
} |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
409 |
#if INCLUDE_JVMCI |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
410 |
if (UseJVMCICompiler) { |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
411 |
next_level = JVMCIRuntime::adjust_comp_level(method, false, next_level, thread); |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
412 |
} |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
413 |
#endif |
6453 | 414 |
return next_level; |
415 |
} |
|
416 |
||
417 |
// Determine if we should do an OSR compilation of a given method. |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
418 |
CompLevel SimpleThresholdPolicy::loop_event(Method* method, CompLevel cur_level, JavaThread* thread) { |
10013
714ad59b56cb
7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods
iveresov
parents:
9625
diff
changeset
|
419 |
CompLevel next_level = common(&SimpleThresholdPolicy::loop_predicate, method, cur_level); |
6453 | 420 |
if (cur_level == CompLevel_none) { |
421 |
// If there is a live OSR method that means that we deopted to the interpreter |
|
422 |
// for the transition. |
|
10013
714ad59b56cb
7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods
iveresov
parents:
9625
diff
changeset
|
423 |
CompLevel osr_level = MIN2((CompLevel)method->highest_osr_comp_level(), next_level); |
6453 | 424 |
if (osr_level > CompLevel_none) { |
425 |
return osr_level; |
|
426 |
} |
|
427 |
} |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
428 |
#if INCLUDE_JVMCI |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
429 |
if (UseJVMCICompiler) { |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
430 |
next_level = JVMCIRuntime::adjust_comp_level(method, true, next_level, thread); |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
431 |
} |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
432 |
#endif |
10013
714ad59b56cb
7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods
iveresov
parents:
9625
diff
changeset
|
433 |
return next_level; |
6453 | 434 |
} |
435 |
||
436 |
||
437 |
// Handle the invocation event. |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
28650
diff
changeset
|
438 |
void SimpleThresholdPolicy::method_invocation_event(const methodHandle& mh, const methodHandle& imh, |
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37281
diff
changeset
|
439 |
CompLevel level, CompiledMethod* nm, JavaThread* thread) { |
24321
621f7e09fc0a
8040798: compiler/startup/SmallCodeCacheStartup.java timed out in RT_Baseline
anoll
parents:
24013
diff
changeset
|
440 |
if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
441 |
CompLevel next_level = call_event(mh(), level, thread); |
6453 | 442 |
if (next_level != level) { |
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
443 |
compile(mh, InvocationEntryBci, next_level, thread); |
6453 | 444 |
} |
445 |
} |
|
446 |
} |
|
447 |
||
448 |
// Handle the back branch event. Notice that we can compile the method |
|
449 |
// with a regular entry from here. |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
28650
diff
changeset
|
450 |
void SimpleThresholdPolicy::method_back_branch_event(const methodHandle& mh, const methodHandle& imh, |
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37281
diff
changeset
|
451 |
int bci, CompLevel level, CompiledMethod* nm, JavaThread* thread) { |
6453 | 452 |
// If the method is already compiling, quickly bail out. |
24321
621f7e09fc0a
8040798: compiler/startup/SmallCodeCacheStartup.java timed out in RT_Baseline
anoll
parents:
24013
diff
changeset
|
453 |
if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) { |
22551 | 454 |
// Use loop event as an opportunity to also check there's been |
6453 | 455 |
// enough calls. |
456 |
CompLevel cur_level = comp_level(mh()); |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
457 |
CompLevel next_level = call_event(mh(), cur_level, thread); |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
38218
diff
changeset
|
458 |
CompLevel next_osr_level = loop_event(mh(), level, thread); |
6453 | 459 |
|
460 |
next_level = MAX2(next_level, |
|
461 |
next_osr_level < CompLevel_full_optimization ? next_osr_level : cur_level); |
|
462 |
bool is_compiling = false; |
|
463 |
if (next_level != cur_level) { |
|
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
464 |
compile(mh, InvocationEntryBci, next_level, thread); |
6453 | 465 |
is_compiling = true; |
466 |
} |
|
467 |
||
468 |
// Do the OSR version |
|
469 |
if (!is_compiling && next_osr_level != level) { |
|
11572
84afef481892
7131259: compile_method and CompilationPolicy::event shouldn't be declared TRAPS
iveresov
parents:
11192
diff
changeset
|
470 |
compile(mh, bci, next_osr_level, thread); |
6453 | 471 |
} |
472 |
} |
|
473 |
} |
|
42650 | 474 |
|
475 |
#endif |