Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: src/compiler/instruction.cc

Issue 637313002: [turbofan] Output file for C1 visualizer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/node-aux-data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/instruction.h" 5 #include "src/compiler/instruction.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/generic-node-inl.h" 8 #include "src/compiler/generic-node-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 if (fm != kFlags_none) { 284 if (fm != kFlags_none) {
285 os << " && " << fm << " if " 285 os << " && " << fm << " if "
286 << FlagsConditionField::decode(instr.opcode()); 286 << FlagsConditionField::decode(instr.opcode());
287 } 287 }
288 } 288 }
289 if (instr.InputCount() > 0) { 289 if (instr.InputCount() > 0) {
290 for (size_t i = 0; i < instr.InputCount(); i++) { 290 for (size_t i = 0; i < instr.InputCount(); i++) {
291 os << " " << *instr.InputAt(i); 291 os << " " << *instr.InputAt(i);
292 } 292 }
293 } 293 }
294 return os << "\n"; 294 return os;
295 } 295 }
296 296
297 297
298 std::ostream& operator<<(std::ostream& os, const Constant& constant) { 298 std::ostream& operator<<(std::ostream& os, const Constant& constant) {
299 switch (constant.type()) { 299 switch (constant.type()) {
300 case Constant::kInt32: 300 case Constant::kInt32:
301 return os << constant.ToInt32(); 301 return os << constant.ToInt32();
302 case Constant::kInt64: 302 case Constant::kInt64:
303 return os << constant.ToInt64() << "l"; 303 return os << constant.ToInt64() << "l";
304 case Constant::kFloat32: 304 case Constant::kFloat32:
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 os << " v" << (*iter)->id(); 556 os << " v" << (*iter)->id();
557 } 557 }
558 os << "\n"; 558 os << "\n";
559 } 559 }
560 560
561 ScopedVector<char> buf(32); 561 ScopedVector<char> buf(32);
562 for (int j = block->first_instruction_index(); 562 for (int j = block->first_instruction_index();
563 j <= block->last_instruction_index(); j++) { 563 j <= block->last_instruction_index(); j++) {
564 // TODO(svenpanne) Add some basic formatting to our streams. 564 // TODO(svenpanne) Add some basic formatting to our streams.
565 SNPrintF(buf, "%5d", j); 565 SNPrintF(buf, "%5d", j);
566 os << " " << buf.start() << ": " << *code.InstructionAt(j); 566 os << " " << buf.start() << ": " << *code.InstructionAt(j) << "\n";
567 } 567 }
568 568
569 os << " " << block->control(); 569 os << " " << block->control();
570 570
571 if (block->control_input() != NULL) { 571 if (block->control_input() != NULL) {
572 os << " v" << block->control_input()->id(); 572 os << " v" << block->control_input()->id();
573 } 573 }
574 574
575 for (BasicBlock::Successors::iterator iter = block->successors_begin(); 575 for (BasicBlock::Successors::iterator iter = block->successors_begin();
576 iter != block->successors_end(); ++iter) { 576 iter != block->successors_end(); ++iter) {
577 os << " B" << (*iter)->id(); 577 os << " B" << (*iter)->id();
578 } 578 }
579 os << "\n"; 579 os << "\n";
580 } 580 }
581 return os; 581 return os;
582 } 582 }
583 583
584 } // namespace compiler 584 } // namespace compiler
585 } // namespace internal 585 } // namespace internal
586 } // namespace v8 586 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/node-aux-data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698