| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 out << "=== Code sequence after instruction selection ===" << std::endl | 55 out << "=== Code sequence after instruction selection ===" << std::endl |
| 56 << printable; | 56 << printable; |
| 57 } | 57 } |
| 58 Stream s; | 58 Stream s; |
| 59 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); | 59 s.virtual_registers_ = selector.GetVirtualRegistersForTesting(); |
| 60 // Map virtual registers. | 60 // Map virtual registers. |
| 61 for (Instruction* const instr : sequence) { | 61 for (Instruction* const instr : sequence) { |
| 62 if (instr->opcode() < 0) continue; | 62 if (instr->opcode() < 0) continue; |
| 63 if (mode == kTargetInstructions) { | 63 if (mode == kTargetInstructions) { |
| 64 switch (instr->arch_opcode()) { | 64 switch (instr->arch_opcode()) { |
| 65 #define CASE(Name) \ | 65 #define CASE(Name, Flags) \ |
| 66 case k##Name: \ | 66 case k##Name: \ |
| 67 break; | 67 break; |
| 68 TARGET_ARCH_OPCODE_LIST(CASE) | 68 TARGET_ARCH_OPCODE_LIST(CASE) |
| 69 #undef CASE | 69 #undef CASE |
| 70 default: | 70 default: |
| 71 continue; | 71 continue; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 if (mode == kAllExceptNopInstructions && instr->arch_opcode() == kArchNop) { | 74 if (mode == kAllExceptNopInstructions && instr->arch_opcode() == kArchNop) { |
| 75 continue; | 75 continue; |
| 76 } | 76 } |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); | 611 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); |
| 612 // Continuation. | 612 // Continuation. |
| 613 | 613 |
| 614 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 614 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
| 615 EXPECT_EQ(index, s.size()); | 615 EXPECT_EQ(index, s.size()); |
| 616 } | 616 } |
| 617 | 617 |
| 618 } // namespace compiler | 618 } // namespace compiler |
| 619 } // namespace internal | 619 } // namespace internal |
| 620 } // namespace v8 | 620 } // namespace v8 |
| OLD | NEW |