| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 bool EffectControlLinearizer::TryWireInStateEffect(Node* node, | 392 bool EffectControlLinearizer::TryWireInStateEffect(Node* node, |
| 393 Node* frame_state, | 393 Node* frame_state, |
| 394 Node** effect, | 394 Node** effect, |
| 395 Node** control) { | 395 Node** control) { |
| 396 ValueEffectControl state(nullptr, nullptr, nullptr); | 396 ValueEffectControl state(nullptr, nullptr, nullptr); |
| 397 switch (node->opcode()) { | 397 switch (node->opcode()) { |
| 398 case IrOpcode::kTypeGuard: | |
| 399 state = LowerTypeGuard(node, *effect, *control); | |
| 400 break; | |
| 401 case IrOpcode::kChangeBitToTagged: | 398 case IrOpcode::kChangeBitToTagged: |
| 402 state = LowerChangeBitToTagged(node, *effect, *control); | 399 state = LowerChangeBitToTagged(node, *effect, *control); |
| 403 break; | 400 break; |
| 404 case IrOpcode::kChangeInt31ToTaggedSigned: | 401 case IrOpcode::kChangeInt31ToTaggedSigned: |
| 405 state = LowerChangeInt31ToTaggedSigned(node, *effect, *control); | 402 state = LowerChangeInt31ToTaggedSigned(node, *effect, *control); |
| 406 break; | 403 break; |
| 407 case IrOpcode::kChangeInt32ToTagged: | 404 case IrOpcode::kChangeInt32ToTagged: |
| 408 state = LowerChangeInt32ToTagged(node, *effect, *control); | 405 state = LowerChangeInt32ToTagged(node, *effect, *control); |
| 409 break; | 406 break; |
| 410 case IrOpcode::kChangeUint32ToTagged: | 407 case IrOpcode::kChangeUint32ToTagged: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 default: | 500 default: |
| 504 return false; | 501 return false; |
| 505 } | 502 } |
| 506 NodeProperties::ReplaceUses(node, state.value, state.effect, state.control); | 503 NodeProperties::ReplaceUses(node, state.value, state.effect, state.control); |
| 507 *effect = state.effect; | 504 *effect = state.effect; |
| 508 *control = state.control; | 505 *control = state.control; |
| 509 return true; | 506 return true; |
| 510 } | 507 } |
| 511 | 508 |
| 512 EffectControlLinearizer::ValueEffectControl | 509 EffectControlLinearizer::ValueEffectControl |
| 513 EffectControlLinearizer::LowerTypeGuard(Node* node, Node* effect, | |
| 514 Node* control) { | |
| 515 Node* value = node->InputAt(0); | |
| 516 return ValueEffectControl(value, effect, control); | |
| 517 } | |
| 518 | |
| 519 EffectControlLinearizer::ValueEffectControl | |
| 520 EffectControlLinearizer::LowerChangeFloat64ToTagged(Node* node, Node* effect, | 510 EffectControlLinearizer::LowerChangeFloat64ToTagged(Node* node, Node* effect, |
| 521 Node* control) { | 511 Node* control) { |
| 522 Node* value = node->InputAt(0); | 512 Node* value = node->InputAt(0); |
| 523 | 513 |
| 524 Node* value32 = graph()->NewNode(machine()->RoundFloat64ToInt32(), value); | 514 Node* value32 = graph()->NewNode(machine()->RoundFloat64ToInt32(), value); |
| 525 Node* check_same = graph()->NewNode( | 515 Node* check_same = graph()->NewNode( |
| 526 machine()->Float64Equal(), value, | 516 machine()->Float64Equal(), value, |
| 527 graph()->NewNode(machine()->ChangeInt32ToFloat64(), value32)); | 517 graph()->NewNode(machine()->ChangeInt32ToFloat64(), value32)); |
| 528 Node* branch_same = graph()->NewNode(common()->Branch(), check_same, control); | 518 Node* branch_same = graph()->NewNode(common()->Branch(), check_same, control); |
| 529 | 519 |
| (...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 1687 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 1698 Operator::kNoThrow); | 1688 Operator::kNoThrow); |
| 1699 to_number_operator_.set(common()->Call(desc)); | 1689 to_number_operator_.set(common()->Call(desc)); |
| 1700 } | 1690 } |
| 1701 return to_number_operator_.get(); | 1691 return to_number_operator_.get(); |
| 1702 } | 1692 } |
| 1703 | 1693 |
| 1704 } // namespace compiler | 1694 } // namespace compiler |
| 1705 } // namespace internal | 1695 } // namespace internal |
| 1706 } // namespace v8 | 1696 } // namespace v8 |
| OLD | NEW |