OLD | NEW |
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-selector-unittest.h" | 5 #include "src/compiler/instruction-selector-unittest.h" |
6 | 6 |
7 #include "src/compiler/compiler-test-utils.h" | 7 #include "src/compiler/compiler-test-utils.h" |
8 #include "src/flags.h" | 8 #include "src/flags.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 InstructionSelectorTest::~InstructionSelectorTest() {} | 24 InstructionSelectorTest::~InstructionSelectorTest() {} |
25 | 25 |
26 | 26 |
27 InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( | 27 InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( |
28 InstructionSelector::Features features, | 28 InstructionSelector::Features features, |
29 InstructionSelectorTest::StreamBuilderMode mode) { | 29 InstructionSelectorTest::StreamBuilderMode mode) { |
30 Schedule* schedule = Export(); | 30 Schedule* schedule = Export(); |
31 if (FLAG_trace_turbo) { | 31 if (FLAG_trace_turbo) { |
32 OFStream out(stdout); | 32 OFStream out(stdout); |
33 out << "=== Schedule before instruction selection ===" << endl << *schedule; | 33 out << "=== Schedule before instruction selection ===" << std::endl |
| 34 << *schedule; |
34 } | 35 } |
35 EXPECT_NE(0, graph()->NodeCount()); | 36 EXPECT_NE(0, graph()->NodeCount()); |
36 CompilationInfo info(test_->isolate(), test_->zone()); | 37 CompilationInfo info(test_->isolate(), test_->zone()); |
37 Linkage linkage(&info, call_descriptor()); | 38 Linkage linkage(&info, call_descriptor()); |
38 InstructionSequence sequence(&linkage, graph(), schedule); | 39 InstructionSequence sequence(&linkage, graph(), schedule); |
39 SourcePositionTable source_position_table(graph()); | 40 SourcePositionTable source_position_table(graph()); |
40 InstructionSelector selector(&sequence, &source_position_table, features); | 41 InstructionSelector selector(&sequence, &source_position_table, features); |
41 selector.SelectInstructions(); | 42 selector.SelectInstructions(); |
42 if (FLAG_trace_turbo) { | 43 if (FLAG_trace_turbo) { |
43 OFStream out(stdout); | 44 OFStream out(stdout); |
44 out << "=== Code sequence after instruction selection ===" << endl | 45 out << "=== Code sequence after instruction selection ===" << std::endl |
45 << sequence; | 46 << sequence; |
46 } | 47 } |
47 Stream s; | 48 Stream s; |
48 std::set<int> virtual_registers; | 49 std::set<int> virtual_registers; |
49 for (InstructionSequence::const_iterator i = sequence.begin(); | 50 for (InstructionSequence::const_iterator i = sequence.begin(); |
50 i != sequence.end(); ++i) { | 51 i != sequence.end(); ++i) { |
51 Instruction* instr = *i; | 52 Instruction* instr = *i; |
52 if (instr->opcode() < 0) continue; | 53 if (instr->opcode() < 0) continue; |
53 if (mode == kTargetInstructions) { | 54 if (mode == kTargetInstructions) { |
54 switch (instr->arch_opcode()) { | 55 switch (instr->arch_opcode()) { |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 EXPECT_EQ(context2->id(), s.ToVreg(call_instr->InputAt(11))); | 509 EXPECT_EQ(context2->id(), s.ToVreg(call_instr->InputAt(11))); |
509 // Continuation. | 510 // Continuation. |
510 | 511 |
511 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 512 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
512 EXPECT_EQ(index, s.size()); | 513 EXPECT_EQ(index, s.size()); |
513 } | 514 } |
514 | 515 |
515 } // namespace compiler | 516 } // namespace compiler |
516 } // namespace internal | 517 } // namespace internal |
517 } // namespace v8 | 518 } // namespace v8 |
OLD | NEW |