< prev index next >
src/hotspot/share/interpreter/invocationCounter.cpp
Print this page
rev 53568 : 8218031: Zero broken after JDK-8217922 (Compiler dead code removal)
Reviewed-by: thartmann, sgehwolf, shade
Contributed-by: Ao Qi <aoqi@loongson.cn>
@@ -77,10 +77,14 @@
// Initialization
int InvocationCounter::_init [InvocationCounter::number_of_states];
InvocationCounter::Action InvocationCounter::_action[InvocationCounter::number_of_states];
+#ifdef CC_INTERP
+int InvocationCounter::InterpreterInvocationLimit;
+int InvocationCounter::InterpreterBackwardBranchLimit;
+#endif
const char* InvocationCounter::state_as_string(State state) {
switch (state) {
case wait_for_nothing : return "wait_for_nothing";
case wait_for_compile : return "wait_for_compile";
@@ -130,10 +134,26 @@
void InvocationCounter::reinitialize() {
// define states
guarantee((int)number_of_states <= (int)state_limit, "adjust number_of_state_bits");
def(wait_for_nothing, 0, do_nothing);
def(wait_for_compile, 0, do_decay);
+
+#ifdef CC_INTERP
+ InterpreterInvocationLimit = CompileThreshold << number_of_noncount_bits;
+
+ // When methodData is collected, the backward branch limit is compared against a
+ // methodData counter, rather than an InvocationCounter. In the former case, we
+ // don't need the shift by number_of_noncount_bits, but we do need to adjust
+ // the factor by which we scale the threshold.
+ if (ProfileInterpreter) {
+ InterpreterBackwardBranchLimit = (int)((int64_t)CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage) / 100);
+ } else {
+ InterpreterBackwardBranchLimit = (int)(((int64_t)CompileThreshold * OnStackReplacePercentage / 100) << number_of_noncount_bits);
+ }
+
+ assert(0 <= InterpreterBackwardBranchLimit, "OSR threshold should be non-negative");
+#endif
}
void invocationCounter_init() {
InvocationCounter::reinitialize();
}
< prev index next >