[turbofan] Small fixes to PipelineStatistics. Collect statistics in tests.
authortitzer <titzer@chromium.org>
Mon, 4 May 2015 11:05:45 +0000 (04:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 4 May 2015 11:05:45 +0000 (11:05 +0000)
R=bmeurer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1122753002

Cr-Commit-Position: refs/heads/master@{#28192}

src/compiler/pipeline-statistics.cc
src/compiler/pipeline.cc

index 0203a35..5e8d127 100644 (file)
@@ -50,7 +50,7 @@ PipelineStatistics::PipelineStatistics(CompilationInfo* info,
       source_size_(0),
       phase_kind_name_(NULL),
       phase_name_(NULL) {
-  if (!info->shared_info().is_null()) {
+  if (info->has_shared_info()) {
     source_size_ = static_cast<size_t>(info->shared_info()->SourceSize());
     SmartArrayPointer<char> name =
         info->shared_info()->DebugName()->ToCString();
index fd8843f..5e51c45 100644 (file)
@@ -1139,6 +1139,12 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
   // Construct a pipeline for scheduling and code generation.
   ZonePool zone_pool;
   PipelineData data(&zone_pool, info, graph, schedule);
+  SmartPointer<PipelineStatistics> pipeline_statistics;
+  if (FLAG_turbo_stats) {
+    pipeline_statistics.Reset(new PipelineStatistics(info, &zone_pool));
+    pipeline_statistics->BeginPhaseKind("test codegen");
+  }
+
   Pipeline pipeline(info);
   pipeline.data_ = &data;
   if (data.schedule() == nullptr) {