| 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/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
| 10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 // Exit block doesn't have control. | 926 // Exit block doesn't have control. |
| 927 DCHECK_NULL(input); | 927 DCHECK_NULL(input); |
| 928 break; | 928 break; |
| 929 } | 929 } |
| 930 default: | 930 default: |
| 931 UNREACHABLE(); | 931 UNREACHABLE(); |
| 932 break; | 932 break; |
| 933 } | 933 } |
| 934 } | 934 } |
| 935 | 935 |
| 936 void InstructionSelector::MarkPairProjectionsAsWord32(Node* node) { |
| 937 Node* projection0 = NodeProperties::FindProjection(node, 0); |
| 938 if (projection0) { |
| 939 MarkAsWord32(projection0); |
| 940 } |
| 941 Node* projection1 = NodeProperties::FindProjection(node, 1); |
| 942 if (projection1) { |
| 943 MarkAsWord32(projection1); |
| 944 } |
| 945 } |
| 936 | 946 |
| 937 void InstructionSelector::VisitNode(Node* node) { | 947 void InstructionSelector::VisitNode(Node* node) { |
| 938 DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes. | 948 DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes. |
| 939 switch (node->opcode()) { | 949 switch (node->opcode()) { |
| 940 case IrOpcode::kStart: | 950 case IrOpcode::kStart: |
| 941 case IrOpcode::kLoop: | 951 case IrOpcode::kLoop: |
| 942 case IrOpcode::kEnd: | 952 case IrOpcode::kEnd: |
| 943 case IrOpcode::kBranch: | 953 case IrOpcode::kBranch: |
| 944 case IrOpcode::kIfTrue: | 954 case IrOpcode::kIfTrue: |
| 945 case IrOpcode::kIfFalse: | 955 case IrOpcode::kIfFalse: |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 return VisitUnalignedStore(node); | 1343 return VisitUnalignedStore(node); |
| 1334 case IrOpcode::kCheckedLoad: { | 1344 case IrOpcode::kCheckedLoad: { |
| 1335 MachineRepresentation rep = | 1345 MachineRepresentation rep = |
| 1336 CheckedLoadRepresentationOf(node->op()).representation(); | 1346 CheckedLoadRepresentationOf(node->op()).representation(); |
| 1337 MarkAsRepresentation(rep, node); | 1347 MarkAsRepresentation(rep, node); |
| 1338 return VisitCheckedLoad(node); | 1348 return VisitCheckedLoad(node); |
| 1339 } | 1349 } |
| 1340 case IrOpcode::kCheckedStore: | 1350 case IrOpcode::kCheckedStore: |
| 1341 return VisitCheckedStore(node); | 1351 return VisitCheckedStore(node); |
| 1342 case IrOpcode::kInt32PairAdd: | 1352 case IrOpcode::kInt32PairAdd: |
| 1343 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1353 MarkAsWord32(node); |
| 1344 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1354 MarkPairProjectionsAsWord32(node); |
| 1345 return VisitInt32PairAdd(node); | 1355 return VisitInt32PairAdd(node); |
| 1346 case IrOpcode::kInt32PairSub: | 1356 case IrOpcode::kInt32PairSub: |
| 1347 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1357 MarkAsWord32(node); |
| 1348 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1358 MarkPairProjectionsAsWord32(node); |
| 1349 return VisitInt32PairSub(node); | 1359 return VisitInt32PairSub(node); |
| 1350 case IrOpcode::kInt32PairMul: | 1360 case IrOpcode::kInt32PairMul: |
| 1351 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1361 MarkAsWord32(node); |
| 1352 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1362 MarkPairProjectionsAsWord32(node); |
| 1353 return VisitInt32PairMul(node); | 1363 return VisitInt32PairMul(node); |
| 1354 case IrOpcode::kWord32PairShl: | 1364 case IrOpcode::kWord32PairShl: |
| 1355 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1365 MarkAsWord32(node); |
| 1356 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1366 MarkPairProjectionsAsWord32(node); |
| 1357 return VisitWord32PairShl(node); | 1367 return VisitWord32PairShl(node); |
| 1358 case IrOpcode::kWord32PairShr: | 1368 case IrOpcode::kWord32PairShr: |
| 1359 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1369 MarkAsWord32(node); |
| 1360 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1370 MarkPairProjectionsAsWord32(node); |
| 1361 return VisitWord32PairShr(node); | 1371 return VisitWord32PairShr(node); |
| 1362 case IrOpcode::kWord32PairSar: | 1372 case IrOpcode::kWord32PairSar: |
| 1363 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1373 MarkAsWord32(node); |
| 1364 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | 1374 MarkPairProjectionsAsWord32(node); |
| 1365 return VisitWord32PairSar(node); | 1375 return VisitWord32PairSar(node); |
| 1366 case IrOpcode::kAtomicLoad: { | 1376 case IrOpcode::kAtomicLoad: { |
| 1367 LoadRepresentation type = LoadRepresentationOf(node->op()); | 1377 LoadRepresentation type = LoadRepresentationOf(node->op()); |
| 1368 MarkAsRepresentation(type.representation(), node); | 1378 MarkAsRepresentation(type.representation(), node); |
| 1369 return VisitAtomicLoad(node); | 1379 return VisitAtomicLoad(node); |
| 1370 } | 1380 } |
| 1371 case IrOpcode::kAtomicStore: | 1381 case IrOpcode::kAtomicStore: |
| 1372 return VisitAtomicStore(node); | 1382 return VisitAtomicStore(node); |
| 1373 case IrOpcode::kProtectedLoad: | 1383 case IrOpcode::kProtectedLoad: |
| 1374 return VisitProtectedLoad(node); | 1384 return VisitProtectedLoad(node); |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2125 return new (instruction_zone()) FrameStateDescriptor( | 2135 return new (instruction_zone()) FrameStateDescriptor( |
| 2126 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2136 instruction_zone(), state_info.type(), state_info.bailout_id(), |
| 2127 state_info.state_combine(), parameters, locals, stack, | 2137 state_info.state_combine(), parameters, locals, stack, |
| 2128 state_info.shared_info(), outer_state); | 2138 state_info.shared_info(), outer_state); |
| 2129 } | 2139 } |
| 2130 | 2140 |
| 2131 | 2141 |
| 2132 } // namespace compiler | 2142 } // namespace compiler |
| 2133 } // namespace internal | 2143 } // namespace internal |
| 2134 } // namespace v8 | 2144 } // namespace v8 |
| OLD | NEW |