Index: src/codegen.cc |
diff --git a/src/codegen.cc b/src/codegen.cc |
index 8a64d77b7096bc94cd8c8885ccc6552fd977dee1..da479e8fc1e7564980f4730d6bfe0567f55145bf 100644 |
--- a/src/codegen.cc |
+++ b/src/codegen.cc |
@@ -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 |
} |