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 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); | 586 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); |
587 Node* const p0 = m.Parameter(0); | 587 Node* const p0 = m.Parameter(0); |
588 Node* const p1 = m.Parameter(1); | 588 Node* const p1 = m.Parameter(1); |
589 Node* const n = m.Int32MulHigh(p0, p1); | 589 Node* const n = m.Int32MulHigh(p0, p1); |
590 m.Return(n); | 590 m.Return(n); |
591 Stream s = m.Build(); | 591 Stream s = m.Build(); |
592 ASSERT_EQ(1U, s.size()); | 592 ASSERT_EQ(1U, s.size()); |
593 EXPECT_EQ(kIA32ImulHigh, s[0]->arch_opcode()); | 593 EXPECT_EQ(kIA32ImulHigh, s[0]->arch_opcode()); |
594 ASSERT_EQ(2U, s[0]->InputCount()); | 594 ASSERT_EQ(2U, s[0]->InputCount()); |
595 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 595 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 596 EXPECT_TRUE(s.IsFixed(s[0]->InputAt(0), eax)); |
596 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); | 597 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
| 598 EXPECT_TRUE(!s.IsUsedAtStart(s[0]->InputAt(1))); |
597 ASSERT_EQ(1U, s[0]->OutputCount()); | 599 ASSERT_EQ(1U, s[0]->OutputCount()); |
598 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 600 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 601 EXPECT_TRUE(s.IsFixed(s[0]->OutputAt(0), edx)); |
599 } | 602 } |
600 | 603 |
601 } // namespace compiler | 604 } // namespace compiler |
602 } // namespace internal | 605 } // namespace internal |
603 } // namespace v8 | 606 } // namespace v8 |
OLD | NEW |