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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/control-builders.h" | 8 #include "src/compiler/control-builders.h" |
9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" |
10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 CHECK_EQ(*src, array->get(1)); | 228 CHECK_EQ(*src, array->get(1)); |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 | 232 |
233 TEST(RunLoadStoreArrayBuffer) { | 233 TEST(RunLoadStoreArrayBuffer) { |
234 SimplifiedLoweringTester<Object*> t(kMachAnyTagged); | 234 SimplifiedLoweringTester<Object*> t(kMachAnyTagged); |
235 const int index = 12; | 235 const int index = 12; |
236 const int array_length = 2 * index; | 236 const int array_length = 2 * index; |
237 ElementAccess buffer_access = | 237 ElementAccess buffer_access = |
238 AccessBuilder::ForBackingStoreElement(kMachInt8); | 238 AccessBuilder::ForTypedArrayElement(v8::kExternalInt8Array, true); |
239 Node* backing_store = t.LoadField( | 239 Node* backing_store = t.LoadField( |
240 AccessBuilder::ForJSArrayBufferBackingStore(), t.Parameter(0)); | 240 AccessBuilder::ForJSArrayBufferBackingStore(), t.Parameter(0)); |
241 Node* load = | 241 Node* load = |
242 t.LoadElement(buffer_access, backing_store, t.Int32Constant(index), | 242 t.LoadElement(buffer_access, backing_store, t.Int32Constant(index), |
243 t.Int32Constant(array_length)); | 243 t.Int32Constant(array_length)); |
244 t.StoreElement(buffer_access, backing_store, t.Int32Constant(index + 1), | 244 t.StoreElement(buffer_access, backing_store, t.Int32Constant(index + 1), |
245 t.Int32Constant(array_length), load); | 245 t.Int32Constant(array_length), load); |
246 t.Return(t.jsgraph.TrueConstant()); | 246 t.Return(t.jsgraph.TrueConstant()); |
247 | 247 |
248 t.LowerAllNodes(); | 248 t.LowerAllNodes(); |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, | 1516 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, |
1517 load1, t.start); | 1517 load1, t.start); |
1518 t.Return(t.Use(phi, kMachineTypes[i])); | 1518 t.Return(t.Use(phi, kMachineTypes[i])); |
1519 t.Lower(); | 1519 t.Lower(); |
1520 | 1520 |
1521 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); | 1521 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); |
1522 CHECK_EQ(RepresentationOf(kMachineTypes[i]), | 1522 CHECK_EQ(RepresentationOf(kMachineTypes[i]), |
1523 RepresentationOf(OpParameter<MachineType>(phi))); | 1523 RepresentationOf(OpParameter<MachineType>(phi))); |
1524 } | 1524 } |
1525 } | 1525 } |
OLD | NEW |