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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/schedule.h" | 9 #include "src/compiler/schedule.h" |
10 #include "src/flags.h" | 10 #include "src/flags.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 | 23 |
24 InstructionSelectorTest::InstructionSelectorTest() : rng_(FLAG_random_seed) {} | 24 InstructionSelectorTest::InstructionSelectorTest() : rng_(FLAG_random_seed) {} |
25 | 25 |
26 | 26 |
27 InstructionSelectorTest::~InstructionSelectorTest() {} | 27 InstructionSelectorTest::~InstructionSelectorTest() {} |
28 | 28 |
29 | 29 |
30 InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( | 30 InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( |
31 InstructionSelector::Features features, | 31 InstructionSelector::Features features, |
32 InstructionSelectorTest::StreamBuilderMode mode) { | 32 InstructionSelectorTest::StreamBuilderMode mode, |
| 33 InstructionSelector::SourcePositionMode source_position_mode) { |
33 Schedule* schedule = Export(); | 34 Schedule* schedule = Export(); |
34 if (FLAG_trace_turbo) { | 35 if (FLAG_trace_turbo) { |
35 OFStream out(stdout); | 36 OFStream out(stdout); |
36 out << "=== Schedule before instruction selection ===" << std::endl | 37 out << "=== Schedule before instruction selection ===" << std::endl |
37 << *schedule; | 38 << *schedule; |
38 } | 39 } |
39 size_t const node_count = graph()->NodeCount(); | 40 size_t const node_count = graph()->NodeCount(); |
40 EXPECT_NE(0u, node_count); | 41 EXPECT_NE(0u, node_count); |
41 Linkage linkage(call_descriptor()); | 42 Linkage linkage(call_descriptor()); |
42 InstructionBlocks* instruction_blocks = | 43 InstructionBlocks* instruction_blocks = |
43 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); | 44 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); |
44 InstructionSequence sequence(test_->isolate(), test_->zone(), | 45 InstructionSequence sequence(test_->isolate(), test_->zone(), |
45 instruction_blocks); | 46 instruction_blocks); |
46 SourcePositionTable source_position_table(graph()); | 47 SourcePositionTable source_position_table(graph()); |
47 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, | 48 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, |
48 schedule, &source_position_table, features); | 49 schedule, &source_position_table, |
| 50 source_position_mode, features); |
49 selector.SelectInstructions(); | 51 selector.SelectInstructions(); |
50 if (FLAG_trace_turbo) { | 52 if (FLAG_trace_turbo) { |
51 OFStream out(stdout); | 53 OFStream out(stdout); |
52 PrintableInstructionSequence printable = { | 54 PrintableInstructionSequence printable = { |
53 RegisterConfiguration::ArchDefault(), &sequence}; | 55 RegisterConfiguration::ArchDefault(), &sequence}; |
54 out << "=== Code sequence after instruction selection ===" << std::endl | 56 out << "=== Code sequence after instruction selection ===" << std::endl |
55 << printable; | 57 << printable; |
56 } | 58 } |
57 Stream s; | 59 Stream s; |
58 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); | 60 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 EXPECT_EQ(kArchCallCodeObject, s[1]->arch_opcode()); | 636 EXPECT_EQ(kArchCallCodeObject, s[1]->arch_opcode()); |
635 EXPECT_EQ(kArchRet, s[2]->arch_opcode()); | 637 EXPECT_EQ(kArchRet, s[2]->arch_opcode()); |
636 EXPECT_EQ(kArchNop, s[3]->arch_opcode()); | 638 EXPECT_EQ(kArchNop, s[3]->arch_opcode()); |
637 } | 639 } |
638 } | 640 } |
639 } | 641 } |
640 | 642 |
641 } // namespace compiler | 643 } // namespace compiler |
642 } // namespace internal | 644 } // namespace internal |
643 } // namespace v8 | 645 } // namespace v8 |
OLD | NEW |