Reviewers: Benedikt Meurer,

Description:
Improved --trace-opt output a bit.

This ensures that we always have a kind of "brace" around the actual compilation
with --trace-opt. Previously this was coupled to --trace-hydrogen for
Crankshaft, and there was no output at the start of the compilation for
TurboFan.

Removed redundant "[completed...]" output: Whenever the compilation was
successful, we have already printed "[optimizing...took...]".

Output total TurboFanning time with --trace-opt, too (basically as graph
building time, this is rather arbitrary).

Please review this at https://codereview.chromium.org/819613002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+12, -8 lines):
  M src/compiler.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index b081a18fff4dfb4b64f70c6531006886db0a7ce1..80a8c27543d15505d5ca43ddbf02415eb0eef706 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -415,6 +415,12 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
   // Check the whitelist for TurboFan.
   if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
       info()->closure()->PassesFilter(FLAG_turbo_filter)) {
+    if (FLAG_trace_opt) {
+      OFStream os(stdout);
+      os << "[compiling method " << Brief(*info()->closure())
+         << " using TurboFan]" << std::endl;
+    }
+    Timer t(this, &time_taken_to_create_graph_);
     compiler::Pipeline pipeline(info());
     pipeline.GenerateCode();
     if (!info()->code().is_null()) {
@@ -422,10 +428,13 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
     }
   }

+  if (FLAG_trace_opt) {
+    OFStream os(stdout);
+    os << "[compiling method " << Brief(*info()->closure())
+       << " using hydrogen]" << std::endl;
+  }
+
   if (FLAG_trace_hydrogen) {
-    Handle<String> name = info()->function()->debug_name();
- PrintF("-----------------------------------------------------------\n"); - PrintF("Compiling method %s using hydrogen\n", name->ToCString().get());
     isolate()->GetHTracer()->TraceCompilation(info());
   }

@@ -871,11 +880,6 @@ static bool GetOptimizedCodeNow(CompilationInfo* info) {
   InsertCodeIntoOptimizedCodeMap(info);
   RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info,
                             info->shared_info());
-  if (FLAG_trace_opt) {
-    PrintF("[completed optimizing ");
-    info->closure()->ShortPrint();
-    PrintF("]\n");
-  }
   return true;
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to