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 "test/unittests/compiler/instruction-selector-unittest.h" | 5 #include "test/unittests/compiler/instruction-selector-unittest.h" |
6 | 6 |
7 #include "src/compiler/graph-inl.h" | 7 #include "src/compiler/graph-inl.h" |
8 #include "src/flags.h" | 8 #include "src/flags.h" |
9 #include "test/unittests/compiler/compiler-test-utils.h" | 9 #include "test/unittests/compiler/compiler-test-utils.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 OFStream out(stdout); | 33 OFStream out(stdout); |
34 out << "=== Schedule before instruction selection ===" << std::endl | 34 out << "=== Schedule before instruction selection ===" << std::endl |
35 << *schedule; | 35 << *schedule; |
36 } | 36 } |
37 EXPECT_NE(0, graph()->NodeCount()); | 37 EXPECT_NE(0, graph()->NodeCount()); |
38 int initial_node_count = graph()->NodeCount(); | 38 int initial_node_count = graph()->NodeCount(); |
39 CompilationInfo info(test_->isolate(), test_->zone()); | 39 CompilationInfo info(test_->isolate(), test_->zone()); |
40 Linkage linkage(&info, call_descriptor()); | 40 Linkage linkage(&info, call_descriptor()); |
41 InstructionSequence sequence(&linkage, graph(), schedule); | 41 InstructionSequence sequence(&linkage, graph(), schedule); |
42 SourcePositionTable source_position_table(graph()); | 42 SourcePositionTable source_position_table(graph()); |
43 InstructionSelector selector(&sequence, &source_position_table, features); | 43 InstructionSelector selector(&sequence, schedule, &source_position_table, |
| 44 features); |
44 selector.SelectInstructions(); | 45 selector.SelectInstructions(); |
45 if (FLAG_trace_turbo) { | 46 if (FLAG_trace_turbo) { |
46 OFStream out(stdout); | 47 OFStream out(stdout); |
47 out << "=== Code sequence after instruction selection ===" << std::endl | 48 out << "=== Code sequence after instruction selection ===" << std::endl |
48 << sequence; | 49 << sequence; |
49 } | 50 } |
50 Stream s; | 51 Stream s; |
51 // Map virtual registers. | 52 // Map virtual registers. |
52 { | 53 { |
53 const int* node_map = sequence.GetNodeMapForTesting(); | 54 const int* node_map = sequence.GetNodeMapForTesting(); |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); | 551 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); |
551 // Continuation. | 552 // Continuation. |
552 | 553 |
553 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 554 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
554 EXPECT_EQ(index, s.size()); | 555 EXPECT_EQ(index, s.size()); |
555 } | 556 } |
556 | 557 |
557 } // namespace compiler | 558 } // namespace compiler |
558 } // namespace internal | 559 } // namespace internal |
559 } // namespace v8 | 560 } // namespace v8 |
OLD | NEW |