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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/change-lowering.h" | 9 #include "src/compiler/change-lowering.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, | 1363 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
1364 Handle<Name>::null(), Type::Any(), | 1364 Handle<Name>::null(), Type::Any(), |
1365 MachineType::AnyTagged()}; | 1365 MachineType::AnyTagged()}; |
1366 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1366 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
1367 t.p1, t.start, t.start); | 1367 t.p1, t.start, t.start); |
1368 t.Effect(store); | 1368 t.Effect(store); |
1369 t.LowerAllNodesAndLowerChanges(); | 1369 t.LowerAllNodesAndLowerChanges(); |
1370 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1370 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1371 CHECK_EQ(t.p1, store->InputAt(2)); | 1371 CHECK_EQ(t.p1, store->InputAt(2)); |
1372 StoreRepresentation rep = StoreRepresentationOf(store->op()); | 1372 StoreRepresentation rep = StoreRepresentationOf(store->op()); |
1373 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); | 1373 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); |
1374 } | 1374 } |
1375 } | 1375 } |
1376 | 1376 |
1377 | 1377 |
1378 TEST(LowerLoadElement_to_load) { | 1378 TEST(LowerLoadElement_to_load) { |
1379 for (size_t i = 0; i < arraysize(kMachineReps); i++) { | 1379 for (size_t i = 0; i < arraysize(kMachineReps); i++) { |
1380 TestingGraph t(Type::Any(), Type::Signed32()); | 1380 TestingGraph t(Type::Any(), Type::Signed32()); |
1381 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, | 1381 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
1382 Type::Any(), kMachineReps[i]}; | 1382 Type::Any(), kMachineReps[i]}; |
1383 | 1383 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z)); | 1428 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z)); |
1429 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, | 1429 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
1430 Type::Any(), MachineType::AnyTagged()}; | 1430 Type::Any(), MachineType::AnyTagged()}; |
1431 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, | 1431 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, |
1432 t.p1, t.p2, t.start, t.start); | 1432 t.p1, t.p2, t.start, t.start); |
1433 t.Effect(store); | 1433 t.Effect(store); |
1434 t.LowerAllNodesAndLowerChanges(); | 1434 t.LowerAllNodesAndLowerChanges(); |
1435 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1435 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1436 CHECK_EQ(t.p2, store->InputAt(2)); | 1436 CHECK_EQ(t.p2, store->InputAt(2)); |
1437 StoreRepresentation rep = StoreRepresentationOf(store->op()); | 1437 StoreRepresentation rep = StoreRepresentationOf(store->op()); |
1438 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); | 1438 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); |
1439 } | 1439 } |
1440 } | 1440 } |
1441 | 1441 |
1442 | 1442 |
1443 TEST(InsertChangeForLoadElementIndex) { | 1443 TEST(InsertChangeForLoadElementIndex) { |
1444 // LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) => | 1444 // LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) => |
1445 // Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k)) | 1445 // Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k)) |
1446 TestingGraph t(Type::Any(), Type::Signed32()); | 1446 TestingGraph t(Type::Any(), Type::Signed32()); |
1447 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), | 1447 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), |
1448 MachineType::AnyTagged()}; | 1448 MachineType::AnyTagged()}; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 t.Return(use); | 1939 t.Return(use); |
1940 t.Lower(); | 1940 t.Lower(); |
1941 | 1941 |
1942 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op())); | 1942 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op())); |
1943 } | 1943 } |
1944 } | 1944 } |
1945 | 1945 |
1946 } // namespace compiler | 1946 } // namespace compiler |
1947 } // namespace internal | 1947 } // namespace internal |
1948 } // namespace v8 | 1948 } // namespace v8 |
OLD | NEW |