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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 | 1413 |
1414 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1414 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
1415 t.p1, t.start, t.start); | 1415 t.p1, t.start, t.start); |
1416 t.Effect(store); | 1416 t.Effect(store); |
1417 t.Lower(); | 1417 t.Lower(); |
1418 | 1418 |
1419 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1419 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1420 CHECK_EQ(t.p0, store->InputAt(0)); | 1420 CHECK_EQ(t.p0, store->InputAt(0)); |
1421 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); | 1421 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); |
1422 } | 1422 } |
| 1423 |
| 1424 |
| 1425 TEST(UpdatePhi) { |
| 1426 TestingGraph t(Type::Any(), Type::Signed32()); |
| 1427 static const MachineType kMachineTypes[] = {kMachInt32, kMachUint32, |
| 1428 kMachFloat64}; |
| 1429 |
| 1430 for (size_t i = 0; i < arraysize(kMachineTypes); i++) { |
| 1431 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, |
| 1432 Handle<Name>::null(), Type::Any(), kMachineTypes[i]}; |
| 1433 |
| 1434 Node* load0 = |
| 1435 t.graph()->NewNode(t.simplified()->LoadField(access), t.p0, t.start); |
| 1436 Node* load1 = |
| 1437 t.graph()->NewNode(t.simplified()->LoadField(access), t.p1, t.start); |
| 1438 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, |
| 1439 load1, t.start); |
| 1440 t.Return(t.Use(phi, kMachineTypes[i])); |
| 1441 t.Lower(); |
| 1442 |
| 1443 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); |
| 1444 CHECK_EQ(RepresentationOf(kMachineTypes[i]), |
| 1445 RepresentationOf(OpParameter<MachineType>(phi))); |
| 1446 } |
| 1447 } |
OLD | NEW |