Permalink
Browse files

Better debugging information for JIT not compiling

  • Loading branch information...
dbussink committed Feb 25, 2013
1 parent f850ace commit ca6f7799c9ffc8c2fd3ba82ee107d6e647adfb6e
Showing with 22 additions and 28 deletions.
  1. +22 −28 vm/llvm/state.cpp
View
@@ -549,21 +549,14 @@ namespace rubinius {
{
bool wait = config().jit_sync;
- // Ignore it!
if(code->machine_code()->call_count <= 1) {
- // if(config().jit_inline_debug) {
- // log() << "JIT: ignoring candidate! "
- // << symbol_debug_str(code->name()) << "\n";
- // }
return;
}
if(code->machine_code()->compiling_p()) {
return;
}
- // Don't do this because it prevents other class from heating
- // it up too!
int hits = code->machine_code()->call_count;
code->machine_code()->set_compiling();
@@ -587,15 +580,14 @@ namespace rubinius {
wait_mutex.unlock();
gc_dependent();
state->set_call_frame(0);
- // if(config().jit_inline_debug) {
- // if(block) {
- // log() << "JIT: compiled block inside: "
- // << symbol_debug_str(code->name()) << "\n";
- // } else {
- // log() << "JIT: compiled method: "
- // << symbol_debug_str(code->name()) << "\n";
- // }
- // }
+
+ if(state->shared().config.jit_show_compiling) {
+ llvm::outs() << "[[[ JIT compiled "
+ << enclosure_name(code) << "#" << symbol_debug_str(code->name())
+ << (req->is_block() ? " (block) " : " (method) ")
+ << queued_methods() << "/"
+ << jitted_methods() << " ]]]\n";
+ }
} else {
background_thread_->add(req);
@@ -626,21 +618,23 @@ namespace rubinius {
<< symbol_debug_str(start->name()) << std::endl;
}
- // if(config().jit_inline_debug) {
- // if(start) {
- // std::cout << "JIT: target search from "
- // << symbol_debug_str(start->name()) << "\n";
- // } else {
- // std::cout << "JIT: target search from primitive\n";
- // }
- // }
-
CallFrame* candidate = find_candidate(state, start, call_frame);
if(!candidate || candidate->jitted_p() || candidate->inline_method_p()) {
- if(debug_search) {
- std::cout << "JIT: invalid candidate returned" << std::endl;
- }
+ if(config().jit_show_compiling) {
+ llvm::outs() << "[[[ JIT error finding call frame "
+ << enclosure_name(start) << "#" << symbol_debug_str(start->name());
+ if(!candidate) {
+ llvm::outs() << " no candidate";
+ }
+ if(candidate->jitted_p()) {
+ llvm::outs() << " candidate is jitted";
+ }
+ if(candidate->inline_method_p()) {
+ llvm::outs() << " candidate is inlined";
+ }
+ llvm::outs() << " ]]]\n";
+ }
return;
}

0 comments on commit ca6f779

Please sign in to comment.