OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 break; | 451 break; |
452 case IrOpcode::kObjectIsUndetectable: | 452 case IrOpcode::kObjectIsUndetectable: |
453 state = LowerObjectIsUndetectable(node, *effect, *control); | 453 state = LowerObjectIsUndetectable(node, *effect, *control); |
454 break; | 454 break; |
455 case IrOpcode::kStringFromCharCode: | 455 case IrOpcode::kStringFromCharCode: |
456 state = LowerStringFromCharCode(node, *effect, *control); | 456 state = LowerStringFromCharCode(node, *effect, *control); |
457 break; | 457 break; |
458 case IrOpcode::kCheckIf: | 458 case IrOpcode::kCheckIf: |
459 state = LowerCheckIf(node, frame_state, *effect, *control); | 459 state = LowerCheckIf(node, frame_state, *effect, *control); |
460 break; | 460 break; |
| 461 case IrOpcode::kCheckUnless: |
| 462 state = LowerCheckUnless(node, frame_state, *effect, *control); |
| 463 break; |
461 case IrOpcode::kCheckFloat64Hole: | 464 case IrOpcode::kCheckFloat64Hole: |
462 state = LowerCheckFloat64Hole(node, frame_state, *effect, *control); | 465 state = LowerCheckFloat64Hole(node, frame_state, *effect, *control); |
463 break; | 466 break; |
464 case IrOpcode::kCheckTaggedHole: | 467 case IrOpcode::kCheckTaggedHole: |
465 state = LowerCheckTaggedHole(node, frame_state, *effect, *control); | 468 state = LowerCheckTaggedHole(node, frame_state, *effect, *control); |
466 break; | 469 break; |
467 case IrOpcode::kPlainPrimitiveToNumber: | 470 case IrOpcode::kPlainPrimitiveToNumber: |
468 state = LowerPlainPrimitiveToNumber(node, *effect, *control); | 471 state = LowerPlainPrimitiveToNumber(node, *effect, *control); |
469 break; | 472 break; |
470 case IrOpcode::kPlainPrimitiveToWord32: | 473 case IrOpcode::kPlainPrimitiveToWord32: |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 Node* effect, Node* control) { | 1328 Node* effect, Node* control) { |
1326 NodeProperties::ReplaceEffectInput(node, effect); | 1329 NodeProperties::ReplaceEffectInput(node, effect); |
1327 NodeProperties::ReplaceControlInput(node, control); | 1330 NodeProperties::ReplaceControlInput(node, control); |
1328 DCHECK_NOT_NULL(frame_state); | 1331 DCHECK_NOT_NULL(frame_state); |
1329 node->InsertInput(graph()->zone(), 1, frame_state); | 1332 node->InsertInput(graph()->zone(), 1, frame_state); |
1330 NodeProperties::ChangeOp(node, common()->DeoptimizeIf()); | 1333 NodeProperties::ChangeOp(node, common()->DeoptimizeIf()); |
1331 return ValueEffectControl(node, node, node); | 1334 return ValueEffectControl(node, node, node); |
1332 } | 1335 } |
1333 | 1336 |
1334 EffectControlLinearizer::ValueEffectControl | 1337 EffectControlLinearizer::ValueEffectControl |
| 1338 EffectControlLinearizer::LowerCheckUnless(Node* node, Node* frame_state, |
| 1339 Node* effect, Node* control) { |
| 1340 NodeProperties::ReplaceEffectInput(node, effect); |
| 1341 NodeProperties::ReplaceControlInput(node, control); |
| 1342 DCHECK_NOT_NULL(frame_state); |
| 1343 node->InsertInput(graph()->zone(), 1, frame_state); |
| 1344 NodeProperties::ChangeOp(node, common()->DeoptimizeUnless()); |
| 1345 return ValueEffectControl(node, node, node); |
| 1346 } |
| 1347 |
| 1348 EffectControlLinearizer::ValueEffectControl |
1335 EffectControlLinearizer::LowerCheckFloat64Hole(Node* node, Node* frame_state, | 1349 EffectControlLinearizer::LowerCheckFloat64Hole(Node* node, Node* frame_state, |
1336 Node* effect, Node* control) { | 1350 Node* effect, Node* control) { |
1337 // If we reach this point w/o eliminating the {node} that's marked | 1351 // If we reach this point w/o eliminating the {node} that's marked |
1338 // with allow-return-hole, we cannot do anything, so just deoptimize | 1352 // with allow-return-hole, we cannot do anything, so just deoptimize |
1339 // in case of the hole NaN (similar to Crankshaft). | 1353 // in case of the hole NaN (similar to Crankshaft). |
1340 Node* value = node->InputAt(0); | 1354 Node* value = node->InputAt(0); |
1341 Node* check = graph()->NewNode( | 1355 Node* check = graph()->NewNode( |
1342 machine()->Word32Equal(), | 1356 machine()->Word32Equal(), |
1343 graph()->NewNode(machine()->Float64ExtractHighWord32(), value), | 1357 graph()->NewNode(machine()->Float64ExtractHighWord32(), value), |
1344 jsgraph()->Int32Constant(kHoleNanUpper32)); | 1358 jsgraph()->Int32Constant(kHoleNanUpper32)); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 1588 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
1575 Operator::kNoThrow); | 1589 Operator::kNoThrow); |
1576 to_number_operator_.set(common()->Call(desc)); | 1590 to_number_operator_.set(common()->Call(desc)); |
1577 } | 1591 } |
1578 return to_number_operator_.get(); | 1592 return to_number_operator_.get(); |
1579 } | 1593 } |
1580 | 1594 |
1581 } // namespace compiler | 1595 } // namespace compiler |
1582 } // namespace internal | 1596 } // namespace internal |
1583 } // namespace v8 | 1597 } // namespace v8 |
OLD | NEW |