Commit 318cc682 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Move tracing from backends to compiler.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35384}
parent 8982cb5c
...@@ -354,6 +354,14 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { ...@@ -354,6 +354,14 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
DCHECK(info()->shared_info()->has_deoptimization_support()); DCHECK(info()->shared_info()->has_deoptimization_support());
DCHECK(!info()->is_first_compile()); DCHECK(!info()->is_first_compile());
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure()) << " using "
<< compiler_name_;
if (info()->is_osr()) os << " OSR";
os << "]" << std::endl;
}
// Delegate to the underlying implementation. // Delegate to the underlying implementation.
DCHECK_EQ(SUCCEEDED, last_status()); DCHECK_EQ(SUCCEEDED, last_status());
ScopedTimer t(&time_taken_to_create_graph_); ScopedTimer t(&time_taken_to_create_graph_);
......
...@@ -581,8 +581,8 @@ class CompilationInfo { ...@@ -581,8 +581,8 @@ class CompilationInfo {
// be checked using {last_status()} as well. // be checked using {last_status()} as well.
class OptimizedCompileJob: public ZoneObject { class OptimizedCompileJob: public ZoneObject {
public: public:
explicit OptimizedCompileJob(CompilationInfo* info) explicit OptimizedCompileJob(CompilationInfo* info, const char* compiler_name)
: info_(info), last_status_(SUCCEEDED) {} : info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {}
virtual ~OptimizedCompileJob() {} virtual ~OptimizedCompileJob() {}
enum Status { enum Status {
...@@ -622,6 +622,7 @@ class OptimizedCompileJob: public ZoneObject { ...@@ -622,6 +622,7 @@ class OptimizedCompileJob: public ZoneObject {
base::TimeDelta time_taken_to_create_graph_; base::TimeDelta time_taken_to_create_graph_;
base::TimeDelta time_taken_to_optimize_; base::TimeDelta time_taken_to_optimize_;
base::TimeDelta time_taken_to_codegen_; base::TimeDelta time_taken_to_codegen_;
const char* compiler_name_;
Status last_status_; Status last_status_;
MUST_USE_RESULT Status SetLastStatus(Status status) { MUST_USE_RESULT Status SetLastStatus(Status status) {
......
...@@ -480,7 +480,7 @@ class PipelineRunScope { ...@@ -480,7 +480,7 @@ class PipelineRunScope {
class PipelineCompilationJob : public OptimizedCompileJob { class PipelineCompilationJob : public OptimizedCompileJob {
public: public:
explicit PipelineCompilationJob(CompilationInfo* info) explicit PipelineCompilationJob(CompilationInfo* info)
: OptimizedCompileJob(info) {} : OptimizedCompileJob(info, "TurboFan") {}
protected: protected:
virtual Status CreateGraphImpl(); virtual Status CreateGraphImpl();
...@@ -489,14 +489,6 @@ class PipelineCompilationJob : public OptimizedCompileJob { ...@@ -489,14 +489,6 @@ class PipelineCompilationJob : public OptimizedCompileJob {
}; };
PipelineCompilationJob::Status PipelineCompilationJob::CreateGraphImpl() { PipelineCompilationJob::Status PipelineCompilationJob::CreateGraphImpl() {
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure())
<< " using TurboFan";
if (info()->is_osr()) os << " OSR";
os << "]" << std::endl;
}
if (info()->shared_info()->asm_function()) { if (info()->shared_info()->asm_function()) {
if (info()->osr_frame()) info()->MarkAsFrameSpecializing(); if (info()->osr_frame()) info()->MarkAsFrameSpecializing();
info()->MarkAsFunctionContextSpecializing(); info()->MarkAsFunctionContextSpecializing();
......
...@@ -132,14 +132,6 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() { ...@@ -132,14 +132,6 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() {
return AbortOptimization(kTooManyParametersLocals); return AbortOptimization(kTooManyParametersLocals);
} }
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure())
<< " using Crankshaft";
if (info()->is_osr()) os << " OSR";
os << "]" << std::endl;
}
if (FLAG_trace_hydrogen) { if (FLAG_trace_hydrogen) {
isolate()->GetHTracer()->TraceCompilation(info()); isolate()->GetHTracer()->TraceCompilation(info());
} }
......
...@@ -33,7 +33,9 @@ class LiveRange; ...@@ -33,7 +33,9 @@ class LiveRange;
class HCompilationJob final : public OptimizedCompileJob { class HCompilationJob final : public OptimizedCompileJob {
public: public:
explicit HCompilationJob(CompilationInfo* info) explicit HCompilationJob(CompilationInfo* info)
: OptimizedCompileJob(info), graph_(nullptr), chunk_(nullptr) {} : OptimizedCompileJob(info, "Crankshaft"),
graph_(nullptr),
chunk_(nullptr) {}
protected: protected:
virtual Status CreateGraphImpl(); virtual Status CreateGraphImpl();
......
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