/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "interpreter/invocationCounter.hpp"
#include "runtime/handles.inline.hpp"
// Implementation of InvocationCounter
_counter = 0; // reset all the bits, including the sticky carry
reset();
}
// Only reset the state and don't make the method look like it's never
// been executed
}
// The carry bit now indicates that this counter had achieved a very
// large value. Now reduce the value, so that the method can be
// executed many more times before re-entering the VM.
// prevent from going to zero, to distinguish from never-executed methods
}
// prevent from going to zero, to distinguish from never-executed methods
}
state_as_string(state()));
}
}
// Initialization
switch (state) {
case wait_for_nothing : return "wait_for_nothing";
case wait_for_compile : return "wait_for_compile";
}
return NULL;
}
switch (state) {
case wait_for_nothing : return "not comp.";
case wait_for_compile : return "compileable";
}
return NULL;
}
// dummy action for inactive invocation counters
return NULL;
}
// decay invocation counters so compilation gets delayed
return NULL;
}
}
return NULL;
}
// define states
if (delay_overflow) {
} else {
}
InterpreterProfileLimit = ((CompileThreshold * InterpreterProfilePercentage) / 100)<< 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 = (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
} else {
InterpreterBackwardBranchLimit = ((CompileThreshold * OnStackReplacePercentage) / 100) << number_of_noncount_bits;
}
"OSR threshold should be non-negative");
assert(0 <= InterpreterProfileLimit &&
"profile threshold should be less than the compilation threshold "
"and non-negative");
}
void invocationCounter_init() {
}