| 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.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
| 9 #include "src/flags.h" | 9 #include "src/flags.h" |
| 10 #include "test/unittests/compiler/compiler-test-utils.h" | 10 #include "test/unittests/compiler/compiler-test-utils.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 InstructionSequence sequence(test_->isolate(), test_->zone(), | 44 InstructionSequence sequence(test_->isolate(), test_->zone(), |
| 45 instruction_blocks); | 45 instruction_blocks); |
| 46 SourcePositionTable source_position_table(graph()); | 46 SourcePositionTable source_position_table(graph()); |
| 47 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, | 47 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, |
| 48 schedule, &source_position_table, | 48 schedule, &source_position_table, |
| 49 source_position_mode, features); | 49 source_position_mode, features); |
| 50 selector.SelectInstructions(); | 50 selector.SelectInstructions(); |
| 51 if (FLAG_trace_turbo) { | 51 if (FLAG_trace_turbo) { |
| 52 OFStream out(stdout); | 52 OFStream out(stdout); |
| 53 PrintableInstructionSequence printable = { | 53 PrintableInstructionSequence printable = { |
| 54 RegisterConfiguration::ArchDefault(), &sequence}; | 54 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN), |
| 55 &sequence}; |
| 55 out << "=== Code sequence after instruction selection ===" << std::endl | 56 out << "=== Code sequence after instruction selection ===" << std::endl |
| 56 << printable; | 57 << printable; |
| 57 } | 58 } |
| 58 Stream s; | 59 Stream s; |
| 59 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); | 60 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); |
| 60 // Map virtual registers. | 61 // Map virtual registers. |
| 61 for (Instruction* const instr : sequence) { | 62 for (Instruction* const instr : sequence) { |
| 62 if (instr->opcode() < 0) continue; | 63 if (instr->opcode() < 0) continue; |
| 63 if (mode == kTargetInstructions) { | 64 if (mode == kTargetInstructions) { |
| 64 switch (instr->arch_opcode()) { | 65 switch (instr->arch_opcode()) { |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); | 613 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); |
| 613 // Continuation. | 614 // Continuation. |
| 614 | 615 |
| 615 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 616 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
| 616 EXPECT_EQ(index, s.size()); | 617 EXPECT_EQ(index, s.size()); |
| 617 } | 618 } |
| 618 | 619 |
| 619 } // namespace compiler | 620 } // namespace compiler |
| 620 } // namespace internal | 621 } // namespace internal |
| 621 } // namespace v8 | 622 } // namespace v8 |
| OLD | NEW |