 Chromium Code Reviews
 Chromium Code Reviews Issue 2428443002:
  [wasm] Trim graph before scheduling.  (Closed)
    
  
    Issue 2428443002:
  [wasm] Trim graph before scheduling.  (Closed) 
  | 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); | |
| 
titzer
2016/10/19 09:20:42
If projection0 is not found, do you need to mark {
 
ahaas
2016/10/19 09:59:19
I mark {node} now always as word32.
 | |
| 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 MarkPairProjectionsAsWord32(node); | 
| 1344 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1345 return VisitInt32PairAdd(node); | 1354 return VisitInt32PairAdd(node); | 
| 1346 case IrOpcode::kInt32PairSub: | 1355 case IrOpcode::kInt32PairSub: | 
| 1347 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1356 MarkPairProjectionsAsWord32(node); | 
| 1348 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1349 return VisitInt32PairSub(node); | 1357 return VisitInt32PairSub(node); | 
| 1350 case IrOpcode::kInt32PairMul: | 1358 case IrOpcode::kInt32PairMul: | 
| 1351 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1359 MarkPairProjectionsAsWord32(node); | 
| 1352 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1353 return VisitInt32PairMul(node); | 1360 return VisitInt32PairMul(node); | 
| 1354 case IrOpcode::kWord32PairShl: | 1361 case IrOpcode::kWord32PairShl: | 
| 1355 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1362 MarkPairProjectionsAsWord32(node); | 
| 1356 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1357 return VisitWord32PairShl(node); | 1363 return VisitWord32PairShl(node); | 
| 1358 case IrOpcode::kWord32PairShr: | 1364 case IrOpcode::kWord32PairShr: | 
| 1359 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1365 MarkPairProjectionsAsWord32(node); | 
| 1360 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1361 return VisitWord32PairShr(node); | 1366 return VisitWord32PairShr(node); | 
| 1362 case IrOpcode::kWord32PairSar: | 1367 case IrOpcode::kWord32PairSar: | 
| 1363 MarkAsWord32(NodeProperties::FindProjection(node, 0)); | 1368 MarkPairProjectionsAsWord32(node); | 
| 1364 MarkAsWord32(NodeProperties::FindProjection(node, 1)); | |
| 1365 return VisitWord32PairSar(node); | 1369 return VisitWord32PairSar(node); | 
| 1366 case IrOpcode::kAtomicLoad: { | 1370 case IrOpcode::kAtomicLoad: { | 
| 1367 LoadRepresentation type = LoadRepresentationOf(node->op()); | 1371 LoadRepresentation type = LoadRepresentationOf(node->op()); | 
| 1368 MarkAsRepresentation(type.representation(), node); | 1372 MarkAsRepresentation(type.representation(), node); | 
| 1369 return VisitAtomicLoad(node); | 1373 return VisitAtomicLoad(node); | 
| 1370 } | 1374 } | 
| 1371 case IrOpcode::kAtomicStore: | 1375 case IrOpcode::kAtomicStore: | 
| 1372 return VisitAtomicStore(node); | 1376 return VisitAtomicStore(node); | 
| 1373 case IrOpcode::kProtectedLoad: | 1377 case IrOpcode::kProtectedLoad: | 
| 1374 return VisitProtectedLoad(node); | 1378 return VisitProtectedLoad(node); | 
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2125 return new (instruction_zone()) FrameStateDescriptor( | 2129 return new (instruction_zone()) FrameStateDescriptor( | 
| 2126 instruction_zone(), state_info.type(), state_info.bailout_id(), | 2130 instruction_zone(), state_info.type(), state_info.bailout_id(), | 
| 2127 state_info.state_combine(), parameters, locals, stack, | 2131 state_info.state_combine(), parameters, locals, stack, | 
| 2128 state_info.shared_info(), outer_state); | 2132 state_info.shared_info(), outer_state); | 
| 2129 } | 2133 } | 
| 2130 | 2134 | 
| 2131 | 2135 | 
| 2132 } // namespace compiler | 2136 } // namespace compiler | 
| 2133 } // namespace internal | 2137 } // namespace internal | 
| 2134 } // namespace v8 | 2138 } // namespace v8 | 
| OLD | NEW |