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 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); | 2149 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); |
2150 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); | 2150 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); |
2151 ASSERT_EQ(1U, s[0]->OutputCount()); | 2151 ASSERT_EQ(1U, s[0]->OutputCount()); |
2152 } | 2152 } |
2153 } | 2153 } |
2154 | 2154 |
2155 | 2155 |
2156 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) { | 2156 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) { |
2157 const MemoryAccess memacc = GetParam(); | 2157 const MemoryAccess memacc = GetParam(); |
2158 StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type); | 2158 StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type); |
2159 m.Store(memacc.type, m.Parameter(0), m.Parameter(1), m.Parameter(2)); | 2159 StoreRepresentation store_rep(memacc.type, kNoWriteBarrier); |
| 2160 m.Store(store_rep, m.Parameter(0), m.Parameter(1), m.Parameter(2)); |
2160 m.Return(m.Int32Constant(0)); | 2161 m.Return(m.Int32Constant(0)); |
2161 Stream s = m.Build(); | 2162 Stream s = m.Build(); |
2162 ASSERT_EQ(1U, s.size()); | 2163 ASSERT_EQ(1U, s.size()); |
2163 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); | 2164 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); |
2164 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode()); | 2165 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode()); |
2165 EXPECT_EQ(3U, s[0]->InputCount()); | 2166 EXPECT_EQ(3U, s[0]->InputCount()); |
2166 EXPECT_EQ(0U, s[0]->OutputCount()); | 2167 EXPECT_EQ(0U, s[0]->OutputCount()); |
2167 } | 2168 } |
2168 | 2169 |
2169 | 2170 |
2170 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) { | 2171 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) { |
2171 const MemoryAccess memacc = GetParam(); | 2172 const MemoryAccess memacc = GetParam(); |
2172 TRACED_FOREACH(int32_t, index, memacc.immediates) { | 2173 TRACED_FOREACH(int32_t, index, memacc.immediates) { |
2173 StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type); | 2174 StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type); |
2174 m.Store(memacc.type, m.Parameter(0), m.Int32Constant(index), | 2175 StoreRepresentation store_rep(memacc.type, kNoWriteBarrier); |
2175 m.Parameter(1)); | 2176 m.Store(store_rep, m.Parameter(0), m.Int32Constant(index), m.Parameter(1)); |
2176 m.Return(m.Int32Constant(0)); | 2177 m.Return(m.Int32Constant(0)); |
2177 Stream s = m.Build(); | 2178 Stream s = m.Build(); |
2178 ASSERT_EQ(1U, s.size()); | 2179 ASSERT_EQ(1U, s.size()); |
2179 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); | 2180 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); |
2180 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); | 2181 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); |
2181 ASSERT_EQ(3U, s[0]->InputCount()); | 2182 ASSERT_EQ(3U, s[0]->InputCount()); |
2182 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); | 2183 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); |
2183 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); | 2184 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); |
2184 EXPECT_EQ(0U, s[0]->OutputCount()); | 2185 EXPECT_EQ(0U, s[0]->OutputCount()); |
2185 } | 2186 } |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3109 EXPECT_EQ(kArm64Float64Neg, s[0]->arch_opcode()); | 3110 EXPECT_EQ(kArm64Float64Neg, s[0]->arch_opcode()); |
3110 ASSERT_EQ(1U, s[0]->InputCount()); | 3111 ASSERT_EQ(1U, s[0]->InputCount()); |
3111 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 3112 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
3112 ASSERT_EQ(1U, s[0]->OutputCount()); | 3113 ASSERT_EQ(1U, s[0]->OutputCount()); |
3113 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 3114 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
3114 } | 3115 } |
3115 | 3116 |
3116 } // namespace compiler | 3117 } // namespace compiler |
3117 } // namespace internal | 3118 } // namespace internal |
3118 } // namespace v8 | 3119 } // namespace v8 |
OLD | NEW |