Commit abe5c290 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Silence --trace-turbo a bit and behave graceful in sandbox.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25709}
parent 6680fd15
...@@ -251,7 +251,7 @@ struct TurboCfgFile : public std::ofstream { ...@@ -251,7 +251,7 @@ struct TurboCfgFile : public std::ofstream {
static void TraceSchedule(Schedule* schedule) { static void TraceSchedule(Schedule* schedule) {
if (!FLAG_trace_turbo) return; if (!FLAG_trace_turbo_graph && !FLAG_trace_turbo_scheduler) return;
OFStream os(stdout); OFStream os(stdout);
os << "-- Schedule --------------------------------------\n" << *schedule; os << "-- Schedule --------------------------------------\n" << *schedule;
} }
...@@ -646,6 +646,7 @@ struct PrintGraphPhase { ...@@ -646,6 +646,7 @@ struct PrintGraphPhase {
Vector<char> dot_filename(dot_buffer, sizeof(dot_buffer)); Vector<char> dot_filename(dot_buffer, sizeof(dot_buffer));
SNPrintF(dot_filename, "%s.dot", filename.start()); SNPrintF(dot_filename, "%s.dot", filename.start());
FILE* dot_file = base::OS::FOpen(dot_filename.start(), "w+"); FILE* dot_file = base::OS::FOpen(dot_filename.start(), "w+");
if (dot_file == nullptr) return;
OFStream dot_of(dot_file); OFStream dot_of(dot_file);
dot_of << AsDOT(*graph); dot_of << AsDOT(*graph);
fclose(dot_file); fclose(dot_file);
...@@ -656,6 +657,7 @@ struct PrintGraphPhase { ...@@ -656,6 +657,7 @@ struct PrintGraphPhase {
Vector<char> json_filename(json_buffer, sizeof(json_buffer)); Vector<char> json_filename(json_buffer, sizeof(json_buffer));
SNPrintF(json_filename, "%s.json", filename.start()); SNPrintF(json_filename, "%s.json", filename.start());
FILE* json_file = base::OS::FOpen(json_filename.start(), "w+"); FILE* json_file = base::OS::FOpen(json_filename.start(), "w+");
if (json_file == nullptr) return;
OFStream json_of(json_file); OFStream json_of(json_file);
json_of << AsJSON(*graph); json_of << AsJSON(*graph);
fclose(json_file); fclose(json_file);
...@@ -818,7 +820,7 @@ Handle<Code> Pipeline::GenerateCode() { ...@@ -818,7 +820,7 @@ Handle<Code> Pipeline::GenerateCode() {
if (FLAG_trace_turbo) { if (FLAG_trace_turbo) {
OFStream os(stdout); OFStream os(stdout);
os << "--------------------------------------------------\n" os << "---------------------------------------------------\n"
<< "Finished compiling method " << GetDebugName(info()).get() << "Finished compiling method " << GetDebugName(info()).get()
<< " using Turbofan" << std::endl; << " using Turbofan" << std::endl;
} }
...@@ -982,7 +984,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, ...@@ -982,7 +984,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
Run<MeetRegisterConstraintsPhase>(); Run<MeetRegisterConstraintsPhase>();
Run<ResolvePhisPhase>(); Run<ResolvePhisPhase>();
Run<BuildLiveRangesPhase>(); Run<BuildLiveRangesPhase>();
if (FLAG_trace_turbo) { if (FLAG_trace_turbo_graph) {
OFStream os(stdout); OFStream os(stdout);
PrintableInstructionSequence printable = {config, data->sequence()}; PrintableInstructionSequence printable = {config, data->sequence()};
os << "----- Instruction sequence before register allocation -----\n" os << "----- Instruction sequence before register allocation -----\n"
...@@ -1007,7 +1009,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config, ...@@ -1007,7 +1009,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
Run<ResolveControlFlowPhase>(); Run<ResolveControlFlowPhase>();
Run<OptimizeMovesPhase>(); Run<OptimizeMovesPhase>();
if (FLAG_trace_turbo) { if (FLAG_trace_turbo_graph) {
OFStream os(stdout); OFStream os(stdout);
PrintableInstructionSequence printable = {config, data->sequence()}; PrintableInstructionSequence printable = {config, data->sequence()};
os << "----- Instruction sequence after register allocation -----\n" os << "----- Instruction sequence after register allocation -----\n"
......
...@@ -28,7 +28,9 @@ OFStreamBase::int_type OFStreamBase::overflow(int_type c) { ...@@ -28,7 +28,9 @@ OFStreamBase::int_type OFStreamBase::overflow(int_type c) {
} }
OFStream::OFStream(FILE* f) : OFStreamBase(f), std::ostream(this) {} OFStream::OFStream(FILE* f) : OFStreamBase(f), std::ostream(this) {
DCHECK_NOT_NULL(f);
}
OFStream::~OFStream() {} OFStream::~OFStream() {}
......
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