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 "src/compiler/opcodes.h" | 5 #include "src/compiler/opcodes.h" |
6 #include "src/compiler/operator.h" | 6 #include "src/compiler/operator.h" |
7 #include "src/compiler/operator-properties.h" | 7 #include "src/compiler/operator-properties.h" |
8 #include "src/compiler/simplified-operator.h" | 8 #include "src/compiler/simplified-operator.h" |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 | 197 |
198 // ----------------------------------------------------------------------------- | 198 // ----------------------------------------------------------------------------- |
199 // Element access operators. | 199 // Element access operators. |
200 | 200 |
201 | 201 |
202 namespace { | 202 namespace { |
203 | 203 |
204 const ElementAccess kElementAccesses[] = { | 204 const ElementAccess kElementAccesses[] = { |
205 {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), | 205 {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), |
206 MachineType::AnyTagged()}, | 206 MachineType::AnyTagged(), kFullWriteBarrier}, |
207 {kUntaggedBase, 0, Type::Any(), MachineType::Int8()}, | 207 {kUntaggedBase, 0, Type::Any(), MachineType::Int8(), kNoWriteBarrier}, |
208 {kUntaggedBase, 0, Type::Any(), MachineType::Int16()}, | 208 {kUntaggedBase, 0, Type::Any(), MachineType::Int16(), kNoWriteBarrier}, |
209 {kUntaggedBase, 0, Type::Any(), MachineType::Int32()}, | 209 {kUntaggedBase, 0, Type::Any(), MachineType::Int32(), kNoWriteBarrier}, |
210 {kUntaggedBase, 0, Type::Any(), MachineType::Uint8()}, | 210 {kUntaggedBase, 0, Type::Any(), MachineType::Uint8(), kNoWriteBarrier}, |
211 {kUntaggedBase, 0, Type::Any(), MachineType::Uint16()}, | 211 {kUntaggedBase, 0, Type::Any(), MachineType::Uint16(), kNoWriteBarrier}, |
212 {kUntaggedBase, 0, Type::Any(), MachineType::Uint32()}, | 212 {kUntaggedBase, 0, Type::Any(), MachineType::Uint32(), kNoWriteBarrier}, |
213 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int8()}, | 213 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int8(), kNoWriteBarrier}, |
214 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint8()}, | 214 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint8(), |
215 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int16()}, | 215 kNoWriteBarrier}, |
216 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint16()}, | 216 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int16(), kNoWriteBarrier}, |
217 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int32()}, | 217 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint16(), |
218 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint32()}, | 218 kNoWriteBarrier}, |
| 219 {kUntaggedBase, 0, Type::Signed32(), MachineType::Int32(), kNoWriteBarrier}, |
| 220 {kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint32(), |
| 221 kNoWriteBarrier}, |
219 {kUntaggedBase, 0, Type::Number(), | 222 {kUntaggedBase, 0, Type::Number(), |
220 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone)}, | 223 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone), |
| 224 kNoWriteBarrier}, |
221 {kUntaggedBase, 0, Type::Number(), | 225 {kUntaggedBase, 0, Type::Number(), |
222 MachineType(MachineRepresentation::kFloat64, MachineSemantic::kNone)}, | 226 MachineType(MachineRepresentation::kFloat64, MachineSemantic::kNone), |
| 227 kNoWriteBarrier}, |
223 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), | 228 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), |
224 MachineType::Int8()}, | 229 MachineType::Int8(), kNoWriteBarrier}, |
225 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), | 230 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), |
226 MachineType::Uint8()}, | 231 MachineType::Uint8(), kNoWriteBarrier}, |
227 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), | 232 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), |
228 MachineType::Int16()}, | 233 MachineType::Int16(), kNoWriteBarrier}, |
229 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), | 234 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), |
230 MachineType::Uint16()}, | 235 MachineType::Uint16(), kNoWriteBarrier}, |
231 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), | 236 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), |
232 MachineType::Int32()}, | 237 MachineType::Int32(), kNoWriteBarrier}, |
233 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), | 238 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), |
234 MachineType::Uint32()}, | 239 MachineType::Uint32(), kNoWriteBarrier}, |
235 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), | 240 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), |
236 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone)}, | 241 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone), |
| 242 kNoWriteBarrier}, |
237 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), | 243 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), |
238 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone)}}; | 244 MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone), |
| 245 kNoWriteBarrier}}; |
239 | 246 |
240 } // namespace | 247 } // namespace |
241 | 248 |
242 | 249 |
243 class SimplifiedElementAccessOperatorTest | 250 class SimplifiedElementAccessOperatorTest |
244 : public TestWithZone, | 251 : public TestWithZone, |
245 public ::testing::WithParamInterface<ElementAccess> {}; | 252 public ::testing::WithParamInterface<ElementAccess> {}; |
246 | 253 |
247 | 254 |
248 TEST_P(SimplifiedElementAccessOperatorTest, LoadElement) { | 255 TEST_P(SimplifiedElementAccessOperatorTest, LoadElement) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 292 } |
286 | 293 |
287 | 294 |
288 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, | 295 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, |
289 SimplifiedElementAccessOperatorTest, | 296 SimplifiedElementAccessOperatorTest, |
290 ::testing::ValuesIn(kElementAccesses)); | 297 ::testing::ValuesIn(kElementAccesses)); |
291 | 298 |
292 } // namespace compiler | 299 } // namespace compiler |
293 } // namespace internal | 300 } // namespace internal |
294 } // namespace v8 | 301 } // namespace v8 |
OLD | NEW |