/*
* 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 "code/nmethod.hpp"
#include "oops/methodDataOop.hpp"
#include "runtime/compilationPolicy.hpp"
#include "utilities/globalDefinitions.hpp"
class CompileTask;
class CompileQueue;
// Check if the counter is big enough and set carry (effectively infinity).
// Set carry flags in the counters (in methodOop and MDO).
// Call and loop predicates determine whether a transition to a higher compilation
// level should be performed (pointers to predicate functions are passed to common_TF().
// Predicates also take compiler load into account.
// Common transition function. Given a predicate determines if a method should transition to another level.
// Transition functions.
// call_event determines if a method should be compiled at a different
// level with a regular invocation entry.
// loop_event checks if a method should be OSR compiled at a different
// level.
protected:
enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT };
// Print policy-specific information if necessary
virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { }
// Check if the method can be compiled, change level if necessary
// Submit a given method for compilation
// Simple methods are as good being compiled with C1 as C2.
// This function tells if it's such a function.
// Predicate helpers are used by .*_predicate() methods as well as others.
// They check the given counter values, multiplied by the scale against the thresholds.
// Get a compilation level for a given method.
}
return CompLevel_none;
}
public:
return 0;
}
virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
virtual void do_safepoint_work() { }
// Select task is called by CompileBroker. We should return a task or NULL.
// Tell the runtime if we think a given method is adequately profiled.
// Initialize: set compiler thread count
virtual void initialize();
}
};
#endif // SHARE_VM_RUNTIME_SIMPLETHRESHOLDPOLICY_HPP