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() {
DCHECK(info()->shared_info()->has_deoptimization_support());
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.
DCHECK_EQ(SUCCEEDED, last_status());
ScopedTimer t(&time_taken_to_create_graph_);
......
......@@ -581,8 +581,8 @@ class CompilationInfo {
// be checked using {last_status()} as well.
class OptimizedCompileJob: public ZoneObject {
public:
explicit OptimizedCompileJob(CompilationInfo* info)
: info_(info), last_status_(SUCCEEDED) {}
explicit OptimizedCompileJob(CompilationInfo* info, const char* compiler_name)
: info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {}
virtual ~OptimizedCompileJob() {}
enum Status {
......@@ -622,6 +622,7 @@ class OptimizedCompileJob: public ZoneObject {
base::TimeDelta time_taken_to_create_graph_;
base::TimeDelta time_taken_to_optimize_;
base::TimeDelta time_taken_to_codegen_;
const char* compiler_name_;
Status last_status_;
MUST_USE_RESULT Status SetLastStatus(Status status) {
......
......@@ -480,7 +480,7 @@ class PipelineRunScope {
class PipelineCompilationJob : public OptimizedCompileJob {
public:
explicit PipelineCompilationJob(CompilationInfo* info)
: OptimizedCompileJob(info) {}
: OptimizedCompileJob(info, "TurboFan") {}
protected:
virtual Status CreateGraphImpl();
......@@ -489,14 +489,6 @@ class PipelineCompilationJob : public OptimizedCompileJob {
};
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()->osr_frame()) info()->MarkAsFrameSpecializing();
info()->MarkAsFunctionContextSpecializing();
......
......@@ -132,14 +132,6 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() {
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) {
isolate()->GetHTracer()->TraceCompilation(info());
}
......
......@@ -33,7 +33,9 @@ class LiveRange;
class HCompilationJob final : public OptimizedCompileJob {
public:
explicit HCompilationJob(CompilationInfo* info)
: OptimizedCompileJob(info), graph_(nullptr), chunk_(nullptr) {}
: OptimizedCompileJob(info, "Crankshaft"),
graph_(nullptr),
chunk_(nullptr) {}
protected:
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