/*
* 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 "compiler/compileBroker.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/arguments.hpp"
#include "runtime/simpleThresholdPolicy.hpp"
#include "runtime/simpleThresholdPolicy.inline.hpp"
#include "code/scopeDesc.hpp"
}
}
// Print an event.
switch(type) {
case CALL:
break;
case LOOP:
break;
case COMPILE:
break;
case REMOVE_FROM_QUEUE:
break;
case UPDATE_IN_QUEUE:
break;
case REPROFILE:
break;
case MAKE_NOT_ENTRANT:
break;
default:
}
if (inlinee_event) {
}
if (inlinee_event) {
}
bool need_comma = false;
need_comma = true;
}
need_comma = true;
}
need_comma = true;
}
}
if (mh->queued_for_compilation()) {
}
}
if (FLAG_IS_DEFAULT(CICompilerCount)) {
}
if (CICompilerCountPerCPU) {
}
}
}
}
// Set carry flags on the counters if necessary
}
}
// Called with the queue locked and with at least one element
return compile_queue->first();
}
if (PrintTieredEvents) {
}
}
}
}
if (comp_level == CompLevel_none &&
thread->is_interp_only_mode()) {
return NULL;
}
}
if (PrintTieredEvents) {
}
if (bci == InvocationEntryBci) {
} else {
// method == inlinee if the event originated in the main method
if (highest_level > comp_level) {
}
}
return osr_nm;
}
// Check if the method can be compiled, change level if necessary
void SimpleThresholdPolicy::compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {
if (level == CompLevel_none) {
return;
}
// Check if the method can be compiled. If it cannot be compiled with C1, continue profiling
// in the interpreter and then compile with C2 (the transition function will request that,
// see common() ). If the method cannot be compiled with C2 but still can with C1, compile it with
// pure C1.
}
return;
}
return;
}
if (PrintTieredEvents) {
}
}
}
// Tell the broker to compile the method
void SimpleThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {
}
// Call and loop predicates determine whether a transition to a higher
// compilation level should be performed (pointers to predicate functions
// are passed to common() transition function).
switch(cur_level) {
case CompLevel_none:
case CompLevel_limited_profile: {
}
case CompLevel_full_profile: {
}
default:
return true;
}
}
switch(cur_level) {
case CompLevel_none:
case CompLevel_limited_profile: {
}
case CompLevel_full_profile: {
}
default:
return true;
}
}
// Determine is a method is mature.
if (is_trivial(method)) return true;
int i = mdo->invocation_count();
int b = mdo->backedge_count();
double k = ProfileMaturityPercentage / 100.0;
return call_predicate_helper<CompLevel_full_profile>(i, b, k) ||
loop_predicate_helper<CompLevel_full_profile>(i, b, k);
}
return false;
}
// Common transition function. Given a predicate determines if a method should transition to another level.
int i = method->invocation_count();
int b = method->backedge_count();
if (is_trivial(method)) {
} else {
switch(cur_level) {
case CompLevel_none:
// If we were at full profile level, would we switch to full opt?
} else if ((this->*p)(i, b, cur_level)) {
}
break;
case CompLevel_full_profile:
{
if (mdo->would_profile()) {
}
} else {
}
}
}
break;
}
}
}
// Determine if a method should be compiled with a normal entry point at a different level.
// If OSR method level is greater than the regular method level, the levels should be
// equalized by raising the regular method level in order to avoid OSRs during each
// invocation of the method.
}
} else {
}
return next_level;
}
// Determine if we should do an OSR compilation of a given method.
if (cur_level == CompLevel_none) {
// If there is a live OSR method that means that we deopted to the interpreter
// for the transition.
if (osr_level > CompLevel_none) {
return osr_level;
}
}
return next_level;
}
// Handle the invocation event.
if (next_level != level) {
}
}
}
// Handle the back branch event. Notice that we can compile the method
// with a regular entry from here.
// If the method is already compiling, quickly bail out.
// Use loop event as an opportinity to also check there's been
// enough calls.
bool is_compiling = false;
if (next_level != cur_level) {
is_compiling = true;
}
// Do the OSR version
}
}
}