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/change-lowering.h" | 8 #include "src/compiler/change-lowering.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 CheckFieldAccessArithmetic(access, store); | 1445 CheckFieldAccessArithmetic(access, store); |
1446 | 1446 |
1447 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); | 1447 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); |
1448 if (kMachineReps[i] & kRepTagged) { | 1448 if (kMachineReps[i] & kRepTagged) { |
1449 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); | 1449 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); |
1450 } | 1450 } |
1451 CHECK_EQ(kMachineReps[i], rep.machine_type()); | 1451 CHECK_EQ(kMachineReps[i], rep.machine_type()); |
1452 } | 1452 } |
1453 } | 1453 } |
1454 { | 1454 { |
1455 TestingGraph t(Type::Any(), | 1455 HandleAndZoneScope scope; |
1456 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned())); | 1456 Zone* z = scope.main_zone(); |
| 1457 TestingGraph t(Type::Any(), Type::Intersect(Type::SignedSmall(), |
| 1458 Type::TaggedSigned(), z)); |
1457 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, | 1459 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
1458 Handle<Name>::null(), Type::Any(), kMachAnyTagged}; | 1460 Handle<Name>::null(), Type::Any(), kMachAnyTagged}; |
1459 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1461 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
1460 t.p1, t.start, t.start); | 1462 t.p1, t.start, t.start); |
1461 t.Effect(store); | 1463 t.Effect(store); |
1462 t.Lower(); | 1464 t.Lower(); |
1463 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1465 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1464 CHECK_EQ(t.p1, store->InputAt(2)); | 1466 CHECK_EQ(t.p1, store->InputAt(2)); |
1465 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); | 1467 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); |
1466 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); | 1468 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 CheckElementAccessArithmetic(access, store); | 1510 CheckElementAccessArithmetic(access, store); |
1509 | 1511 |
1510 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); | 1512 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); |
1511 if (kMachineReps[i] & kRepTagged) { | 1513 if (kMachineReps[i] & kRepTagged) { |
1512 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); | 1514 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); |
1513 } | 1515 } |
1514 CHECK_EQ(kMachineReps[i], rep.machine_type()); | 1516 CHECK_EQ(kMachineReps[i], rep.machine_type()); |
1515 } | 1517 } |
1516 } | 1518 } |
1517 { | 1519 { |
1518 TestingGraph t(Type::Any(), Type::Signed32(), | 1520 HandleAndZoneScope scope; |
1519 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned())); | 1521 Zone* z = scope.main_zone(); |
| 1522 TestingGraph t( |
| 1523 Type::Any(), Type::Signed32(), |
| 1524 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z)); |
1520 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, | 1525 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
1521 Type::Any(), kMachAnyTagged}; | 1526 Type::Any(), kMachAnyTagged}; |
1522 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, | 1527 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, |
1523 t.p1, t.p2, t.start, t.start); | 1528 t.p1, t.p2, t.start, t.start); |
1524 t.Effect(store); | 1529 t.Effect(store); |
1525 t.Lower(); | 1530 t.Lower(); |
1526 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1531 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1527 CHECK_EQ(t.p2, store->InputAt(2)); | 1532 CHECK_EQ(t.p2, store->InputAt(2)); |
1528 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); | 1533 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); |
1529 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); | 1534 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); | 2047 Bounds phi_bounds = Bounds::Either(Bounds(d.arg1), Bounds(d.arg2), z); |
2043 NodeProperties::SetBounds(phi, phi_bounds); | 2048 NodeProperties::SetBounds(phi, phi_bounds); |
2044 | 2049 |
2045 Node* use = t.Use(phi, d.use); | 2050 Node* use = t.Use(phi, d.use); |
2046 t.Return(use); | 2051 t.Return(use); |
2047 t.Lower(); | 2052 t.Lower(); |
2048 | 2053 |
2049 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); | 2054 CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); |
2050 } | 2055 } |
2051 } | 2056 } |
OLD | NEW |