Commit b2dbea6c authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

Extend code printing:

o Add --print-unopt-code to print unoptimized code before printing
  optimized code based on it. This is useful to see the states of ICs
  and the effects of code patching.

o Use debug function names in disassembly output.

Review URL: http://codereview.chromium.org/5959003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6cc0310a
......@@ -215,8 +215,17 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
}
PrintF("\n\n");
}
PrintF("--- Code ---\n");
code->Disassemble(*function->name()->ToCString());
if (info->IsOptimizing()) {
if (FLAG_print_unopt_code) {
PrintF("--- Unoptimized code ---\n");
info->closure()->shared()->code()->Disassemble(
*function->debug_name()->ToCString());
}
PrintF("--- Optimized code ---\n");
} else {
PrintF("--- Code ---\n");
}
code->Disassemble(*function->debug_name()->ToCString());
}
#endif // ENABLE_DISASSEMBLER
}
......
......@@ -503,6 +503,8 @@ DEFINE_bool(print_code_stubs, false, "print code stubs")
// codegen-ia32.cc / codegen-arm.cc
DEFINE_bool(print_code, false, "print generated code")
DEFINE_bool(print_opt_code, false, "print optimized code")
DEFINE_bool(print_unopt_code, false, "print unoptimized code before "
"printing optimized code based on it")
DEFINE_bool(print_code_verbose, false, "print more information for code")
DEFINE_bool(print_builtin_code, false, "print generated code for builtins")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment