| 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-factory.h" | 7 #include "src/code-factory.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 27 matching lines...) Expand all Loading... |
| 38 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); | 38 InstructionSequence::InstructionBlocksFor(test_->zone(), schedule); |
| 39 InstructionSequence sequence(test_->isolate(), test_->zone(), | 39 InstructionSequence sequence(test_->isolate(), test_->zone(), |
| 40 instruction_blocks); | 40 instruction_blocks); |
| 41 SourcePositionTable source_position_table(graph()); | 41 SourcePositionTable source_position_table(graph()); |
| 42 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, | 42 InstructionSelector selector(test_->zone(), node_count, &linkage, &sequence, |
| 43 schedule, &source_position_table, nullptr, | 43 schedule, &source_position_table, nullptr, |
| 44 source_position_mode, features); | 44 source_position_mode, features); |
| 45 selector.SelectInstructions(); | 45 selector.SelectInstructions(); |
| 46 if (FLAG_trace_turbo) { | 46 if (FLAG_trace_turbo) { |
| 47 OFStream out(stdout); | 47 OFStream out(stdout); |
| 48 PrintableInstructionSequence printable = { | 48 PrintableInstructionSequence printable = {RegisterConfiguration::Turbofan(), |
| 49 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN), | 49 &sequence}; |
| 50 &sequence}; | |
| 51 out << "=== Code sequence after instruction selection ===" << std::endl | 50 out << "=== Code sequence after instruction selection ===" << std::endl |
| 52 << printable; | 51 << printable; |
| 53 } | 52 } |
| 54 Stream s; | 53 Stream s; |
| 55 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); | 54 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); |
| 56 // Map virtual registers. | 55 // Map virtual registers. |
| 57 for (Instruction* const instr : sequence) { | 56 for (Instruction* const instr : sequence) { |
| 58 if (instr->opcode() < 0) continue; | 57 if (instr->opcode() < 0) continue; |
| 59 if (mode == kTargetInstructions) { | 58 if (mode == kTargetInstructions) { |
| 60 switch (instr->arch_opcode()) { | 59 switch (instr->arch_opcode()) { |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); | 621 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); |
| 623 // Continuation. | 622 // Continuation. |
| 624 | 623 |
| 625 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 624 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
| 626 EXPECT_EQ(index, s.size()); | 625 EXPECT_EQ(index, s.size()); |
| 627 } | 626 } |
| 628 | 627 |
| 629 } // namespace compiler | 628 } // namespace compiler |
| 630 } // namespace internal | 629 } // namespace internal |
| 631 } // namespace v8 | 630 } // namespace v8 |
| OLD | NEW |