| 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 18 matching lines...) Expand all Loading... |
| 29 InstructionSelector::Features features, | 29 InstructionSelector::Features features, |
| 30 InstructionSelectorTest::StreamBuilderMode mode) { | 30 InstructionSelectorTest::StreamBuilderMode mode) { |
| 31 Schedule* schedule = Export(); | 31 Schedule* schedule = Export(); |
| 32 if (FLAG_trace_turbo) { | 32 if (FLAG_trace_turbo) { |
| 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 size_t const node_count = graph()->NodeCount(); | 37 size_t const node_count = graph()->NodeCount(); |
| 38 EXPECT_NE(0u, node_count); | 38 EXPECT_NE(0u, node_count); |
| 39 Linkage linkage(test_->zone(), call_descriptor()); | 39 Linkage linkage(test_->isolate(), test_->zone(), call_descriptor()); |
| 40 InstructionBlocks* instruction_blocks = | 40 InstructionBlocks* instruction_blocks = |
| 41 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); | 41 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); |
| 42 InstructionSequence sequence(test_->zone(), instruction_blocks); | 42 InstructionSequence sequence(test_->isolate(), test_->zone(), |
| 43 instruction_blocks); |
| 43 SourcePositionTable source_position_table(graph()); | 44 SourcePositionTable source_position_table(graph()); |
| 44 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, | 45 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, |
| 45 schedule, &source_position_table, features); | 46 schedule, &source_position_table, features); |
| 46 selector.SelectInstructions(); | 47 selector.SelectInstructions(); |
| 47 if (FLAG_trace_turbo) { | 48 if (FLAG_trace_turbo) { |
| 48 OFStream out(stdout); | 49 OFStream out(stdout); |
| 49 PrintableInstructionSequence printable = { | 50 PrintableInstructionSequence printable = { |
| 50 RegisterConfiguration::ArchDefault(), &sequence}; | 51 RegisterConfiguration::ArchDefault(), &sequence}; |
| 51 out << "=== Code sequence after instruction selection ===" << std::endl | 52 out << "=== Code sequence after instruction selection ===" << std::endl |
| 52 << printable; | 53 << printable; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); | 563 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); |
| 563 // Continuation. | 564 // Continuation. |
| 564 | 565 |
| 565 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 566 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
| 566 EXPECT_EQ(index, s.size()); | 567 EXPECT_EQ(index, s.size()); |
| 567 } | 568 } |
| 568 | 569 |
| 569 } // namespace compiler | 570 } // namespace compiler |
| 570 } // namespace internal | 571 } // namespace internal |
| 571 } // namespace v8 | 572 } // namespace v8 |
| OLD | NEW |