/*
* 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 "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/compileLog.hpp"
#include "compiler/compilerOracle.hpp"
#include "interpreter/linkResolver.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/methodDataOop.hpp"
#include "oops/methodOop.hpp"
#include "oops/oop.inline.hpp"
#include "prims/nativeLookup.hpp"
#include "runtime/arguments.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/sweeper.hpp"
#include "trace/tracing.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#ifdef COMPILER1
#include "c1/c1_Compiler.hpp"
#endif
#ifdef COMPILER2
#include "opto/c2compiler.hpp"
#endif
#ifdef SHARK
#include "shark/sharkCompiler.hpp"
#endif
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available
#ifndef USDT2
{ \
}
{ \
}
#else /* USDT2 */
{ \
}
{ \
}
#endif /* USDT2 */
#else // ndef DTRACE_ENABLED
#endif // ndef DTRACE_ENABLED
// The installed compiler(s)
// These counters are used for assigning id's to each compilation
// Debugging information
// Performance counters
// Timers and counters for generating statistics
public:
}
// msg.time_stamp().update_to(tty->time_stamp().ticks());
}
}
void log_failure(JavaThread* thread, CompileTask* task, const char* reason, const char* retry_message) {
if (retry_message != NULL) {
}
}
};
void compileBroker_init() {
if (LogEvents) {
_compilation_log = new CompilationLog();
}
}
}
if (task->is_blocking()) {
task->mark_complete();
// Notify the waiting thread that the compilation has completed.
} else {
task->mark_complete();
// By convention, the compiling thread is responsible for
// recycling a non-blocking CompileTask.
}
}
// ------------------------------------------------------------------
// CompileTask::initialize
int osr_bci,
int comp_level,
int hot_count,
const char* comment,
bool is_blocking) {
_is_complete = false;
_is_success = false;
_code_handle = NULL;
_hot_method = NULL;
_time_queued = 0; // tidy
if (LogCompilation) {
if (hot_method.not_null()) {
if (hot_method == method) {
} else {
}
}
}
}
// ------------------------------------------------------------------
return _code_handle->code();
}
}
// ------------------------------------------------------------------
// CompileTask::free
}
}
// ------------------------------------------------------------------
// CompileTask::print
}
// ------------------------------------------------------------------
// CompileTask::print_line_on_error
//
// This function is called by fatal error handler when the thread
// causing troubles is a compiler thread.
//
// Do not grab any lock, do not allocate memory.
//
// Otherwise it's the same as CompileTask::print_line()
//
// print compiler name
}
// ------------------------------------------------------------------
// CompileTask::print_line
// print compiler name if requested
}
// ------------------------------------------------------------------
// CompileTask::print_compilation_impl
void CompileTask::print_compilation_impl(outputStream* st, methodOop method, int compile_id, int comp_level,
const char* msg, bool short_form) {
if (!short_form) {
}
// For unloaded methods the transition to zombie occurs after the
// method is cleared so it's impossible to report accurate
// information for that case.
bool is_synchronized = false;
bool has_exception_handler = false;
bool is_native = false;
}
// method attributes
// print method attributes
if (TieredCompilation) {
}
} else {
if (is_osr_method) {
}
else
}
}
if (!short_form) {
}
}
// ------------------------------------------------------------------
// CompileTask::print_inlining
void CompileTask::print_inlining(outputStream* st, ciMethod* method, int inline_level, int bci, const char* msg) {
// 1234567
// 1234
// method attributes
// print method attributes
} else {
// %s!bn
}
if (TieredCompilation) {
}
else
}
}
// ------------------------------------------------------------------
// CompileTask::print_inline_indent
// 1234567
// 1234
// %s!bn
if (TieredCompilation) {
}
}
// ------------------------------------------------------------------
// CompileTask::print_compilation
print_compilation_impl(st, method, compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), msg, short_form);
}
// ------------------------------------------------------------------
// CompileTask::log_task
// <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'>
} // else compile_kind='c2c'
}
if (_comp_level != CompLevel_highest_tier) {
}
if (_is_blocking) {
}
}
// ------------------------------------------------------------------
// CompileTask::log_task_queued
}
if (_hot_method != NULL) {
}
}
if (_hot_count != 0) {
}
}
// ------------------------------------------------------------------
// CompileTask::log_task_start
}
// ------------------------------------------------------------------
// CompileTask::log_task_done
// <task_done ... stamp='1.234'> </task>
method->invocation_count());
// Note: "_is_complete" is about to be set, but is not.
if (_num_inlined_bytecodes != 0) {
}
}
log->mark_file_end();
}
// ------------------------------------------------------------------
// CompileQueue::add
//
// Add a CompileTask to a CompileQueue
// The compile queue is empty.
} else {
// Append the task to the queue.
}
++_size;
// Mark the method as being in the compile queue.
if (CIPrintCompileQueue) {
print();
}
task->log_task_queued();
}
// Notify CompilerThreads that a task is available.
lock()->notify_all();
}
// ------------------------------------------------------------------
// CompileQueue::get
//
// Get the next CompileTask from a CompileQueue
// Wait for an available CompileTask.
// There is no work to be done right now. Wait.
if (UseCodeCacheFlushing && (!CompileBroker::should_compile_new_jobs() || CodeCache::needs_flushing())) {
// During the emergency sweeping periods, wake up and sweep occasionally
if (timedout) {
// When otherwise not busy, run nmethod sweeping
}
} else {
// During normal operation no need to wake up on timer
}
}
return task;
}
{
} else {
// max is the first element
}
} else {
// max is the last element
}
--_size;
}
// ------------------------------------------------------------------
// CompileQueue::print
task->print_line();
}
}
_current_method[0] = '\0';
if (UsePerfData) {
// create the thread instance name space string - don't create an
// instance subspace if instance is -1 - keeps the adapterThread
// counters from having a ".0" namespace.
CHECK);
}
}
// ------------------------------------------------------------------
// CompileBroker::compilation_init
//
// Initialize the Compilation object
_last_method_compiled[0] = '\0';
#ifndef SHARK
// Set the interface to the current compiler(s).
#ifdef COMPILER1
if (c1_count > 0) {
_compilers[0] = new Compiler();
}
#endif // COMPILER1
#ifdef COMPILER2
if (c2_count > 0) {
}
#endif // COMPILER2
#else // SHARK
int c1_count = 0;
#endif // SHARK
// Initialize the CompileTask free list
// Start the CompilerThreads
// totalTime performance counter is always created as it is required
// by the implementation of java.lang.management.CompilationMBean.
{
}
if (UsePerfData) {
// create the jvmstat performance counters
"", CHECK);
"", CHECK);
"", CHECK);
CHECK);
CHECK);
CHECK);
CHECK);
}
_initialized = true;
}
// ------------------------------------------------------------------
// CompileBroker::make_compiler_thread
CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS) {
klassOop k =
true, CHECK_0);
// Initialize thread_oop to put it into the system threadGroup
CHECK_0);
{
// At this point the new CompilerThread data-races with this startup
// thread (which I believe is the primoridal thread and NOT the VM
// thread). This means Java bytecodes being executed at startup can
// queue compile jobs which will run at whatever default priority the
// newly created CompilerThread runs at.
// At this point it may be possible that no osthread was created for the
// JavaThread due to lack of memory. We would have to throw an exception
// in that case. However, since this must work and we do not allow
// exceptions anyway, check and abort if this fails.
vm_exit_during_initialization("java.lang.OutOfMemoryError",
"unable to create new native thread");
}
// Note that this only sets the JavaThread _priority field, which by
// definition is limited to Java priorities and not OS priorities.
// The os-priority is set in the CompilerThread startup code itself
// Note that we cannot call os::set_priority because it expects Java
// priorities and we are *explicitly* using OS priorities so that it's
// possible to set the compiler thread priority higher than any Java
// thread.
if (native_prio == -1) {
} else {
}
}
}
// Let go of Threads_lock before yielding
return compiler_thread;
}
// ------------------------------------------------------------------
// CompileBroker::init_compiler_threads
//
// Initialize the compilation queue
#endif // !ZERO && !SHARK
if (c2_compiler_count > 0) {
}
if (c1_compiler_count > 0) {
}
for (int i = 0; i < c2_compiler_count; i++) {
// Create a name for our thread.
}
for (int i = c2_compiler_count; i < compiler_count; i++) {
// Create a name for our thread.
}
if (UsePerfData) {
}
}
// ------------------------------------------------------------------
// CompileBroker::is_idle
return false;
return false;
} else {
for (int i=0; i<num_threads; i++) {
return false;
}
}
// No pending or active compilations.
return true;
}
}
// ------------------------------------------------------------------
// CompileBroker::compile_method
//
// Request compilation of a method.
int osr_bci,
int comp_level,
int hot_count,
const char* comment,
// do nothing if compiler thread(s) is not available
if (!_initialized ) {
return;
}
"sanity check");
"method holder must be initialized");
if (CIPrintRequests) {
if (osr_bci != InvocationEntryBci) {
}
if (!hot_method.is_null()) {
if (hot_method() != method()) {
} else {
}
}
}
// A request has been made for compilation. Before we do any
// real work, check to see if the method has been compiled
// in the meantime with a definitive result.
return;
}
#ifndef PRODUCT
// Positive OSROnlyBCI means only compile that bci. Negative means don't compile that BCI.
return;
}
}
#endif
// If this method is already in the compile queue, then
// we do not block the current thread.
// We may want to decay our counter a bit here to prevent
// multiple denied requests for compilation. This is an
// open compilation policy issue. Note: The other possibility,
// in the case that this is a blocking compile request, is to have
// all subsequent blocking requesters wait for completion of
// ongoing compiles. Note that in this case we'll need a protocol
// for freeing the associated compile tasks. [Or we could have
// a single static monitor on which all these waiters sleep.]
return;
}
// If the requesting thread is holding the pending list lock
// then we just return. We can't risk blocking while holding
// the pending list lock or a 3-way deadlock may occur
// between the reference handler thread, a GC (instigated
// by a compiler thread), and compiled method registration.
return;
}
// Outputs from the following MutexLocker block:
bool blocking = false;
// Acquire our lock.
{
// Make sure the method has not slipped into the queues since
// last we checked; note that those checks were "fast bail-outs".
// Here we need to be more careful, see 14012000 below.
return;
}
// We need to check again to see if the compilation has
// completed. A previous compilation may have registered
// some result.
return;
}
// We now know that this compilation is not pending, complete,
// or prohibited. Assign a compile_id to this compilation
// and check to see if it is in our [Start..Stop) range.
if (compile_id == 0) {
// The compilation falls outside the allowed range.
return;
}
// Should this thread wait for completion of the compile?
// We will enter the compilation in the queue.
// 14012000: Note that this sets the queued_for_compile bits in
// the target method. We can now reason that a method cannot be
// queued for compilation more than once, as follows:
// Before a thread queues a task for compilation, it first acquires
// the compile queue lock, then checks if the method's queued bits
// are set or it has already been compiled. Thus there can not be two
// instances of a compilation task for the same method on the
// compilation queue. Consider now the case where the compilation
// thread has already removed a task for that method from the queue
// and is in the midst of compiling it. In this case, the
// queued_for_compile bits must be set in the method (and these
// will be visible to the current thread, since the bits were set
// under protection of the compile queue lock, which we hold now.
// When the compilation completes, the compiler thread first sets
// the compilation result and then clears the queued_for_compile
// bits. Neither of these actions are protected by a barrier (or done
// under the protection of a lock), so the only guarantee we have
// (on machines with TSO (Total Store Order)) is that these values
// will update in that order. As a result, the only combinations of
// these bits that the current thread will see are, in temporal order:
// <RESULT, QUEUE> :
// <0, 1> : in compile queue, but not yet compiled
// <1, 1> : compiled but queue bit not cleared
// <1, 0> : compiled and queue bit cleared
// Because we first check the queue bits then check the result bits,
// we are assured that we cannot introduce a duplicate task.
// Note that if we did the tests in the reverse order (i.e. check
// result then check queued bit), we could get the result bit before
// the compilation completed, and the queue bit after the compilation
// completed, and end up introducing a "duplicate" (redundant) task.
// In that case, the compiler thread should first check if a method
// has already been compiled before trying to compile it.
// NOTE: in the event that there are multiple compiler threads and
// there is de-optimization/recompilation, things will get hairy,
// and in that case it's best to protect both the testing (here) of
// these bits, and their updating (here and elsewhere) under a
// common lock.
blocking);
}
if (blocking) {
}
}
int comp_level,
// make sure arguments make sense
assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
assert(!instanceKlass::cast(method->method_holder())->is_not_initialized(), "method holder must be initialized");
if (!TieredCompilation) {
}
// return quickly if possible
// lock, make sure that the compilation
// isn't prohibited in a straightforward way.
return NULL;
}
if (osr_bci == InvocationEntryBci) {
// standard compilation
if (method_code != NULL) {
return method_code;
}
}
if (UseCodeCacheFlushing) {
return saved;
}
}
} else {
// osr compilation
#ifndef TIERED
// seems like an assert of dubious value
"all OSR compiles are assumed to be at a single compilation lavel");
#endif // TIERED
// We accept a higher level osr method
}
// some prerequisites that are compiler specific
// Resolve all classes seen in the signature of the method
// we are compiling.
}
// If the method is native, do the lookup in the thread requesting
// the compilation. Native lookups can load code, which is not
// permitted during compilation.
//
// Note: A native method implies non-osr compilation which is
// checked with an assertion at the entry of this method.
bool in_base_library;
if (HAS_PENDING_EXCEPTION) {
// In case of an exception looking up the method, we just forget
// about it. The interpreter will kick-in and throw the exception.
return NULL;
}
}
// RedefineClasses() has replaced this method; just return
return NULL;
}
// JVMTI -- post_compile_event requires jmethod_id() that may require
// a lock the compiling thread can not acquire. Prefetch it here.
if (JvmtiExport::should_post_compiled_method_load()) {
method->jmethod_id();
}
// If the compiler is shut off due to code cache flushing or otherwise,
// fail out now so blocking compiles dont hang the java thread
return NULL;
}
// do the compilation
// Acquire our lock.
int compile_id;
{
}
} else {
return NULL;
}
} else {
}
// return requested nmethod
// We accept a higher level osr method
return osr_bci == InvocationEntryBci ? method->code() : method->lookup_osr_nmethod_for(osr_bci, comp_level, false);
}
// ------------------------------------------------------------------
// CompileBroker::compilation_is_complete
//
// See if compilation of this method is already complete.
int osr_bci,
int comp_level) {
if (is_osr) {
return true;
} else {
}
} else {
return true;
} else {
}
}
}
// ------------------------------------------------------------------
// CompileBroker::compilation_is_in_queue
//
// See if this compilation is already requested.
//
// Implementation note: there is only a single "is in queue" bit
// for each method. This means that the check below is overly
// conservative in the sense that an osr compilation in the queue
// will block a normal compilation from entering the queue (and vice
// versa). This can be remedied by a full queue search to disambiguate
// cases. If it is deemed profitible, this may be done.
int osr_bci) {
return method->queued_for_compilation();
}
// ------------------------------------------------------------------
// CompileBroker::compilation_is_prohibited
//
// See if this compilation is not allowed.
// Some compilers may not support the compilation of natives.
if (is_native &&
return true;
}
// Some compilers may not support on stack replacement.
if (is_osr &&
return true;
}
// The method may be explicitly excluded by the user.
bool quietly;
if (!quietly) {
// This does not happen quietly...
}
}
return false;
}
// ------------------------------------------------------------------
// CompileBroker::assign_compile_id
//
// Assign a serialized id number to this compilation request. If the
// number falls out of the allowed range, return a 0. OSR
// compilations may be numbered separately from regular compilations
// if certain debugging flags are used.
"must hold the compilation queue lock");
if (CICountOSR && is_osr) {
id = ++_osr_compilation_id;
return id;
}
} else {
id = ++_compilation_id;
return id;
}
}
// Method was not in the appropriate compilation range.
return 0;
}
// ------------------------------------------------------------------
// CompileBroker::is_compile_blocking
//
// Should the current thread be blocked until this compilation request
// has been fulfilled?
return !BackgroundCompilation;
}
// ------------------------------------------------------------------
// CompileBroker::preload_classes
// Move this code over from c1_Compiler.cpp
}
// ------------------------------------------------------------------
// CompileBroker::create_compile_task
//
// Create a CompileTask object representing the current request for
// compilation. Add this task to the queue.
int compile_id,
int osr_bci,
int comp_level,
int hot_count,
const char* comment,
bool blocking) {
blocking);
return new_task;
}
// ------------------------------------------------------------------
// CompileBroker::allocate_task
//
// Allocate a CompileTask, from the free list if possible.
if (_task_free_list != NULL) {
} else {
task = new CompileTask();
}
return task;
}
// ------------------------------------------------------------------
// CompileBroker::free_task
//
// Add a task to the free list.
}
// ------------------------------------------------------------------
// CompileBroker::wait_for_completion
//
// Wait for the given method CompileTask to complete.
if (CIPrintCompileQueue) {
}
thread->set_blocked_on_compilation(true);
{
while (!task->is_complete())
}
// It is harmless to check this status without the lock, because
// completion is a stable property (until the task object is recycled).
thread->set_blocked_on_compilation(false);
// By convention, the waiter is responsible for recycling a
// blocking CompileTask. Since there is only one waiter ever
// waiting on a CompileTask, we know that no one else will
// be using this CompileTask; we can free it.
}
// ------------------------------------------------------------------
// CompileBroker::compiler_thread_loop
//
// The main loop run by a CompilerThread.
// For the thread that initializes the ciObjectFactory
// this resource mark holds all the shared objects
// First thread to get here will initialize the compiler interface
if (!ciObjectFactory::is_initialized()) {
if (!ciObjectFactory::is_initialized()) {
}
}
// Open a log.
if (LogCompilation) {
}
os::current_thread_id(),
os::current_process_id());
}
while (true) {
{
// We need this HandleMark to avoid leaking VM handles.
// the code cache is really full
// Attempt to start cleaning the code cache while there is still a little headroom
NMethodSweeper::handle_full_code_cache(false);
}
// Give compiler threads an extra quanta. They tend to be bursty and
// this helps the compiler to finish up the job.
os::hint_no_preempt();
// trace per thread time and compile statistics
// Assign the task to the current thread. Mark this compilation
// thread as active for the profiler.
// Never compile a method if breakpoints are present in it
if (method()->number_of_breakpoints() == 0) {
// Compile the method.
#ifdef COMPILER1
// Allow repeating compilations for the purpose of benchmarking
// compile speed. This is not useful for customers.
if (CompilationRepeat != 0) {
while (compile_count > 0) {
nm->make_zombie();
method->clear_code();
}
}
}
#endif /* COMPILER1 */
} else {
// After compilation is disabled, remove remaining methods from queue
}
}
}
}
}
// ------------------------------------------------------------------
// CompileBroker::init_compiler_thread_log
//
// Set up state required by +LogCompilation.
} else {
}
break;
}
}
} else {
if (LogCompilation && Verbose)
// Record any per thread log files
}
}
}
// ------------------------------------------------------------------
// CompileBroker::set_should_block
//
// Set _should_block.
// Call this from the VM, with Threads_lock held and a safepoint requested.
#ifndef PRODUCT
#endif
_should_block = true;
}
// ------------------------------------------------------------------
// CompileBroker::maybe_block
//
// Call this from the compiler at convenient points, to poll for _should_block.
if (_should_block) {
#ifndef PRODUCT
#endif
}
}
// ------------------------------------------------------------------
// CompileBroker::invoke_compiler_on_method
//
// Compile a method.
//
if (PrintCompilation) {
task->print_line();
}
if (LogEvents) {
}
// Common flags.
bool should_break = false;
{
// create the handle inside it's own block so it can't
// accidentally be referenced once the thread transitions to
// native. The NoHandleMark before the transition should catch
// any cases where this occurs in the future.
should_log = false;
}
// Save information about this method in case of failure.
}
// Allocate a new set of JNI handles.
{
{
}
if (should_break) {
ci_env.set_break_at_compile(true);
}
if (should_log) {
}
// The thread-env() field is cleared in ~CompileTaskWrapper.
// Cache Jvmti state
// Cache DTrace flags
//assert(false, "compiler should always document failure");
// The compiler elected, without comment, not to register a result.
// Do not attempt further compilations of this method.
}
// Copy this bit to the enclosing block:
if (_compilation_log != NULL) {
}
if (PrintCompilation) {
}
} else {
task->mark_success();
if (_compilation_log != NULL) {
}
}
}
if (event.should_commit()) {
}
}
if (PrintCompilation && PrintCompilation2) {
tty->print_cr("size: %d time: %d inlined: %d bytes", code_size, (int)time.milliseconds(), task->num_inlined_bytecodes());
}
// Disable compilation, if required.
switch (compilable) {
case ciEnv::MethodCompilable_never:
if (is_osr)
else
break;
if (is_osr)
else
break;
}
// Note that the queued_for_compilation bits are cleared without
// protection of a mutex. [They were set by the requester thread,
// when adding the task to the complie queue -- at which time the
// compile queue lock was held. Subsequently, we acquired the compile
// queue lock to get this task off the compile queue; thus (to belabour
// the point somewhat) our clearing of the bits must be occurring
// only after the setting of the bits. See also 14012000 above.
#ifdef ASSERT
if (CollectedHeap::fired_fake_oom()) {
// The current compile received a fake OOM during compilation so
// go ahead and exit the VM since the test apparently succeeded
vm_exit(0);
}
#endif
}
// ------------------------------------------------------------------
// CompileBroker::handle_full_code_cache
//
// The CodeCache is full. Print out warning and disable compilation or
// try code cache cleaning so compilation can continue later.
UseInterpreter = true;
if (UseCompiler || AlwaysCompileLoopMethods ) {
stringStream s;
// Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts.
// Lock to prevent tearing
}
warning("CodeCache is full. Compiler has been disabled.");
warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
#ifndef PRODUCT
if (CompileTheWorld || ExitOnFullCodeCache) {
exit_globals(); // will delete tty
}
#endif
if (UseCodeCacheFlushing) {
NMethodSweeper::handle_full_code_cache(true);
} else {
UseCompiler = false;
AlwaysCompileLoopMethods = false;
}
}
}
// ------------------------------------------------------------------
// CompileBroker::set_last_compile
//
// Record this compilation for debugging purposes.
void CompileBroker::set_last_compile(CompilerThread* thread, methodHandle method, bool is_osr, int comp_level) {
if (UsePerfData) {
// check if we need to truncate the string
// the strategy is to lop off the leading characters of the
// class name and the trailing characters of the method name.
// lop of the entire class name string, let snprintf handle
// truncation of the method name.
}
else {
// lop off the extra characters from the front of the class name
}
}
}
if (CICountOSR && is_osr) {
} else {
}
if (UsePerfData) {
}
}
// ------------------------------------------------------------------
// CompileBroker::push_jni_handle_block
//
// Push on a new block of JNI handles.
// Allocate a new block for JNI handles.
// Inlined code from jni_PushLocalFrame()
}
// ------------------------------------------------------------------
// CompileBroker::pop_jni_handle_block
//
// Pop off the current block of JNI handles.
// Release our JNI handle block
}
// ------------------------------------------------------------------
// CompileBroker::check_break_at
//
// Should the compilation break at the current compilation.
return true;
return true;
} else {
return (compile_id == CIBreakAt);
}
}
// ------------------------------------------------------------------
// CompileBroker::collect_statistics
//
// Collect statistics about the compilation.
void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task) {
// _perf variables are production performance counters which are
// updated regardless of the setting of the CITime and CITimeEach flags
//
if (!success) {
if (UsePerfData) {
}
if (UsePerfData) {
}
} else {
// Compilation succeeded
// update compilation ticks - used by the implementation of
// java.lang.management.CompilationMBean
_peak_compilation_time = time.milliseconds() > _peak_compilation_time ? time.milliseconds() : _peak_compilation_time;
if (CITime) {
if (is_osr) {
} else {
}
}
if (UsePerfData) {
// save the name of the last method compiled
if (is_osr) {
} else {
}
}
if (CITimeEach) {
}
// Collect counts of successful compilations
if (UsePerfData) {
}
if (is_osr) {
} else {
}
}
// set the current method for the thread to null
}
//0000000000111111111122222222223333333333444444444455555555556666666666
//0123456789012345678901234567890123456789012345678901234567890123456789
tty->print_cr(" On stack replacement : %6.3f s, Average : %2.3f", CompileBroker::_t_osr_compilation.seconds(), CompileBroker::_t_osr_compilation.seconds() / CompileBroker::_total_osr_compile_count);
}
}
}
// Debugging output for failure
if ( _last_compile_level != CompLevel_none &&
_last_method_compiled != NULL &&
_last_compile_type != no_compile) {
if (_last_compile_type == osr_compile) {
} else {
}
}
}
#ifndef PRODUCT
#endif
}