src/share/vm/compiler/compileBroker.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/compiler/compileBroker.cpp Fri Sep 5 12:58:04 2014
--- new/src/share/vm/compiler/compileBroker.cpp Fri Sep 5 12:58:04 2014
*** 164,174 ****
--- 164,174 ----
void log_compile(JavaThread* thread, CompileTask* task) {
StringLogMessage lm;
stringStream sstr = lm.stream();
// msg.time_stamp().update_to(tty->time_stamp().ticks());
! task->print_compilation(&sstr, NULL, true, false);
log(thread, "%s", (const char*)lm);
}
void log_nmethod(JavaThread* thread, nmethod* nm) {
log(thread, "nmethod %d%s " INTPTR_FORMAT " code ["INTPTR_FORMAT ", " INTPTR_FORMAT "]",
*** 326,357 ****
--- 326,344 ----
guarantee(_code_handle != NULL, "");
_code_handle->set_code(nm);
if (nm == NULL) _code_handle = NULL; // drop the handle also
}
void CompileTask::mark_on_stack() {
// Mark these methods as something redefine classes cannot remove.
_method->set_on_stack(true);
if (_hot_method != NULL) {
_hot_method->set_on_stack(true);
}
}
// ------------------------------------------------------------------
// CompileTask::print
void CompileTask::print() {
tty->print("<CompileTask compile_id=%d ", _compile_id);
tty->print("method=");
_method->print_name(tty);
tty->print_cr(" osr_bci=%d is_blocking=%s is_complete=%s is_success=%s>",
_osr_bci, bool_to_str(_is_blocking),
bool_to_str(_is_complete), bool_to_str(_is_success));
}
// ------------------------------------------------------------------
// CompileTask::print_line_on_error
//
// This function is called by fatal error handler when the thread
// causing troubles is a compiler thread.
//
*** 365,387 ****
--- 352,373 ----
print_compilation(st);
}
// ------------------------------------------------------------------
// CompileTask::print_line
! void CompileTask::print_line() {
! void CompileTask::print_tty() {
ttyLocker ttyl; // keep the following output all in one block
// print compiler name if requested
if (CIPrintCompilerName) tty->print("%s:", CompileBroker::compiler_name(comp_level()));
! print_compilation(tty);
}
// ------------------------------------------------------------------
// CompileTask::print_compilation_impl
void CompileTask::print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level,
bool is_osr_method, int osr_bci, bool is_blocking,
! const char* msg, bool short_form, bool cr) {
if (!short_form) {
st->print("%7d ", (int) st->time_stamp().milliseconds()); // print timestamp
}
st->print("%4d ", compile_id); // print compilation number
*** 426,436 ****
--- 412,422 ----
}
if (msg != NULL) {
st->print(" %s", msg);
}
! if (!short_form) {
! if (cr) {
st->cr();
}
}
// ------------------------------------------------------------------
*** 492,504 ****
--- 478,490 ----
for (int i = 0; i < inline_level; i++) st->print(" ");
}
// ------------------------------------------------------------------
// CompileTask::print_compilation
! void CompileTask::print_compilation(outputStream* st, const char* msg, bool short_form, bool cr) {
bool is_osr_method = osr_bci() != InvocationEntryBci;
! print_compilation_impl(st, method(), compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), msg, short_form, cr);
}
// ------------------------------------------------------------------
// CompileTask::log_task
void CompileTask::log_task(xmlStream* log) {
*** 619,629 ****
--- 605,617 ----
++_size;
// Mark the method as being in the compile queue.
task->method()->set_queued_for_compilation();
NOT_PRODUCT(print();)
+ if (CIPrintCompileQueue) {
+ print_tty();
+ }
if (LogCompilation && xtty != NULL) {
task->log_task_queued();
}
*** 784,811 ****
--- 772,814 ----
task->mark_on_stack();
task = task->next();
}
}
#ifndef PRODUCT
/**
* Print entire compilation queue.
*/
void CompileQueue::print() {
if (CIPrintCompileQueue) {
ttyLocker ttyl;
tty->print_cr("Contents of %s", name());
tty->print_cr("----------------------");
+
+ CompileQueue* CompileBroker::compile_queue(int comp_level) {
+ if (is_c2_compile(comp_level)) return _c2_compile_queue;
+ if (is_c1_compile(comp_level)) return _c1_compile_queue;
+ return NULL;
+ }
+
+
+ void CompileBroker::print_compile_queues(outputStream* st) {
+ _c1_compile_queue->print(st);
+ _c2_compile_queue->print(st);
+ }
+
+
+ void CompileQueue::print(outputStream* st) {
+ st->print_cr("Contents of %s", name());
+ st->print_cr("----------------------------");
CompileTask* task = _first;
+ if (task == NULL) {
+ st->print_cr("Empty");;
+ } else {
while (task != NULL) {
! task->print_line();
! task->print_compilation(st, NULL, true, true);
task = task->next();
}
tty->print_cr("----------------------");
}
+ st->print_cr("----------------------------");
+ }
+
+ void CompileQueue::print_tty() {
+ ttyLocker ttyl;
+ print(tty);
}
#endif // PRODUCT
CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
_current_method[0] = '\0';
_compile_type = CompileBroker::no_compile;
*** 1066,1080 ****
--- 1069,1083 ----
#if !defined(ZERO) && !defined(SHARK)
assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?");
#endif // !ZERO && !SHARK
// Initialize the compilation queue
if (c2_compiler_count > 0) {
! _c2_compile_queue = new CompileQueue("C2 CompileQueue", MethodCompileQueue_lock);
! _c2_compile_queue = new CompileQueue("C2 compile queue", MethodCompileQueue_lock);
_compilers[1]->set_num_compiler_threads(c2_compiler_count);
}
if (c1_compiler_count > 0) {
! _c1_compile_queue = new CompileQueue("C1 CompileQueue", MethodCompileQueue_lock);
! _c1_compile_queue = new CompileQueue("C1 compile queue", MethodCompileQueue_lock);
_compilers[0]->set_num_compiler_threads(c1_compiler_count);
}
int compiler_count = c1_compiler_count + c2_compiler_count;
*** 1890,1900 ****
--- 1893,1903 ----
// Compile a method.
//
void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
if (PrintCompilation) {
ResourceMark rm;
! task->print_line();
! task->print_tty();
}
elapsedTimer time;
CompilerThread* thread = CompilerThread::current();
ResourceMark rm(thread);
src/share/vm/compiler/compileBroker.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File