Skip to content

Commit

Permalink
Better debugging information for JIT not compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Feb 25, 2013
1 parent f850ace commit ca6f779
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions vm/llvm/state.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -549,21 +549,14 @@ namespace rubinius {
{ {
bool wait = config().jit_sync; bool wait = config().jit_sync;


// Ignore it!
if(code->machine_code()->call_count <= 1) { if(code->machine_code()->call_count <= 1) {
// if(config().jit_inline_debug) {
// log() << "JIT: ignoring candidate! "
// << symbol_debug_str(code->name()) << "\n";
// }
return; return;
} }


if(code->machine_code()->compiling_p()) { if(code->machine_code()->compiling_p()) {
return; return;
} }


// Don't do this because it prevents other class from heating
// it up too!
int hits = code->machine_code()->call_count; int hits = code->machine_code()->call_count;
code->machine_code()->set_compiling(); code->machine_code()->set_compiling();


Expand All @@ -587,15 +580,14 @@ namespace rubinius {
wait_mutex.unlock(); wait_mutex.unlock();
gc_dependent(); gc_dependent();
state->set_call_frame(0); state->set_call_frame(0);
// if(config().jit_inline_debug) {
// if(block) { if(state->shared().config.jit_show_compiling) {
// log() << "JIT: compiled block inside: " llvm::outs() << "[[[ JIT compiled "
// << symbol_debug_str(code->name()) << "\n"; << enclosure_name(code) << "#" << symbol_debug_str(code->name())
// } else { << (req->is_block() ? " (block) " : " (method) ")
// log() << "JIT: compiled method: " << queued_methods() << "/"
// << symbol_debug_str(code->name()) << "\n"; << jitted_methods() << " ]]]\n";
// } }
// }
} else { } else {
background_thread_->add(req); background_thread_->add(req);


Expand Down Expand Up @@ -626,21 +618,23 @@ namespace rubinius {
<< symbol_debug_str(start->name()) << std::endl; << 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); CallFrame* candidate = find_candidate(state, start, call_frame);
if(!candidate || candidate->jitted_p() || candidate->inline_method_p()) { if(!candidate || candidate->jitted_p() || candidate->inline_method_p()) {
if(debug_search) { if(config().jit_show_compiling) {
std::cout << "JIT: invalid candidate returned" << std::endl; 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; return;
} }


Expand Down

0 comments on commit ca6f779

Please sign in to comment.